From mboxrd@z Thu Jan 1 00:00:00 1970 From: Krzysztof Kozlowski Subject: Re: [PATCH v1 2/9] mfd: wm8994: Add support for MCLKn clock control Date: Thu, 19 Sep 2019 09:59:24 +0200 Message-ID: <20190919075924.GB13195@pi3> References: <20190918104634.15216-1-s.nawrocki@samsung.com> <20190918104634.15216-3-s.nawrocki@samsung.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <20190918104634.15216-3-s.nawrocki@samsung.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=m.gmane.org@lists.infradead.org To: Sylwester Nawrocki Cc: devicetree@vger.kernel.org, alsa-devel@alsa-project.org, linux-samsung-soc@vger.kernel.org, ckeepax@opensource.cirrus.com, b.zolnierkie@samsung.com, sbkim73@samsung.com, patches@opensource.cirrus.com, lgirdwood@gmail.com, robh+dt@kernel.org, broonie@kernel.org, linux-arm-kernel@lists.infradead.org, m.szyprowski@samsung.com List-Id: devicetree@vger.kernel.org On Wed, Sep 18, 2019 at 12:46:27PM +0200, Sylwester Nawrocki wrote: > The WM1811/WM8994/WM8958 audio CODEC DT bindings specify two optional > clocks: "MCLK1", "MCLK2". Add code for getting those clocks in the MFD > part of the wm8994 driver so they can be further handled in the audio > CODEC part. I think these are needed only for the codec so how about getting them in codec's probe? Best regards, Krzysztof > > Signed-off-by: Sylwester Nawrocki > --- > drivers/mfd/wm8994-core.c | 9 +++++++++ > include/linux/mfd/wm8994/core.h | 9 +++++++++ > 2 files changed, 18 insertions(+) > > diff --git a/drivers/mfd/wm8994-core.c b/drivers/mfd/wm8994-core.c > index 1e9fe7d92597..02c19a0bdeb0 100644 > --- a/drivers/mfd/wm8994-core.c > +++ b/drivers/mfd/wm8994-core.c > @@ -7,6 +7,7 @@ > * Author: Mark Brown > */ > > +#include > #include > #include > #include > @@ -333,6 +334,14 @@ static int wm8994_device_init(struct wm8994 *wm8994, int irq) > > dev_set_drvdata(wm8994->dev, wm8994); > > + wm8994->mclk[WM8994_MCLK1].id = "MCLK1"; > + wm8994->mclk[WM8994_MCLK2].id = "MCLK2"; > + > + ret = devm_clk_bulk_get_optional(wm8994->dev, ARRAY_SIZE(wm8994->mclk), > + wm8994->mclk); > + if (ret != 0) > + return ret; > + > /* Add the on-chip regulators first for bootstrapping */ > ret = mfd_add_devices(wm8994->dev, 0, > wm8994_regulator_devs, > diff --git a/include/linux/mfd/wm8994/core.h b/include/linux/mfd/wm8994/core.h > index e8b093522ffd..320297a1b70c 100644 > --- a/include/linux/mfd/wm8994/core.h > +++ b/include/linux/mfd/wm8994/core.h > @@ -10,12 +10,19 @@ > #ifndef __MFD_WM8994_CORE_H__ > #define __MFD_WM8994_CORE_H__ > > +#include > #include > #include > #include > > #include > > +enum { > + WM8994_MCLK1, > + WM8994_MCLK2, > + WM8994_NUM_MCLK > +}; > + > enum wm8994_type { > WM8994 = 0, > WM8958 = 1, > @@ -60,6 +67,8 @@ struct wm8994 { > struct device *dev; > struct regmap *regmap; > > + struct clk_bulk_data mclk[WM8994_NUM_MCLK]; > + > bool ldo_ena_always_driven; > > int gpio_base; > -- > 2.17.1 >