lkml.org 
[lkml]   [2014]   [Dec]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH V3 1/2] i2c-designware: Add i2c bus locking support
Hi

On 12/02/2014 02:09 AM, David E. Box wrote:
> Adds support for acquiring and releasing a hardware bus lock in the i2c
> designware core transfer function. This is needed for i2c bus controllers
> that are shared with but not controlled by the kernel.
>
> Signed-off-by: David E. Box <david.e.box@linux.intel.com>
> ---
> drivers/i2c/busses/i2c-designware-core.c | 11 +++++++++++
> drivers/i2c/busses/i2c-designware-core.h | 6 ++++++
> drivers/i2c/busses/i2c-designware-platdrv.c | 18 +++++++++++++-----
> 3 files changed, 30 insertions(+), 5 deletions(-)
>
...
> diff --git a/drivers/i2c/busses/i2c-designware-platdrv.c b/drivers/i2c/busses/i2c-designware-platdrv.c
> index a743115..afdff3b 100644
> --- a/drivers/i2c/busses/i2c-designware-platdrv.c
> +++ b/drivers/i2c/busses/i2c-designware-platdrv.c
> @@ -261,10 +261,16 @@ static int dw_i2c_probe(struct platform_device *pdev)
> return r;
> }
>
> - 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);
> + i2c_dw_eval_lock_support(dev);
i2c_dw_eval_lock_support() is added in the next patch.
> +
> + if (dev->pm_runtime_disabled) {
> + 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);
> + }
>
> return 0;
> }
> @@ -314,7 +320,9 @@ 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 (!i_dev->pm_runtime_disabled)
> + i2c_dw_init(i_dev);
>
Should there be similar conditional call or locking around i2c_dw_init()
and i2c_dw_disable_int() also in dw_i2c_probe()?

--
Jarkko


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