lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 11 Nov 2013 23:17:05 +0900
From:	Yadwinder Singh Brar <yadi.brar01@...il.com>
To:	Tushar Behera <tushar.behera@...aro.org>
Cc:	linux-kernel <linux-kernel@...r.kernel.org>,
	"linux-arm-kernel@...ts.infradead.org" 
	<linux-arm-kernel@...ts.infradead.org>,
	linux-samsung-soc <linux-samsung-soc@...r.kernel.org>,
	Mike Turquette <mturquette@...aro.org>,
	Lee Jones <lee.jones@...aro.org>,
	Kukjin Kim <kgene.kim@...sung.com>,
	Patch Tracking <patches@...aro.org>,
	Yadwinder Singh Brar <yadi.brar@...sung.com>
Subject: Re: [PATCH 1/4] clk: clk-s2mps11: Refactor for including support for
 other MFD clocks

On Thu, Oct 31, 2013 at 3:48 PM, Tushar Behera <tushar.behera@...aro.org> wrote:
> The clocks in S2MPS11 and S5M8767 are managed in the same way, baring
> a difference in the register offset. It would be better to update
> existing S2MPS11 driver to support the clocks in S5M8767, rather than
> creating an almost duplicate driver altogether.
>
> Signed-off-by: Tushar Behera <tushar.behera@...aro.org>
> CC: Yadwinder Singh Brar <yadi.brar@...sung.com>
> CC: Mike Turquette <mturquette@...aro.org>
> ---

Reviewed-by: Yadwinder Singh Brar <yadi.brar@...sung.com>

Regards,
Yadwinder

>  drivers/clk/clk-s2mps11.c |   20 ++++++++++++++++----
>  1 file changed, 16 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/clk/clk-s2mps11.c b/drivers/clk/clk-s2mps11.c
> index 7be41e6..2262cb4 100644
> --- a/drivers/clk/clk-s2mps11.c
> +++ b/drivers/clk/clk-s2mps11.c
> @@ -48,6 +48,7 @@ struct s2mps11_clk {
>         struct clk_lookup *lookup;
>         u32 mask;
>         bool enabled;
> +       unsigned int reg;
>  };
>
>  static struct s2mps11_clk *to_s2mps11_clk(struct clk_hw *hw)
> @@ -61,7 +62,7 @@ static int s2mps11_clk_prepare(struct clk_hw *hw)
>         int ret;
>
>         ret = regmap_update_bits(s2mps11->iodev->regmap,
> -                               S2MPS11_REG_RTC_CTRL,
> +                                s2mps11->reg,
>                                  s2mps11->mask, s2mps11->mask);
>         if (!ret)
>                 s2mps11->enabled = true;
> @@ -74,7 +75,7 @@ static void s2mps11_clk_unprepare(struct clk_hw *hw)
>         struct s2mps11_clk *s2mps11 = to_s2mps11_clk(hw);
>         int ret;
>
> -       ret = regmap_update_bits(s2mps11->iodev->regmap, S2MPS11_REG_RTC_CTRL,
> +       ret = regmap_update_bits(s2mps11->iodev->regmap, s2mps11->reg,
>                            s2mps11->mask, ~s2mps11->mask);
>
>         if (!ret)
> @@ -155,6 +156,7 @@ static int s2mps11_clk_probe(struct platform_device *pdev)
>         struct sec_pmic_dev *iodev = dev_get_drvdata(pdev->dev.parent);
>         struct s2mps11_clk *s2mps11_clks, *s2mps11_clk;
>         struct device_node *clk_np = NULL;
> +       unsigned int s2mps11_reg;
>         int i, ret = 0;
>         u32 val;
>
> @@ -169,13 +171,23 @@ static int s2mps11_clk_probe(struct platform_device *pdev)
>         if (IS_ERR(clk_np))
>                 return PTR_ERR(clk_np);
>
> +       switch(platform_get_device_id(pdev)->driver_data) {
> +       case S2MPS11X:
> +               s2mps11_reg = S2MPS11_REG_RTC_CTRL;
> +               break;
> +       default:
> +               dev_err(&pdev->dev, "Invalid device type\n");
> +               return -EINVAL;
> +       };
> +
>         for (i = 0; i < S2MPS11_CLKS_NUM; i++, s2mps11_clk++) {
>                 s2mps11_clk->iodev = iodev;
>                 s2mps11_clk->hw.init = &s2mps11_clks_init[i];
>                 s2mps11_clk->mask = 1 << i;
> +               s2mps11_clk->reg = s2mps11_reg;
>
>                 ret = regmap_read(s2mps11_clk->iodev->regmap,
> -                                 S2MPS11_REG_RTC_CTRL, &val);
> +                                 s2mps11_clk->reg, &val);
>                 if (ret < 0)
>                         goto err_reg;
>
> @@ -241,7 +253,7 @@ static int s2mps11_clk_remove(struct platform_device *pdev)
>  }
>
>  static const struct platform_device_id s2mps11_clk_id[] = {
> -       { "s2mps11-clk", 0},
> +       { "s2mps11-clk", S2MPS11X},
>         { },
>  };
>  MODULE_DEVICE_TABLE(platform, s2mps11_clk_id);
> --
> 1.7.9.5
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
> the body of a message to majordomo@...r.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
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