Re: [PATCH RESEND 1/4] clk: clk-s2mps11: Refactor for including support for other MFD clocks
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 > Reviewed-by: Tomasz Figa > Reviewed-by: Yadwinder Singh Brar > CC: Mike Turquette > --- > 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 > -- To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH RESEND 1/4] clk: clk-s2mps11: Refactor for including support for other MFD clocks
On 30 December 2013 03:47, Mike Turquette wrote: > 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 > Commit 1b1ccee1e821 "mfd: s2mps11: Fix build after regmap field rename in sec-core.c" is also touching this file, which is in Mark's tree right now. If I rebase this patch on top clk-next, I am getting conflicts when I merge that with linux-next. Let me know how you want to handle this. I am attaching the rebased patches for your reference. If you want, I will send them again through git-send-email. -- Tushar Behera From f4f730d4bea3848d21e487aa08ff019c588e6ecd Mon Sep 17 00:00:00 2001 From: Tushar Behera Date: Wed, 30 Oct 2013 15:55:44 +0530 Subject: [PATCH 1/4] clk: clk-s2mps11: Refactor for including support for other MFD clocks 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 to create an almost duplicate driver altogether. Signed-off-by: Tushar Behera Reviewed-by: Tomasz Figa --- 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..494d1df 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 From 5f3843da7bc71d126c0cce7a8e88aab1850c4b9c Mon Sep 17 00:00:00 2001 From: Tushar Behera Date: Wed, 30 Oct 2013 15:56:27 +0530 Subject: [PATCH 2/4] clk: clk-s2mps11: Add support for clocks in S5M8767 MFD Since clock operation within S2MPS11 and S5M8767 are similar, we can support both the devices within a single driver. Signed-off-by: Tushar Behera Reviewed-by: Tomasz Figa --- drivers/clk/Kconfig |6 -- drivers/clk/clk-s2mps11.c |5 + 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/clk/Kconfig b/drivers/clk/Kconfig index 407cffb..99332da 100644 --- a/drivers/clk/Kconfig +++ b/drivers/clk/Kconfig @@ -65,10 +65,12 @@ config COMMON_CLK_SI570 clock generators. config COMMON_CLK_S2MPS11 - tristate "Clock driver for S2MPS11 MFD" + tristate "Clock driver for S2MPS11/S5M8767 MFD" depends on MFD_SEC_CORE ---help--- - This driver supports S2MPS11 crystal oscillator clock. + This driver supports S2MPS11/S5M8767 crystal oscillator clock. These + multi-function devices have 3 fixed-rate oscillators, clocked at + 32KHz each. config CLK_TWL6040 tristate "External McPDM functional clock from twl6040" diff --git a/drivers/clk/clk-s2mps11.c b/drivers/clk/clk-s2mps11.c index 494d1df..37e7285 10064
Re: [PATCH RESEND 1/4] clk: clk-s2mps11: Refactor for including support for other MFD clocks
On Mon, Dec 30, 2013 at 09:33:50AM +0530, Tushar Behera wrote: > Commit 1b1ccee1e821 "mfd: s2mps11: Fix build after regmap field rename > in sec-core.c" is also touching this file, which is in Mark's tree > right now. If I rebase It's been in Linus' tree for a while now. signature.asc Description: Digital signature
Re: [PATCH RESEND 1/4] clk: clk-s2mps11: Refactor for including support for other MFD clocks
Quoting Mark Brown (2013-12-31 08:09:16) > On Mon, Dec 30, 2013 at 09:33:50AM +0530, Tushar Behera wrote: > > > Commit 1b1ccee1e821 "mfd: s2mps11: Fix build after regmap field rename > > in sec-core.c" is also touching this file, which is in Mark's tree > > right now. If I rebase > > It's been in Linus' tree for a while now. OK, so I merged the two patches into clk-next, then merged clk-next into next-20131224 and the merge is super trivial to resolve. So I propose that we just let it get resolved in linux-next the usual way. Any objections? If not I'll take these two patches into clk-next. Regards, Mike -- To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH RESEND 1/4] clk: clk-s2mps11: Refactor for including support for other MFD clocks
Hi, > > Quoting Mark Brown (2013-12-31 08:09:16) > > On Mon, Dec 30, 2013 at 09:33:50AM +0530, Tushar Behera wrote: > > > > > Commit 1b1ccee1e821 "mfd: s2mps11: Fix build after regmap field rename > > > in sec-core.c" is also touching this file, which is in Mark's tree > > > right now. If I rebase > > > > It's been in Linus' tree for a while now. > > OK, so I merged the two patches into clk-next, then merged clk-next into > next-20131224 and the merge is super trivial to resolve. So I propose > that we just let it get resolved in linux-next the usual way. > > Any objections? If not I'll take these two patches into clk-next. Did you merged these patches into clk-next? Unfortunately I couldn't find them (clk-next, next). I am asking because I want to send patches with support for S2MPS14 clock (based on these patches). Best regards, Krzysztof -- To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html