From patchwork Tue Jul 21 11:07:03 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vaibhav Hiremath X-Patchwork-Id: 6834771 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 35A519F358 for ; Tue, 21 Jul 2015 11:19:39 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 68CBD2064E for ; Tue, 21 Jul 2015 11:19:38 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 460B72064B for ; Tue, 21 Jul 2015 11:19:37 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZHVYZ-00027A-AJ; Tue, 21 Jul 2015 11:17:55 +0000 Received: from mail-pa0-f53.google.com ([209.85.220.53]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZHVY2-0001gM-RX for linux-arm-kernel@lists.infradead.org; Tue, 21 Jul 2015 11:17:24 +0000 Received: by padck2 with SMTP id ck2so118368387pad.0 for ; Tue, 21 Jul 2015 04:17:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=ii43eqio5ZB4WlToLSn/LivBOoESU4KL4iFim2nMDZE=; b=SqLs1cgH8ZKnqb7O0dwitki0WYpZIaF9AMWbLxCAo5LFz7CWuSW6FRsJzttcpoNKSO R2dS5uZ817wfQ1Y1Yi3oPxpljmynrrgwCeKbbT6ekgPhKNIflvIPFHbZ+a3UvhUqUR/G 6HMZc5Xt/lAsiT3E8K4jL8M0W7HlncmtsDgx1LHO5LU+buBacYePRLnykthHWFSIqANY 5D0b6V2Zp7VzVnZ4Ix2Jq35GiInUnmXNlOSHyeIzW2glrszRoh5GQaSII50gk5cwW2eQ ipHt3QpFjgsc85aawQrxdQqfmWOox0ioWQJ+F2N06Y1OHtcFnGMgK13U4G7+EPFJjbf8 8spQ== X-Gm-Message-State: ALoCoQlyy/KbFiT8+BPMPCOrrhnUDYA5UMy8lUwHCFOdjqxZhA/JpXJmXTg6LAx4OiFEhFq7Pt93 X-Received: by 10.70.42.202 with SMTP id q10mr71024328pdl.41.1437477421772; Tue, 21 Jul 2015 04:17:01 -0700 (PDT) Received: from localhost.localdomain ([202.62.77.106]) by smtp.gmail.com with ESMTPSA id v9sm1900399pdr.96.2015.07.21.04.16.57 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 21 Jul 2015 04:17:00 -0700 (PDT) From: Vaibhav Hiremath To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 4/4] mfd: 88pm800: Add support for clk subdevice Date: Tue, 21 Jul 2015 16:37:03 +0530 Message-Id: <1437476823-3358-5-git-send-email-vaibhav.hiremath@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1437476823-3358-1-git-send-email-vaibhav.hiremath@linaro.org> References: <1437476823-3358-1-git-send-email-vaibhav.hiremath@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150721_041722_970401_E3C2CF83 X-CRM114-Status: GOOD ( 15.27 ) X-Spam-Score: -2.6 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, k.kozlowski@samsung.com, mturquette@baylibre.com, linux-kernel@vger.kernel.org, Vaibhav Hiremath , robh+dt@kernel.org, lee.jones@linaro.org, linux-clk@vger.kernel.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-5.4 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch adds mfd_cell/clk-subdevice for 88PM800 MFD (and family of devices). Signed-off-by: Vaibhav Hiremath Reviewed-by: Krzysztof Kozlowski --- drivers/mfd/88pm800.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/drivers/mfd/88pm800.c b/drivers/mfd/88pm800.c index f104a32..9723eac 100644 --- a/drivers/mfd/88pm800.c +++ b/drivers/mfd/88pm800.c @@ -173,6 +173,14 @@ static const struct mfd_cell regulator_devs[] = { }, }; +static struct mfd_cell clk_devs[] = { + { + .name = "88pm80x-clk", + .of_compatible = "marvell,88pm800-clk", + .id = -1, + }, +}; + static const struct regmap_irq pm800_irqs[] = { /* INT0 */ [PM800_IRQ_ONKEY] = { @@ -344,6 +352,17 @@ static int device_regulator_init(struct pm80x_chip *chip) ARRAY_SIZE(regulator_devs), NULL, 0, NULL); } +static int device_clk_init(struct pm80x_chip *chip) +{ + if (chip->type == CHIP_PM800) + clk_devs[0].name = "88pm800-clk"; + else if (chip->type == CHIP_PM860) + clk_devs[0].name = "88pm860-clk"; + + return mfd_add_devices(chip->dev, 0, &clk_devs[0], + ARRAY_SIZE(clk_devs), NULL, 0, NULL); +} + static int device_irq_init_800(struct pm80x_chip *chip) { struct regmap *map = chip->regmap; @@ -513,6 +532,12 @@ static int device_800_init(struct pm80x_chip *chip) goto out; } + ret = device_clk_init(chip); + if (ret) { + dev_err(chip->dev, "Failed to add clk subdev\n"); + goto out; + } + return 0; out_dev: mfd_remove_devices(chip->dev);