From patchwork Wed Sep 18 10:46:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Sylwester Nawrocki/Kernel \\(PLT\\) /SRPOL/Staff Engineer/Samsung Electronics" X-Patchwork-Id: 11150091 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BBD51195A for ; Wed, 18 Sep 2019 10:46:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9208021927 for ; Wed, 18 Sep 2019 10:46:59 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="WJTS+/ep" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727208AbfIRKq7 (ORCPT ); Wed, 18 Sep 2019 06:46:59 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:56395 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727030AbfIRKq7 (ORCPT ); Wed, 18 Sep 2019 06:46:59 -0400 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20190918104657euoutp01c27aa112947b7fa36a47c8e5d0a46e20~FgpQkO0pk1222412224euoutp01q for ; Wed, 18 Sep 2019 10:46:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20190918104657euoutp01c27aa112947b7fa36a47c8e5d0a46e20~FgpQkO0pk1222412224euoutp01q DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1568803618; bh=Fg34vQ6u3eTKQ0Qf8Q7c1nFh3IddQHSKx58BNil8ldQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WJTS+/epT52kLp7u/BlOfIXcntR8+gNImaNYNohCbkwhoPFnWE3xaCuu/Bzo3RU3h pl+ujPwRj0YliFeUKpQUSfV82EEBifo/Ig5nHY7wAvbirS3bJVcbwADddkAFnwQJyU 4VoGY1qxHltCCLrRkmnSaVEmS+vlUSdpWMBZXdXY= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20190918104657eucas1p12201d567faa2f2d7dc6023200a5ca002~FgpPuudRf2818828188eucas1p1L; Wed, 18 Sep 2019 10:46:57 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id CB.D3.04374.02B028D5; Wed, 18 Sep 2019 11:46:56 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20190918104656eucas1p1d9cad1394b08d05a99151c4fbc9425ce~FgpO8LDOy2746227462eucas1p1K; Wed, 18 Sep 2019 10:46:56 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20190918104655eusmtrp270282fc5ffb1f42b02db696e62190d14~FgpOnUrk41555615556eusmtrp2H; Wed, 18 Sep 2019 10:46:55 +0000 (GMT) X-AuditID: cbfec7f5-4f7ff70000001116-3e-5d820b20f0a1 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 58.B6.04166.F1B028D5; Wed, 18 Sep 2019 11:46:55 +0100 (BST) Received: from AMDC3061.DIGITAL.local (unknown [106.120.51.75]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20190918104655eusmtip168de677be306b2ee05b27ddf12af27aa~FgpN8RAdV0585005850eusmtip1F; Wed, 18 Sep 2019 10:46:55 +0000 (GMT) From: Sylwester Nawrocki To: broonie@kernel.org Cc: lgirdwood@gmail.com, ckeepax@opensource.cirrus.com, krzk@kernel.org, sbkim73@samsung.com, alsa-devel@alsa-project.org, robh+dt@kernel.org, devicetree@vger.kernel.org, patches@opensource.cirrus.com, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, b.zolnierkie@samsung.com, m.szyprowski@samsung.com, Sylwester Nawrocki Subject: [PATCH v1 2/9] mfd: wm8994: Add support for MCLKn clock control Date: Wed, 18 Sep 2019 12:46:27 +0200 Message-Id: <20190918104634.15216-3-s.nawrocki@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190918104634.15216-1-s.nawrocki@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA0VSeUgUcRj1N7OzM5pr4yr6qZWxdFCWB0WNKGIUNUWlgRRkS606qair7HgW oXjkfRCFiwoqFtqKuK5ieeaVi0XqqoggmqESVhq0GuWRuY7Wf++9773f+/j4UbhUQzhS4cpY TqVURMrEFqLm/t+DJw/uSZW7j+pcmTFDD8Y0qOsJ5tmnOTEzlqFDTHnfIMEMDWlJ5udYFsbo ZscJRj3UiTF1fVMkY/z+hmAyOvpIpvdbJsEYapYxXytWa0wVsy0lUySr02SL2cbnyWxx2SZi C5o0iDXqDviTty28Q7jI8HhO5eZzzyKsuyoNj8miEwuyirEUVCnJQeYU0KdBq1/Ec5AFJaVr EKRMZ4oFsoxgIHN5hxgR5LbmkbuR+e4JJAyqESysDWP/Iur+xW2XmPaA/LcFyIRtaTuYLMve LsHpdQwWN0pEpoENzcJCae92QEQfhubGF9tYQntB1VKlWKhzhlptF27C5rQ3/BieEZkeArqZ hMKO6Z2dLsBS6a+dgA180Tft6Ptgs6UcEwJpCPLaJkmBFCH4qK9AgssLevUGIgdRW/sdg/pW N0E+B+8KJjCTDLQVTCxam2R8Cz5pLsYFWQJZj6WC+xCsaYoxATtC7tymSMAs6L5qSeFChQhG 6rKxIuRc8r+sAiENsufi+KhQjj+l5BJceUUUH6cMdQ2OjtKhrR/0/o9+5TXqXA/qQTSFZJYS +JAilxKKeD4pqgcBh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276 T1GMTI7O4+970WB+cJv6mjMzvu1bfFH19sNLV/Q94vdfU5eyi1Ns/ntz9YTk831OfK9XzD4R rsRSnJFoqMVcVJwIACl+nLCcAgAA X-CMS-MailID: 20190918104656eucas1p1d9cad1394b08d05a99151c4fbc9425ce X-Msg-Generator: CA X-RootMTR: 20190918104656eucas1p1d9cad1394b08d05a99151c4fbc9425ce X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20190918104656eucas1p1d9cad1394b08d05a99151c4fbc9425ce References: <20190918104634.15216-1-s.nawrocki@samsung.com> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org 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. Signed-off-by: Sylwester Nawrocki Acked-by: Charles Keepax --- 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;