From patchwork Tue Nov 22 09:58:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Niedermaier X-Patchwork-Id: 13052142 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 63C66C433FE for ; Tue, 22 Nov 2022 10:16:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ffnJNgACFFs3m1ge46B5yaZOcH912uD/SfWYtLBWS/E=; b=ad0ec05bB7pEK2 dowiioCGEQSp7n6CoTEkurghIzy6bPOjpPdkud3J4gTzCcwgLr15RoUrWdfghEOXmJHJcvi72rjYY qxZfuwnO5LjqBlJjJoputSbu8uX6UV7ReVsZ+Y0eBGUDyC4Ips80liNAObx2Br1+tXvuyqqreKQzb tfpShCeDXFN9kb5aw/eL3Lp4ftIkNdEbMi3d0SBS2PDf1hH4MtK36P5Pi4pnq+18Q8WPtD4k4vTgF WExkc+VahQ89oIpYWcwUWtWvmpCnmvG2s6puPQEw5MIpCD/f2tmESe2eBgtFVbgifVpLB6p8a6dI4 3kHcgsgN9ytUf9BMnP+A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oxQJg-007iUD-MP; Tue, 22 Nov 2022 10:15:48 +0000 Received: from mx4.securetransport.de ([178.254.6.145]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oxQJc-007iS4-UJ for linux-arm-kernel@lists.infradead.org; Tue, 22 Nov 2022 10:15:46 +0000 Received: from mail.dh-electronics.com (unknown [77.24.89.57]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx4.securetransport.de (Postfix) with ESMTPSA id C93E4720109; Tue, 22 Nov 2022 11:15:11 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dh-electronics.com; s=dhelectronicscom; t=1669112112; bh=bJlCMJDxfB/y8X7vNgoJnu3057bmwnMcIpLwhBIIIOg=; h=From:To:CC:Subject:Date:In-Reply-To:References:From; b=IXxIZcB6brGuwBHS33xl3jo45VTzP2Ecx2wviIkjGQ8Higc+vj4dbXyYFnKZu1ikR VchNToXw7D9ZaBlqFNurfkqSSqMXY74i8RsgPdmRnfSE7Z267kBTao2QgzCOjCfkTy ETelKOqKAwkMGhlBba7tKwUhcFPfAwKR7zEK3TaGMl+GIYcXGrvKFarrjSRveS6tk6 Wx8+O3l1evvrTPFmAbip5BGr6IIgfpflBzrRAyKvSXpwehMvhjnwP6D2MsDotQvoJG fK+MWPg+kWrzPTYKi5pb87ANkrp9BLPM24WcFyoG9MOFnM8XV3ayKxD/oVZExdK1J8 kB7SSP0CsVi2w== Received: from DHPWEX01.DH-ELECTRONICS.ORG (10.64.2.30) by DHPWEX01.DH-ELECTRONICS.ORG (10.64.2.30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.20; Tue, 22 Nov 2022 11:00:00 +0100 Received: from localhost.localdomain (172.16.51.2) by DHPWEX01.DH-ELECTRONICS.ORG (10.64.2.30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.20 via Frontend Transport; Tue, 22 Nov 2022 11:00:00 +0100 From: Christoph Niedermaier To: CC: Christoph Niedermaier , "Support Opensource" , Adam Thomson , Lee Jones , "Rob Herring" , Krzysztof Kozlowski , Marek Vasut , , Subject: [PATCH 1/3] dt-bindings: mfd: da9062: Move IRQ to optional properties Date: Tue, 22 Nov 2022 10:58:31 +0100 Message-ID: <20221122095833.3957-2-cniedermaier@dh-electronics.com> X-Mailer: git-send-email 2.11.0 X-klartext: yes In-Reply-To: <20221122095833.3957-1-cniedermaier@dh-electronics.com> References: <20221122095833.3957-1-cniedermaier@dh-electronics.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221122_021545_252615_407CC71C X-CRM114-Status: GOOD ( 13.64 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Move IRQ to optional properties, because the MFD DA9061/62 is usable without IRQ. This makes the chip usable for designs that don't have the IRQ pin connected. Signed-off-by: Christoph Niedermaier Acked-by: Krzysztof Kozlowski --- Cc: Support Opensource Cc: Adam Thomson Cc: Lee Jones Cc: Rob Herring Cc: Krzysztof Kozlowski Cc: Marek Vasut Cc: kernel@dh-electronics.com Cc: devicetree@vger.kernel.org To: linux-kernel@vger.kernel.org --- Documentation/devicetree/bindings/mfd/da9062.txt | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Documentation/devicetree/bindings/mfd/da9062.txt b/Documentation/devicetree/bindings/mfd/da9062.txt index bab0d0e66cb3..fe580206e18d 100644 --- a/Documentation/devicetree/bindings/mfd/da9062.txt +++ b/Documentation/devicetree/bindings/mfd/da9062.txt @@ -33,11 +33,6 @@ Required properties: "dlg,da9061" for DA9061 - reg : Specifies the I2C slave address (this defaults to 0x58 but it can be modified to match the chip's OTP settings). -- interrupts : IRQ line information. -- interrupt-controller - -See Documentation/devicetree/bindings/interrupt-controller/interrupts.txt for -further information on IRQ bindings. Optional properties: @@ -48,6 +43,12 @@ Optional properties: See Documentation/devicetree/bindings/gpio/gpio.txt for further information on GPIO bindings. +- interrupts : IRQ line information. +- interrupt-controller + +See Documentation/devicetree/bindings/interrupt-controller/interrupts.txt for +further information on IRQ bindings. + Sub-nodes: - regulators : This node defines the settings for the LDOs and BUCKs. From patchwork Tue Nov 22 09:58:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Niedermaier X-Patchwork-Id: 13052185 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1157EC4332F for ; Tue, 22 Nov 2022 10:32:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=/0Hx6ZG3vTXZQ1wilQcAmboU/bw8t1I7hcFQ64Yj024=; b=cIBdxYRGOL2RJ7 T40O88SlAkvm1vUYeLDtB1pDYdrtGhGWmTA9pEtGWj4eg5TUy3N5SU1nR6FawaRE/uq/beN9WEPU1 3xy8oRfXIEG0lnoUZtztC6tRChDtNwVMNuEpH+fOPVWc3urwlH1KPoDGXgGq4uRm+0xvc0YjyBTA7 GZ0ZKmyrLHMOYVEOcAojUvkzkRD+T2RD8D/FfJdohbEQ3ZMZVR4/nnKxWgB9/C82D+R0xQUw1N9zj ghQeEyGoeipnmmwXBYdFvNBScBrgE9fN1WcdkE0I79xBEzbfoJmw+DfTldLl/uwXt3W5QaWBtPQGh y9qKIbgMPbo6A6c94YgQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oxQYB-007q7o-Rf; Tue, 22 Nov 2022 10:30:48 +0000 Received: from mx4.securetransport.de ([178.254.6.145]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oxQY2-007q2o-HT for linux-arm-kernel@lists.infradead.org; Tue, 22 Nov 2022 10:30:40 +0000 Received: from mail.dh-electronics.com (unknown [77.24.89.57]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx4.securetransport.de (Postfix) with ESMTPSA id 9F6EF720109; Tue, 22 Nov 2022 11:30:13 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dh-electronics.com; s=dhelectronicscom; t=1669113013; bh=UxAFvVtbqMJfsjbWnEHsf/pzy6Jo+6CqJCL6bt0gbJ0=; h=From:To:CC:Subject:Date:In-Reply-To:References:From; b=LcbJGvwJLp/A9g/aHdNe+sBfSo/TRymzvgsBvoGXs/fk5pUjhPDHhZl0ZpWYTh/mo 2i2KoULRHnqIhsNA/a2qBvCOOZFVQL6/dOjf3gvdH8790mLOvqkysQBvPFcvpd/26B ZWG2D6/nam0qGxS0OzGGKftdkwWa+mquonzKaZKKY0Kes0sJpmuhKZDI+9AOYnrNFn uWe7RN+GFffEFfNYYFpQNjRyG6skLdnMew/ZNAAAPSo4yraI1zUdtOtkmzK0bWGaRj sO52wvKlTcQiH0IUvE492yH1tw61kmDLZOqLhSPvo7lXhBynBggEC95hTxY0/l8Atf e3gmfGwzc9POQ== Received: from DHPWEX01.DH-ELECTRONICS.ORG (10.64.2.30) by DHPWEX01.DH-ELECTRONICS.ORG (10.64.2.30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.20; Tue, 22 Nov 2022 11:00:03 +0100 Received: from localhost.localdomain (172.16.51.2) by DHPWEX01.DH-ELECTRONICS.ORG (10.64.2.30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.20 via Frontend Transport; Tue, 22 Nov 2022 11:00:02 +0100 From: Christoph Niedermaier To: CC: Christoph Niedermaier , "Support Opensource" , Adam Thomson , Liam Girdwood , Mark Brown , Marek Vasut , , Subject: [PATCH 2/3] mfd: da9062: Remove IRQ requirement Date: Tue, 22 Nov 2022 10:58:32 +0100 Message-ID: <20221122095833.3957-3-cniedermaier@dh-electronics.com> X-Mailer: git-send-email 2.11.0 X-klartext: yes In-Reply-To: <20221122095833.3957-1-cniedermaier@dh-electronics.com> References: <20221122095833.3957-1-cniedermaier@dh-electronics.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221122_023038_758214_C07EC6BE X-CRM114-Status: GOOD ( 19.74 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This patch removes the requirement for an IRQ, because for the core functionality IRQ isn't needed. So this makes the DA9061/62 chip useable for designs which haven't connected the IRQ pin. Signed-off-by: Christoph Niedermaier --- Cc: Support Opensource Cc: Adam Thomson Cc: Liam Girdwood Cc: Mark Brown Cc: Marek Vasut Cc: kernel@dh-electronics.com Cc: linux-kernel@vger.kernel.org To: linux-arm-kernel@lists.infradead.org --- drivers/mfd/da9062-core.c | 98 +++++++++++++++++++++++++++++++++++------------ 1 file changed, 73 insertions(+), 25 deletions(-) diff --git a/drivers/mfd/da9062-core.c b/drivers/mfd/da9062-core.c index a26e473507c7..9255f86a527c 100644 --- a/drivers/mfd/da9062-core.c +++ b/drivers/mfd/da9062-core.c @@ -212,6 +212,27 @@ static const struct mfd_cell da9061_devs[] = { }, }; +static const struct mfd_cell da9061_devs_without_irq[] = { + { + .name = "da9061-core", + }, + { + .name = "da9062-regulators", + }, + { + .name = "da9061-watchdog", + .of_compatible = "dlg,da9061-watchdog", + }, + { + .name = "da9061-thermal", + .of_compatible = "dlg,da9061-thermal", + }, + { + .name = "da9061-onkey", + .of_compatible = "dlg,da9061-onkey", + }, +}; + static const struct resource da9062_core_resources[] = { DEFINE_RES_NAMED(DA9062_IRQ_VDD_WARN, 1, "VDD_WARN", IORESOURCE_IRQ), }; @@ -288,6 +309,35 @@ static const struct mfd_cell da9062_devs[] = { }, }; +static const struct mfd_cell da9062_devs_without_irq[] = { + { + .name = "da9062-core", + }, + { + .name = "da9062-regulators", + }, + { + .name = "da9062-watchdog", + .of_compatible = "dlg,da9062-watchdog", + }, + { + .name = "da9062-thermal", + .of_compatible = "dlg,da9062-thermal", + }, + { + .name = "da9062-rtc", + .of_compatible = "dlg,da9062-rtc", + }, + { + .name = "da9062-onkey", + .of_compatible = "dlg,da9062-onkey", + }, + { + .name = "da9062-gpio", + .of_compatible = "dlg,da9062-gpio", + }, +}; + static int da9062_clear_fault_log(struct da9062 *chip) { int ret; @@ -625,7 +675,7 @@ static int da9062_i2c_probe(struct i2c_client *i2c, const struct i2c_device_id *id) { struct da9062 *chip; - unsigned int irq_base; + unsigned int irq_base = 0; const struct mfd_cell *cell; const struct regmap_irq_chip *irq_chip; const struct regmap_config *config; @@ -645,21 +695,16 @@ static int da9062_i2c_probe(struct i2c_client *i2c, i2c_set_clientdata(i2c, chip); chip->dev = &i2c->dev; - if (!i2c->irq) { - dev_err(chip->dev, "No IRQ configured\n"); - return -EINVAL; - } - switch (chip->chip_type) { case COMPAT_TYPE_DA9061: - cell = da9061_devs; - cell_num = ARRAY_SIZE(da9061_devs); + cell = i2c->irq ? da9061_devs : da9061_devs_without_irq; + cell_num = i2c->irq ? ARRAY_SIZE(da9061_devs) : ARRAY_SIZE(da9061_devs_without_irq); irq_chip = &da9061_irq_chip; config = &da9061_regmap_config; break; case COMPAT_TYPE_DA9062: - cell = da9062_devs; - cell_num = ARRAY_SIZE(da9062_devs); + cell = i2c->irq ? da9062_devs : da9062_devs_without_irq; + cell_num = i2c->irq ? ARRAY_SIZE(da9062_devs) : ARRAY_SIZE(da9062_devs_without_irq); irq_chip = &da9062_irq_chip; config = &da9062_regmap_config; break; @@ -695,29 +740,32 @@ static int da9062_i2c_probe(struct i2c_client *i2c, if (ret) return ret; - ret = da9062_configure_irq_type(chip, i2c->irq, &trigger_type); - if (ret < 0) { - dev_err(chip->dev, "Failed to configure IRQ type\n"); - return ret; - } + if (i2c->irq) { + ret = da9062_configure_irq_type(chip, i2c->irq, &trigger_type); + if (ret < 0) { + dev_err(chip->dev, "Failed to configure IRQ type\n"); + return ret; + } - ret = regmap_add_irq_chip(chip->regmap, i2c->irq, - trigger_type | IRQF_SHARED | IRQF_ONESHOT, - -1, irq_chip, &chip->regmap_irq); - if (ret) { - dev_err(chip->dev, "Failed to request IRQ %d: %d\n", - i2c->irq, ret); - return ret; - } + ret = regmap_add_irq_chip(chip->regmap, i2c->irq, + trigger_type | IRQF_SHARED | IRQF_ONESHOT, + -1, irq_chip, &chip->regmap_irq); + if (ret) { + dev_err(chip->dev, "Failed to request IRQ %d: %d\n", + i2c->irq, ret); + return ret; + } - irq_base = regmap_irq_chip_get_base(chip->regmap_irq); + irq_base = regmap_irq_chip_get_base(chip->regmap_irq); + } ret = mfd_add_devices(chip->dev, PLATFORM_DEVID_NONE, cell, cell_num, NULL, irq_base, NULL); if (ret) { dev_err(chip->dev, "Cannot register child devices\n"); - regmap_del_irq_chip(i2c->irq, chip->regmap_irq); + if (i2c->irq) + regmap_del_irq_chip(i2c->irq, chip->regmap_irq); return ret; } From patchwork Tue Nov 22 09:58:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Niedermaier X-Patchwork-Id: 13052193 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6E230C433FE for ; Tue, 22 Nov 2022 10:46:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=M3QxAFYW9ppzv96v5xKhYEh5Gf2ZjqUdt+V5eXCZ/Ks=; b=QHOkY0n4XO1Pw3 dWaSkUKER8cidpDsWv9Gaaw6opamJJUrNvxcpkyutyomh09TmfAs1M26/YWyo7iRjJWrdRWEQh/qr mzNAv6I42PnwoI/EqRcrWNvltzDOcKhd73D2Z2EXwcFibHew/DwySqodu+hM8/RRS5R/gsGr65N5+ 04jEx4BYE6GLuU4EE1JLJLTzf+7cHA7xukHAyVMrrnbe22xkuHbnSOHH1I8k9+14y3qy6p1vawgSH 4SLUigdC/L60+GHGU6KyjPCiAgv4hDPl4dkBhAJmCbuWuR2miWkFyYSlZf7h8+OwlBToC+uZlqLl5 0W+HZ3c6kvChTUjIsejg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oxQme-007ynq-6A; Tue, 22 Nov 2022 10:45:44 +0000 Received: from mx2.securetransport.de ([2a03:4000:13:6c7::1]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oxQma-007yjl-MQ for linux-arm-kernel@lists.infradead.org; Tue, 22 Nov 2022 10:45:42 +0000 Received: from mail.dh-electronics.com (unknown [77.24.89.57]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx2.securetransport.de (Postfix) with ESMTPSA id 94D265E8DA; Tue, 22 Nov 2022 11:45:15 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dh-electronics.com; s=dhelectronicscom; t=1669113916; bh=8/2f5/wC+/WGNHGQUshaA3bZxyQCSCGtdkYvUN/IFBU=; h=From:To:CC:Subject:Date:In-Reply-To:References:From; b=d0pAPsyx7FPGn/eNalj7eNSN59LveKCoxIMgBAcP39a/PeiZjs/FvjowB79czqDwe O/FvySr5W7qrzTZsdJ1B6nzL35t2W6He+qlLPyDdfJNlh0OhOhJHGs6kA7ZiHz6EPF fLuieF/pXlTKS0RymiJgYAjDWYbTCz6Pq3mIxHKIjWubTZCvdqSOjGXFS0jBByru/Q /DT5Htx1z3SzFd96MagBQpVPA/ljjzySYZ/PHNR9EUT3rFMNVGWVHdRUGvylGfWnBC yOIQH3GSDSuZUiQnB2DemqMRII+tBOVve78r8Yd60HO2vma94Bygb804+5O4sar+sX agJdTtLwaQe2A== Received: from DHPWEX01.DH-ELECTRONICS.ORG (10.64.2.30) by DHPWEX01.DH-ELECTRONICS.ORG (10.64.2.30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.20; Tue, 22 Nov 2022 11:00:04 +0100 Received: from localhost.localdomain (172.16.51.2) by DHPWEX01.DH-ELECTRONICS.ORG (10.64.2.30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.20 via Frontend Transport; Tue, 22 Nov 2022 11:00:03 +0100 From: Christoph Niedermaier To: CC: Christoph Niedermaier , "Support Opensource" , Adam Thomson , Liam Girdwood , Mark Brown , Marek Vasut , , Subject: [PATCH 3/3] regulator: da9062: Make the use of IRQ optional Date: Tue, 22 Nov 2022 10:58:33 +0100 Message-ID: <20221122095833.3957-4-cniedermaier@dh-electronics.com> X-Mailer: git-send-email 2.11.0 X-klartext: yes In-Reply-To: <20221122095833.3957-1-cniedermaier@dh-electronics.com> References: <20221122095833.3957-1-cniedermaier@dh-electronics.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221122_024540_901095_72039C3C X-CRM114-Status: GOOD ( 15.89 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This patch makes the use of IRQ optional to make the DA9061/62 usable for designs that don't have the IRQ pin connected, because the regulator is usable without IRQ. Signed-off-by: Christoph Niedermaier Acked-by: Mark Brown Reviewed-by: Adam Ward --- Cc: Support Opensource Cc: Adam Thomson Cc: Liam Girdwood Cc: Mark Brown Cc: Marek Vasut Cc: kernel@dh-electronics.com Cc: linux-kernel@vger.kernel.org To: linux-arm-kernel@lists.infradead.org --- drivers/regulator/da9062-regulator.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/regulator/da9062-regulator.c b/drivers/regulator/da9062-regulator.c index 1a6324001027..653e1844dd61 100644 --- a/drivers/regulator/da9062-regulator.c +++ b/drivers/regulator/da9062-regulator.c @@ -1012,10 +1012,9 @@ static int da9062_regulator_probe(struct platform_device *pdev) } /* LDOs overcurrent event support */ - irq = platform_get_irq_byname(pdev, "LDO_LIM"); - if (irq < 0) - return irq; - regulators->irq_ldo_lim = irq; + regulators->irq_ldo_lim = platform_get_irq_byname_optional(pdev, "LDO_LIM"); + if (regulators->irq_ldo_lim < 0) + return 0; ret = devm_request_threaded_irq(&pdev->dev, irq, NULL, da9062_ldo_lim_event,