From patchwork Thu Jul 13 09:03:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Niedermaier X-Patchwork-Id: 13311650 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 35139C001B0 for ; Thu, 13 Jul 2023 09:21:47 +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: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:In-Reply-To:References: List-Owner; bh=/eB+u2lnWMQDqxnt+N02IyTKGmEDu/77eyosyA9IW/8=; b=IESetPj94JdLlP qzWAkTw43L2n+mu6SMNyP/XAtLwAAEZGMrUqp3ZO1RtXr1RyUd8VMQ1gIgCraA9HQW7xtQLmnQ8gO DKJwFL2AVB5qM4maunDekaRh+N/Riq4qeUtUUWeo35eT4BBmE5YQ6Om00FWAYlrmg7buKsr4SDUw+ tM3+aMfNR8XIvuwlkhySi99H/4oRvH1OBWFvNoi1ApFCXe/5M7cIAwVUUFHgEqJ3pcqj+UO2mwZ8+ lPVbcOpbr1piHqmNE9SweVhSZNOest/7/4H5fu39q4LR/dL9e2eLL3rfQ96pM1J9cFydsXWcp7iJR L0dzncryKzHILkQm/Vzw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qJsVl-002bVH-1X; Thu, 13 Jul 2023 09:21:21 +0000 Received: from mx2.securetransport.de ([188.68.39.254]) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qJsVi-002bUZ-20 for linux-arm-kernel@lists.infradead.org; Thu, 13 Jul 2023 09:21:20 +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 7907E5E927; Thu, 13 Jul 2023 11:20:53 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dh-electronics.com; s=dhelectronicscom; t=1689240054; bh=S16vix2PCMZJ04EOz/eaypi8vCJykAo9q+IFd6bxo/0=; h=From:To:CC:Subject:Date:From; b=YOx/GGo5500mkC9YY33XlkwGMkeZPNzyssyh5uEzdqbpOenaeSd2IsGXFj6gRVG6e G5LqJFrjEPcyIiezE/50R/hFEEoA90Actyz0y7psCgoyHo3Cbccj+hvPzCi3rtBgOq qC4+v6POmEV+PEPOoaDVroWCgBBN+Z/MZDlmMYW0bRVXyz3AhHE1QAwsp10GnoIx/1 JgHFlARSYqMVaw4GiyQkXwOp/5imiekLRlfyi7tEGHNc0h2XNpvNqnsPp6RZsMcUvS gQBFOxqBYjq98QKVJ9RVvLb9KJamIUBNxbtR+rFH3MVodJkaYzkuFgiU1sOBEWbEBv /QpIDWQaaNULg== 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.1258.16; Thu, 13 Jul 2023 11:20:51 +0200 Received: from localhost.localdomain (172.16.51.5) 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.1258.16 via Frontend Transport; Thu, 13 Jul 2023 11:20:50 +0200 From: Christoph Niedermaier To: CC: Christoph Niedermaier , "Support Opensource" , Adam Thomson , Liam Girdwood , Mark Brown , Marek Vasut , , Subject: [PATCH V5] regulator: da9062: Make the use of IRQ optional Date: Thu, 13 Jul 2023 11:03:28 +0200 Message-ID: <20230713090328.3879-1-cniedermaier@dh-electronics.com> X-Mailer: git-send-email 2.11.0 X-klartext: yes MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230713_022118_801197_8622F895 X-CRM114-Status: GOOD ( 16.25 ) 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 Reviewed-by: Marek Vasut Reported-by: kernel test robot Link: https://lore.kernel.org/oe-kbuild-all/202303082246.GuLdPL0t-lkp@intel.com/ --- 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 --- V2: - Rebase on current next 20230209 - Add Reviewed-by and Acked-by tags V3: - Rebase on current next 20230307 v4: - Rebase on current next 20230309 - Fix a missing variable change reported by kernel test robot v5: - Rebase on current next 20230713 - Add Marek's Reviewed-by tag --- drivers/regulator/da9062-regulator.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/regulator/da9062-regulator.c b/drivers/regulator/da9062-regulator.c index c28b061eef02..1d354db0c1bd 100644 --- a/drivers/regulator/da9062-regulator.c +++ b/drivers/regulator/da9062-regulator.c @@ -924,7 +924,7 @@ static int da9062_regulator_probe(struct platform_device *pdev) struct da9062_regulator *regl; struct regulator_config config = { }; const struct da9062_regulator_info *rinfo; - int irq, n, ret; + int n, ret; int max_regulators; switch (chip->chip_type) { @@ -1012,12 +1012,11 @@ 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, + ret = devm_request_threaded_irq(&pdev->dev, regulators->irq_ldo_lim, NULL, da9062_ldo_lim_event, IRQF_TRIGGER_LOW | IRQF_ONESHOT, "LDO_LIM", regulators);