[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20140915165545.GA2039@pathfinder>
Date: Mon, 15 Sep 2014 09:55:45 -0700
From: "David E. Box" <david.e.box@...ux.intel.com>
To: Maxime Coquelin <maxime.coquelin@...com>
Cc: wsa@...-dreams.de, jdelvare@...e.de, arnd@...db.de,
dianders@...omium.org, sjg@...omium.org,
laurent.pinchart+renesas@...asonboard.com,
u.kleine-koenig@...gutronix.de, boris.brezillon@...e-electrons.com,
max.schwarz@...ine.de, schwidefsky@...ibm.com, iivanov@...sol.com,
jacob.jun.pan@...ux.intel.com, soren.brinkmann@...inx.com,
bjorn.andersson@...ymobile.com, andrew@...n.ch, skuribay@...ox.com,
christian.ruppert@...lis.com, Romain.Baeriswyl@...lis.com,
mika.westerberg@...ux.intel.com, linux-kernel@...r.kernel.org,
linux-i2c@...r.kernel.org
Subject: Re: [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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists