lkml.org 
[lkml]   [2014]   [Sep]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] i2c-designware: Intel BayTrail PMIC I2C bus support
Hi Maxime,

On Mon, Sep 15, 2014 at 08:57:38AM +0200, Maxime Coquelin wrote:

> >+ err = dev->acquire_ownership(dev->dev);
> Have you considered using hwspinlocks instead?

No, I've not used it before but it looks applicable here. I'll take a look.

> >@@ -212,6 +259,25 @@ static int dw_i2c_probe(struct platform_device *pdev)
> > adap->dev.parent = &pdev->dev;
> > adap->dev.of_node = pdev->dev.of_node;
> >
> >+#if IS_ENABLED(CONFIG_I2C_SHARED_CONTROLLER)
> >+ if (dev->shared_host)
> >+ adap->algo = &i2c_sc_algo;
> >+
> >+ r = i2c_add_numbered_adapter(adap);
> >+ if (r) {
> >+ dev_err(&pdev->dev, "failure adding adapter\n");
> >+ return r;
> >+ }
> >+
> >+ if (dev->shared_host)
> >+ pm_runtime_forbid(&pdev->dev);
> >+ else {
> >+ pm_runtime_set_autosuspend_delay(&pdev->dev, 1000);
> >+ pm_runtime_use_autosuspend(&pdev->dev);
> >+ pm_runtime_set_active(&pdev->dev);
> >+ pm_runtime_enable(&pdev->dev);
> >+ }
> >+#else
> Why do you put all this under config flags?

So that this additional code only compiles for this very specific
implementation.

> >@@ -268,7 +334,11 @@ static int dw_i2c_resume(struct device *dev)
> > struct dw_i2c_dev *i_dev = platform_get_drvdata(pdev);
> >
> > clk_prepare_enable(i_dev->clk);
> >- i2c_dw_init(i_dev);
> >+
> >+#if IS_ENABLED(CONFIG_I2C_SHARED_CONTROLLER)
> >+ if (!i_dev->shared_host)
> >+#endif
> Putting this under config flag should not be needed.
>
> And even not under config flags, why don't you re-initialize your
> device in case of resume?

Because the device is already being managed by hardware, not the OS.

David Box


\
 
 \ /
  Last update: 2014-09-15 19:41    [W:0.253 / U:3.880 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site