Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1402990 > unrolled thread
| Started by | Peter Ujfalusi <peter.ujfalusi@ti.com> |
|---|---|
| First post | 2016-05-18 15:50 +0200 |
| Last post | 2016-05-18 16:00 +0200 |
| Articles | 10 — 1 participant |
Back to article view | Back to linux.kernel
[PATCH 00/14] clk/mfd/ASoC/ARM: OMAP4/5: McPDM/twl6040 pdmclk support Peter Ujfalusi <peter.ujfalusi@ti.com> - 2016-05-18 15:50 +0200
[PATCH 07/14] ARM: dts: omap4-panda-common: Add pdmclk binding for audio Peter Ujfalusi <peter.ujfalusi@ti.com> - 2016-05-18 15:50 +0200
[PATCH 12/14] ASoC: omap-mcpdm: Move the WD enable write inside omap_mcpdm_open_streams() Peter Ujfalusi <peter.ujfalusi@ti.com> - 2016-05-18 15:50 +0200
[PATCH 13/14] ASoC: omap-mcpdm: Support for suspend resume Peter Ujfalusi <peter.ujfalusi@ti.com> - 2016-05-18 15:50 +0200
[PATCH 01/14] clk: twl6040: Correct clk_ops Peter Ujfalusi <peter.ujfalusi@ti.com> - 2016-05-18 15:50 +0200
[PATCH 06/14] ARM: dts: omap5-board-common: Add pdmclk binding for audio Peter Ujfalusi <peter.ujfalusi@ti.com> - 2016-05-18 15:50 +0200
[PATCH 09/14] ARM: dts: omap4-var-som-om44: Add pdmclk binding for audio Peter Ujfalusi <peter.ujfalusi@ti.com> - 2016-05-18 16:00 +0200
[PATCH 02/14] clk: twl6040: Register the clock as of_clk_provider Peter Ujfalusi <peter.ujfalusi@ti.com> - 2016-05-18 16:00 +0200
[PATCH 04/14] mfd: twl6040: The chip does not support bulk access Peter Ujfalusi <peter.ujfalusi@ti.com> - 2016-05-18 16:00 +0200
[PATCH 03/14] clk: twl6040: Rename the driver and use consistent names in the code Peter Ujfalusi <peter.ujfalusi@ti.com> - 2016-05-18 16:00 +0200
| From | Peter Ujfalusi <peter.ujfalusi@ti.com> |
|---|---|
| Date | 2016-05-18 15:50 +0200 |
| Subject | [PATCH 00/14] clk/mfd/ASoC/ARM: OMAP4/5: McPDM/twl6040 pdmclk support |
| Message-ID | <rAa1j-2O5-5@gated-at.bofh.it> |
Hi,
this is something I wanted to do for a long time...
First of all: sorry for the cross domain series. I did tested alone all the
domain patches and they are not causing any regression. When they come together
we will have ability to control the pdmclk needed by McPDM.
CLK patches:
The driver was w/o DT support and needed some cleanup so we can use the driver.
I have also renamed it to twl6040-pdmclk from twl6040-clk to be precise.
MFD patches:
The regmap_sync() was not working since the twl6040 does not support bulk access
and now we are going to create the needed child for the pdmclk.
ARM patches:
Updatding the board DTS files and add the needed lines for the pdmclk.
ASoC patches:
The machine driver needs to select the twl6040-clk driver as it will be used
by the omap-mcpdm.
I needed to do some cleanup and add also suspend/resume support before adding
the code for pdmclk handling since I don't want to keep the twl6040 powered on
when the board is suspended. At the moment it is not possible to do true
dynamic twl6040 power up/down due to pop noises, but I will be looking at that
later.
The driver in the future will fail if it is not able to get the pdmclk to avoid
kernel crash (McPDM registers are not accessible when pdmclk is not available).
I have tested the patches by domain and also in all (I hope) permutation they
could be. I have not experienced any regression.
Regards,
Peter
---
Peter Ujfalusi (14):
clk: twl6040: Correct clk_ops
clk: twl6040: Register the clock as of_clk_provider
clk: twl6040: Rename the driver and use consistent names in the code
mfd: twl6040: The chip does not support bulk access
mfd: twl6040: Register child device for twl6040-pdmclk
ARM: dts: omap5-board-common: Add pdmclk binding for audio
ARM: dts: omap4-panda-common: Add pdmclk binding for audio
ARM: dts: omap4-sdp: Add pdmclk binding for audio
ARM: dts: omap4-var-som-om44: Add pdmclk binding for audio
ARM: dts: omap4-duovero: Add pdmclk binding for audio
ASoC: omap: Kconfig: SND_OMAP_SOC_OMAP_ABE_TWL6040 to select
CLK_TWL6040
ASoC: omap-mcpdm: Move the WD enable write inside
omap_mcpdm_open_streams()
ASoC: omap-mcpdm: Support for suspend resume
ASoC: omap-mcpdm: Add support for pdmclk clock handling
Documentation/devicetree/bindings/mfd/twl6040.txt | 1 +
.../devicetree/bindings/sound/omap-mcpdm.txt | 10 +++
arch/arm/boot/dts/omap4-duovero.dtsi | 5 ++
arch/arm/boot/dts/omap4-panda-common.dtsi | 5 ++
arch/arm/boot/dts/omap4-sdp.dts | 5 ++
arch/arm/boot/dts/omap4-var-som-om44.dtsi | 5 ++
arch/arm/boot/dts/omap5-board-common.dtsi | 5 ++
drivers/clk/clk-twl6040.c | 80 +++++++++++++---------
drivers/mfd/twl6040.c | 6 ++
include/linux/mfd/twl6040.h | 2 +-
sound/soc/omap/Kconfig | 1 +
sound/soc/omap/omap-mcpdm.c | 74 ++++++++++++++++++--
12 files changed, 160 insertions(+), 39 deletions(-)
--
2.8.2
[toc] | [next] | [standalone]
| From | Peter Ujfalusi <peter.ujfalusi@ti.com> |
|---|---|
| Date | 2016-05-18 15:50 +0200 |
| Subject | [PATCH 07/14] ARM: dts: omap4-panda-common: Add pdmclk binding for audio |
| Message-ID | <rAa1k-2O5-21@gated-at.bofh.it> |
| In reply to | #1402990 |
The twl6040 codec is generating the pdmclk, which is used by the McPDM as
functional clock.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
---
arch/arm/boot/dts/omap4-panda-common.dtsi | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/arch/arm/boot/dts/omap4-panda-common.dtsi b/arch/arm/boot/dts/omap4-panda-common.dtsi
index df2e356ec089..e1d606f64cb7 100644
--- a/arch/arm/boot/dts/omap4-panda-common.dtsi
+++ b/arch/arm/boot/dts/omap4-panda-common.dtsi
@@ -376,6 +376,7 @@
twl6040: twl@4b {
compatible = "ti,twl6040";
+ #clock-cells = <0>;
reg = <0x4b>;
pinctrl-names = "default";
@@ -479,6 +480,10 @@
&mcpdm {
pinctrl-names = "default";
pinctrl-0 = <&mcpdm_pins>;
+
+ clocks = <&twl6040>;
+ clock-names = "pdmclk";
+
status = "okay";
};
--
2.8.2
[toc] | [prev] | [next] | [standalone]
| From | Peter Ujfalusi <peter.ujfalusi@ti.com> |
|---|---|
| Date | 2016-05-18 15:50 +0200 |
| Subject | [PATCH 12/14] ASoC: omap-mcpdm: Move the WD enable write inside omap_mcpdm_open_streams() |
| Message-ID | <rAa1l-2O5-45@gated-at.bofh.it> |
| In reply to | #1402990 |
The DS4_WD_EN bit is only touched before calling omap_mcpdm_open_streams().
Move it inside of that function for simplicity.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
---
sound/soc/omap/omap-mcpdm.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/sound/soc/omap/omap-mcpdm.c b/sound/soc/omap/omap-mcpdm.c
index b837265ac3e9..11bd07cdce22 100644
--- a/sound/soc/omap/omap-mcpdm.c
+++ b/sound/soc/omap/omap-mcpdm.c
@@ -173,6 +173,10 @@ static inline int omap_mcpdm_active(struct omap_mcpdm *mcpdm)
*/
static void omap_mcpdm_open_streams(struct omap_mcpdm *mcpdm)
{
+ u32 ctrl = omap_mcpdm_read(mcpdm, MCPDM_REG_CTRL);
+
+ omap_mcpdm_write(mcpdm, MCPDM_REG_CTRL, ctrl | MCPDM_WD_EN);
+
omap_mcpdm_write(mcpdm, MCPDM_REG_IRQENABLE_SET,
MCPDM_DN_IRQ_EMPTY | MCPDM_DN_IRQ_FULL |
MCPDM_UP_IRQ_EMPTY | MCPDM_UP_IRQ_FULL);
@@ -258,12 +262,9 @@ static int omap_mcpdm_dai_startup(struct snd_pcm_substream *substream,
mutex_lock(&mcpdm->mutex);
- if (!dai->active) {
- u32 ctrl = omap_mcpdm_read(mcpdm, MCPDM_REG_CTRL);
-
- omap_mcpdm_write(mcpdm, MCPDM_REG_CTRL, ctrl | MCPDM_WD_EN);
+ if (!dai->active)
omap_mcpdm_open_streams(mcpdm);
- }
+
mutex_unlock(&mcpdm->mutex);
return 0;
--
2.8.2
[toc] | [prev] | [next] | [standalone]
| From | Peter Ujfalusi <peter.ujfalusi@ti.com> |
|---|---|
| Date | 2016-05-18 15:50 +0200 |
| Subject | [PATCH 13/14] ASoC: omap-mcpdm: Support for suspend resume |
| Message-ID | <rAa1l-2O5-39@gated-at.bofh.it> |
| In reply to | #1402990 |
Implement ASoC's suspend and resume callbacks.
Since McPDM does not use pcm_trigger for start and stop of the stream due
to strict sequencing needs with the twl6040, the callbacks will stop and
restart the McPDM in case the board suspended during audio activity.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
---
sound/soc/omap/omap-mcpdm.c | 46 +++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 46 insertions(+)
diff --git a/sound/soc/omap/omap-mcpdm.c b/sound/soc/omap/omap-mcpdm.c
index 11bd07cdce22..74d6e6fdcfd0 100644
--- a/sound/soc/omap/omap-mcpdm.c
+++ b/sound/soc/omap/omap-mcpdm.c
@@ -66,6 +66,9 @@ struct omap_mcpdm {
/* McPDM needs to be restarted due to runtime reconfiguration */
bool restart;
+ /* pm state for suspend/resume handling */
+ int pm_active_count;
+
struct snd_dmaengine_dai_dma_data dma_data[2];
};
@@ -422,12 +425,55 @@ static int omap_mcpdm_remove(struct snd_soc_dai *dai)
return 0;
}
+#ifdef CONFIG_PM_SLEEP
+static int omap_mcpdm_suspend(struct snd_soc_dai *dai)
+{
+ struct omap_mcpdm *mcpdm = snd_soc_dai_get_drvdata(dai);
+
+ if (dai->active) {
+ omap_mcpdm_stop(mcpdm);
+ omap_mcpdm_close_streams(mcpdm);
+ }
+
+ mcpdm->pm_active_count = 0;
+ while (pm_runtime_active(mcpdm->dev)) {
+ pm_runtime_put_sync(mcpdm->dev);
+ mcpdm->pm_active_count++;
+ }
+
+ return 0;
+}
+
+static int omap_mcpdm_resume(struct snd_soc_dai *dai)
+{
+ struct omap_mcpdm *mcpdm = snd_soc_dai_get_drvdata(dai);
+
+ if (mcpdm->pm_active_count) {
+ while (mcpdm->pm_active_count--)
+ pm_runtime_get_sync(mcpdm->dev);
+
+ if (dai->active) {
+ omap_mcpdm_open_streams(mcpdm);
+ omap_mcpdm_start(mcpdm);
+ }
+ }
+
+
+ return 0;
+}
+#else
+#define omap_mcpdm_suspend NULL
+#define omap_mcpdm_resume NULL
+#endif
+
#define OMAP_MCPDM_RATES (SNDRV_PCM_RATE_88200 | SNDRV_PCM_RATE_96000)
#define OMAP_MCPDM_FORMATS SNDRV_PCM_FMTBIT_S32_LE
static struct snd_soc_dai_driver omap_mcpdm_dai = {
.probe = omap_mcpdm_probe,
.remove = omap_mcpdm_remove,
+ .suspend = omap_mcpdm_suspend,
+ .resume = omap_mcpdm_resume,
.probe_order = SND_SOC_COMP_ORDER_LATE,
.remove_order = SND_SOC_COMP_ORDER_EARLY,
.playback = {
--
2.8.2
[toc] | [prev] | [next] | [standalone]
| From | Peter Ujfalusi <peter.ujfalusi@ti.com> |
|---|---|
| Date | 2016-05-18 15:50 +0200 |
| Subject | [PATCH 01/14] clk: twl6040: Correct clk_ops |
| Message-ID | <rAa1l-2O5-49@gated-at.bofh.it> |
| In reply to | #1402990 |
Since the drover only supports prepare callbacks, the use of is_enabled is
not correct, it should be handling is_prepared.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
---
drivers/clk/clk-twl6040.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/clk/clk-twl6040.c b/drivers/clk/clk-twl6040.c
index 697c66757400..e167e0bbaff5 100644
--- a/drivers/clk/clk-twl6040.c
+++ b/drivers/clk/clk-twl6040.c
@@ -34,7 +34,7 @@ struct twl6040_clk {
int enabled;
};
-static int twl6040_bitclk_is_enabled(struct clk_hw *hw)
+static int twl6040_bitclk_is_prepared(struct clk_hw *hw)
{
struct twl6040_clk *twl6040_clk = container_of(hw, struct twl6040_clk,
mcpdm_fclk);
@@ -66,7 +66,7 @@ static void twl6040_bitclk_unprepare(struct clk_hw *hw)
}
static const struct clk_ops twl6040_mcpdm_ops = {
- .is_enabled = twl6040_bitclk_is_enabled,
+ .is_prepared = twl6040_bitclk_is_prepared,
.prepare = twl6040_bitclk_prepare,
.unprepare = twl6040_bitclk_unprepare,
};
--
2.8.2
[toc] | [prev] | [next] | [standalone]
| From | Peter Ujfalusi <peter.ujfalusi@ti.com> |
|---|---|
| Date | 2016-05-18 15:50 +0200 |
| Subject | [PATCH 06/14] ARM: dts: omap5-board-common: Add pdmclk binding for audio |
| Message-ID | <rAa1l-2O5-37@gated-at.bofh.it> |
| In reply to | #1402990 |
The twl6040 codec is generating the pdmclk, which is used by the McPDM as
functional clock.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
---
arch/arm/boot/dts/omap5-board-common.dtsi | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/arch/arm/boot/dts/omap5-board-common.dtsi b/arch/arm/boot/dts/omap5-board-common.dtsi
index 19efaa079797..63d0352d068d 100644
--- a/arch/arm/boot/dts/omap5-board-common.dtsi
+++ b/arch/arm/boot/dts/omap5-board-common.dtsi
@@ -637,6 +637,7 @@
twl6040: twl@4b {
compatible = "ti,twl6040";
+ #clock-cells = <0>;
reg = <0x4b>;
pinctrl-names = "default";
@@ -658,6 +659,10 @@
&mcpdm {
pinctrl-names = "default";
pinctrl-0 = <&mcpdm_pins>;
+
+ clocks = <&twl6040>;
+ clock-names = "pdmclk";
+
status = "okay";
};
--
2.8.2
[toc] | [prev] | [next] | [standalone]
| From | Peter Ujfalusi <peter.ujfalusi@ti.com> |
|---|---|
| Date | 2016-05-18 16:00 +0200 |
| Subject | [PATCH 09/14] ARM: dts: omap4-var-som-om44: Add pdmclk binding for audio |
| Message-ID | <rAaaZ-2Rm-7@gated-at.bofh.it> |
| In reply to | #1402990 |
The twl6040 codec is generating the pdmclk, which is used by the McPDM as
functional clock.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
---
arch/arm/boot/dts/omap4-var-som-om44.dtsi | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/arch/arm/boot/dts/omap4-var-som-om44.dtsi b/arch/arm/boot/dts/omap4-var-som-om44.dtsi
index a17997f4e9aa..873cfc87260c 100644
--- a/arch/arm/boot/dts/omap4-var-som-om44.dtsi
+++ b/arch/arm/boot/dts/omap4-var-som-om44.dtsi
@@ -189,6 +189,7 @@
twl6040: twl@4b {
compatible = "ti,twl6040";
+ #clock-cells = <0>;
reg = <0x4b>;
pinctrl-names = "default";
@@ -252,6 +253,10 @@
&mcpdm {
pinctrl-names = "default";
pinctrl-0 = <&mcpdm_pins>;
+
+ clocks = <&twl6040>;
+ clock-names = "pdmclk";
+
status = "okay";
};
--
2.8.2
[toc] | [prev] | [next] | [standalone]
| From | Peter Ujfalusi <peter.ujfalusi@ti.com> |
|---|---|
| Date | 2016-05-18 16:00 +0200 |
| Subject | [PATCH 02/14] clk: twl6040: Register the clock as of_clk_provider |
| Message-ID | <rAab0-2Rm-19@gated-at.bofh.it> |
| In reply to | #1402990 |
In order ot be able to use the pdmclk clock via DT it need to be registered
as of_clk_provide.
Since the twl6040 clock driver does not have it's own DT node, use the
parent's node for registering.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
---
drivers/clk/clk-twl6040.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/clk/clk-twl6040.c b/drivers/clk/clk-twl6040.c
index e167e0bbaff5..6a2dbe6a1627 100644
--- a/drivers/clk/clk-twl6040.c
+++ b/drivers/clk/clk-twl6040.c
@@ -95,7 +95,8 @@ static int twl6040_clk_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, clkdata);
- return 0;
+ return of_clk_add_provider(pdev->dev.parent->of_node,
+ of_clk_src_simple_get, clkdata->clk);
}
static struct platform_driver twl6040_clk_driver = {
--
2.8.2
[toc] | [prev] | [next] | [standalone]
| From | Peter Ujfalusi <peter.ujfalusi@ti.com> |
|---|---|
| Date | 2016-05-18 16:00 +0200 |
| Subject | [PATCH 04/14] mfd: twl6040: The chip does not support bulk access |
| Message-ID | <rAab0-2Rm-27@gated-at.bofh.it> |
| In reply to | #1402990 |
Bulk access is not working with twl6040, we need to use single register
access. Bulk access would happen when we try to sync the regcache after
power on.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
---
drivers/mfd/twl6040.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/mfd/twl6040.c b/drivers/mfd/twl6040.c
index f3dcf3a85e84..2596546553aa 100644
--- a/drivers/mfd/twl6040.c
+++ b/drivers/mfd/twl6040.c
@@ -608,6 +608,7 @@ static const struct regmap_config twl6040_regmap_config = {
.writeable_reg = twl6040_writeable_reg,
.cache_type = REGCACHE_RBTREE,
+ .use_single_rw = true,
};
static const struct regmap_irq twl6040_irqs[] = {
--
2.8.2
[toc] | [prev] | [next] | [standalone]
| From | Peter Ujfalusi <peter.ujfalusi@ti.com> |
|---|---|
| Date | 2016-05-18 16:00 +0200 |
| Subject | [PATCH 03/14] clk: twl6040: Rename the driver and use consistent names in the code |
| Message-ID | <rAab0-2Rm-31@gated-at.bofh.it> |
| In reply to | #1402990 |
The driver is to provide the functional clock to OMAP4/5 McPDM. The clock
is named as pdmclk in the documentations so change the function names,
structure names and variables to align with this.
At the same time rename the driver from "twl6040-clk" to "twl6040-pdmclk".
This can be done w/o regression since the clock driver is not in use at
the moment, the MFD core driver is not even registering the device for it.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
---
drivers/clk/clk-twl6040.c | 77 +++++++++++++++++++++++++++--------------------
1 file changed, 45 insertions(+), 32 deletions(-)
diff --git a/drivers/clk/clk-twl6040.c b/drivers/clk/clk-twl6040.c
index 6a2dbe6a1627..c98b1ec76f54 100644
--- a/drivers/clk/clk-twl6040.c
+++ b/drivers/clk/clk-twl6040.c
@@ -26,60 +26,73 @@
#include <linux/mfd/twl6040.h>
#include <linux/clk-provider.h>
-struct twl6040_clk {
+struct twl6040_pdmclk {
struct twl6040 *twl6040;
struct device *dev;
- struct clk_hw mcpdm_fclk;
+ struct clk_hw pdmclk_hw;
struct clk *clk;
int enabled;
};
-static int twl6040_bitclk_is_prepared(struct clk_hw *hw)
+static int twl6040_pdmclk_is_prepared(struct clk_hw *hw)
{
- struct twl6040_clk *twl6040_clk = container_of(hw, struct twl6040_clk,
- mcpdm_fclk);
- return twl6040_clk->enabled;
+ struct twl6040_pdmclk *pdmclk = container_of(hw, struct twl6040_pdmclk,
+ pdmclk_hw);
+
+ return pdmclk->enabled;
}
-static int twl6040_bitclk_prepare(struct clk_hw *hw)
+static int twl6040_pdmclk_prepare(struct clk_hw *hw)
{
- struct twl6040_clk *twl6040_clk = container_of(hw, struct twl6040_clk,
- mcpdm_fclk);
+ struct twl6040_pdmclk *pdmclk = container_of(hw, struct twl6040_pdmclk,
+ pdmclk_hw);
int ret;
- ret = twl6040_power(twl6040_clk->twl6040, 1);
+ ret = twl6040_power(pdmclk->twl6040, 1);
if (!ret)
- twl6040_clk->enabled = 1;
+ pdmclk->enabled = 1;
return ret;
}
-static void twl6040_bitclk_unprepare(struct clk_hw *hw)
+static void twl6040_pdmclk_unprepare(struct clk_hw *hw)
{
- struct twl6040_clk *twl6040_clk = container_of(hw, struct twl6040_clk,
- mcpdm_fclk);
+ struct twl6040_pdmclk *pdmclk = container_of(hw, struct twl6040_pdmclk,
+ pdmclk_hw);
int ret;
- ret = twl6040_power(twl6040_clk->twl6040, 0);
+ ret = twl6040_power(pdmclk->twl6040, 0);
if (!ret)
- twl6040_clk->enabled = 0;
+ pdmclk->enabled = 0;
+
+}
+
+static unsigned long twl6040_pdmclk_recalc_rate(struct clk_hw *hw,
+ unsigned long parent_rate)
+{
+ struct twl6040_pdmclk *pdmclk = container_of(hw, struct twl6040_pdmclk,
+ pdmclk_hw);
+
+ return twl6040_get_sysclk(pdmclk->twl6040);
}
-static const struct clk_ops twl6040_mcpdm_ops = {
- .is_prepared = twl6040_bitclk_is_prepared,
- .prepare = twl6040_bitclk_prepare,
- .unprepare = twl6040_bitclk_unprepare,
+static const struct clk_ops twl6040_pdmclk_ops = {
+ .is_prepared = twl6040_pdmclk_is_prepared,
+ .prepare = twl6040_pdmclk_prepare,
+ .unprepare = twl6040_pdmclk_unprepare,
+ .recalc_rate = twl6040_pdmclk_recalc_rate,
};
-static struct clk_init_data wm831x_clkout_init = {
- .name = "mcpdm_fclk",
- .ops = &twl6040_mcpdm_ops,
+static struct clk_init_data twl6040_pdmclk_init = {
+ .name = "pdmclk",
+ .ops = &twl6040_pdmclk_ops,
+ .flags = CLK_GET_RATE_NOCACHE,
};
-static int twl6040_clk_probe(struct platform_device *pdev)
+static int twl6040_pdmclk_probe(struct platform_device *pdev)
{
struct twl6040 *twl6040 = dev_get_drvdata(pdev->dev.parent);
- struct twl6040_clk *clkdata;
+ struct twl6040_pdmclk *clkdata;
clkdata = devm_kzalloc(&pdev->dev, sizeof(*clkdata), GFP_KERNEL);
if (!clkdata)
@@ -88,8 +101,8 @@ static int twl6040_clk_probe(struct platform_device *pdev)
clkdata->dev = &pdev->dev;
clkdata->twl6040 = twl6040;
- clkdata->mcpdm_fclk.init = &wm831x_clkout_init;
- clkdata->clk = devm_clk_register(&pdev->dev, &clkdata->mcpdm_fclk);
+ clkdata->pdmclk_hw.init = &twl6040_pdmclk_init;
+ clkdata->clk = devm_clk_register(&pdev->dev, &clkdata->pdmclk_hw);
if (IS_ERR(clkdata->clk))
return PTR_ERR(clkdata->clk);
@@ -99,16 +112,16 @@ static int twl6040_clk_probe(struct platform_device *pdev)
of_clk_src_simple_get, clkdata->clk);
}
-static struct platform_driver twl6040_clk_driver = {
+static struct platform_driver twl6040_pdmclk_driver = {
.driver = {
- .name = "twl6040-clk",
+ .name = "twl6040-pdmclk",
},
- .probe = twl6040_clk_probe,
+ .probe = twl6040_pdmclk_probe,
};
-module_platform_driver(twl6040_clk_driver);
+module_platform_driver(twl6040_pdmclk_driver);
MODULE_DESCRIPTION("TWL6040 clock driver for McPDM functional clock");
MODULE_AUTHOR("Peter Ujfalusi <peter.ujfalusi@ti.com>");
-MODULE_ALIAS("platform:twl6040-clk");
+MODULE_ALIAS("platform:twl6040-pdmclk");
MODULE_LICENSE("GPL");
--
2.8.2
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web