From patchwork Mon Aug 24 18:56:34 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vaibhav Hiremath X-Patchwork-Id: 7066121 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 990A49F344 for ; Mon, 24 Aug 2015 19:01:53 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BAC4520751 for ; Mon, 24 Aug 2015 19:01:52 +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 BB17120741 for ; Mon, 24 Aug 2015 19:01:51 +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 1ZTwyT-0002nV-FO; Mon, 24 Aug 2015 19:00:05 +0000 Received: from mail-pa0-f52.google.com ([209.85.220.52]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZTwy0-0001zv-Du for linux-arm-kernel@lists.infradead.org; Mon, 24 Aug 2015 18:59:37 +0000 Received: by pacti10 with SMTP id ti10so30125380pac.0 for ; Mon, 24 Aug 2015 11:59:15 -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=QNOBWBQ1vYwwWp8m7VX1WNboLjRSvaRoARwZdgZgKZA=; b=iCbtepbd1b9IpMXrokC+/iq+0UJeSPg+pZSoGdxCnowAChj2J/9C9OYYnXRV/rTLLh /azFL2dYDRred3RElPJ8MdOJu8k6hdiRY+e8osrMULCanHXr9DfNrC3eSZcvIB0Bfd2j Wpmo8qThGXOiVuMSTA06lw5O67GwAxjUXw4yFIrKA4m2QmToNPrKoZwwNWIL21//8u4e EnN3gZ2msqq+6MeWPgFL8+hAFZ5NPOMvAgzAIAhjLi8LFvmWJ24wwoZt2xWf+LWkAFtV IfA/DHmyofJxtVt1B640AS4r78jPLJVjOl0Kc3O/2VvtOQskJFqFhhDMYn5PYRendkWV nidA== X-Gm-Message-State: ALoCoQlxkCzqulnON/36b2H5o7NrBOy3umgA2vX+BXPSvWRDL3ICmuWSA8keeb/x7BIdy81DEBbt X-Received: by 10.68.194.170 with SMTP id hx10mr48643910pbc.64.1440442755619; Mon, 24 Aug 2015 11:59:15 -0700 (PDT) Received: from localhost.localdomain ([202.62.77.106]) by smtp.gmail.com with ESMTPSA id hh3sm18260418pbc.8.2015.08.24.11.59.11 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 24 Aug 2015 11:59:14 -0700 (PDT) From: Vaibhav Hiremath To: linux-arm-kernel@lists.infradead.org Subject: [PATCH-v2 5/5] mfd: 88pm800: Add support for clk subdevice Date: Tue, 25 Aug 2015 00:26:34 +0530 Message-Id: <1440442594-3102-7-git-send-email-vaibhav.hiremath@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1440442594-3102-1-git-send-email-vaibhav.hiremath@linaro.org> References: <1440442594-3102-1-git-send-email-vaibhav.hiremath@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150824_115936_527255_00AAA698 X-CRM114-Status: GOOD ( 14.70 ) 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.6 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 --- drivers/mfd/88pm800.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/drivers/mfd/88pm800.c b/drivers/mfd/88pm800.c index c4e097d..a928eed 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; @@ -511,6 +530,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);