From: mturquette@linaro.org (Mike Turquette)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH RESEND 1/4] clk: clk-s2mps11: Refactor for including support for other MFD clocks
Date: Sun, 29 Dec 2013 14:17:23 -0800 [thread overview]
Message-ID: <20131229221723.12054.40917@quantum> (raw)
In-Reply-To: <1388053141-30085-2-git-send-email-tushar.behera@linaro.org>
Quoting Tushar Behera (2013-12-26 02:18:58)
> 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.
Can you rebase patches #1 & #2 onto clk-next? They do not apply cleanly
as-is.
Regards,
Mike
>
> Signed-off-by: Tushar Behera <tushar.behera@linaro.org>
> Reviewed-by: Tomasz Figa <t.figa@samsung.com>
> Reviewed-by: Yadwinder Singh Brar <yadi.brar@samsung.com>
> CC: Mike Turquette <mturquette@linaro.org>
> ---
> 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 00a3abe..43e25bb 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_pmic,
> - 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_pmic, S2MPS11_REG_RTC_CTRL,
> + ret = regmap_update_bits(s2mps11->iodev->regmap_pmic, 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_pmic,
> - 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
>
next prev parent reply other threads:[~2013-12-29 22:17 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-31 6:48 [PATCH 0/4] Add support for clocks in S5M8767 Tushar Behera
2013-10-31 6:48 ` [PATCH 1/4] clk: clk-s2mps11: Refactor for including support for other MFD clocks Tushar Behera
2013-11-11 14:17 ` Yadwinder Singh Brar
2013-10-31 6:48 ` [PATCH 2/4] clk: clk-s2mps11: Add support for clocks in S5M8767 MFD Tushar Behera
2013-11-11 14:18 ` Yadwinder Singh Brar
2013-10-31 6:48 ` [PATCH 3/4] mfd: sec-core: Add cells for S5M8767-clocks Tushar Behera
2013-10-31 16:16 ` Lee Jones
2013-11-05 6:29 ` Tushar Behera
2013-11-05 7:57 ` Kyungmin Park
2013-11-05 8:04 ` Tushar Behera
2013-11-05 8:58 ` Kyungmin Park
2013-10-31 6:48 ` [PATCH 4/4] ARM: dts: Add S5M8767 clock nodes on Arndale board Tushar Behera
2013-11-10 12:34 ` [PATCH 0/4] Add support for clocks in S5M8767 Tomasz Figa
2013-11-11 2:58 ` Tushar Behera
2013-12-24 8:57 ` Tushar Behera
2013-12-26 10:18 ` [PATCH RESEND " Tushar Behera
2013-12-26 10:18 ` [PATCH RESEND 1/4] clk: clk-s2mps11: Refactor for including support for other MFD clocks Tushar Behera
2013-12-29 22:17 ` Mike Turquette [this message]
2013-12-30 4:03 ` Tushar Behera
2013-12-31 16:09 ` Mark Brown
2013-12-31 19:13 ` Mike Turquette
2013-12-26 10:18 ` [PATCH RESEND 2/4] clk: clk-s2mps11: Add support for clocks in S5M8767 MFD Tushar Behera
2013-12-26 10:19 ` [PATCH RESEND 3/4] mfd: sec-core: Add cells for S5M8767-clocks Tushar Behera
2014-01-06 11:22 ` Lee Jones
2013-12-26 10:19 ` [PATCH RESEND 4/4] ARM: dts: Add S5M8767 clock nodes on Arndale board Tushar Behera
[not found] <m8Uox-5kN-11@gated-at.bofh.it>
[not found] ` <mtgmt-44E-3@gated-at.bofh.it>
[not found] ` <mtgmu-44E-27@gated-at.bofh.it>
[not found] ` <muwSe-WJ-17@gated-at.bofh.it>
[not found] ` <muCkW-RP-15@gated-at.bofh.it>
[not found] ` <mva3f-bR-7@gated-at.bofh.it>
[not found] ` <mvd17-4vW-3@gated-at.bofh.it>
2014-01-29 10:29 ` [PATCH RESEND 1/4] clk: clk-s2mps11: Refactor for including support for other MFD clocks Krzysztof Kozlowski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20131229221723.12054.40917@quantum \
--to=mturquette@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox