From patchwork Thu Sep 8 11:25:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bryan O'Donoghue X-Patchwork-Id: 12969966 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D2B17C6FA82 for ; Thu, 8 Sep 2022 11:26:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230479AbiIHL0T (ORCPT ); Thu, 8 Sep 2022 07:26:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52036 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231216AbiIHL0S (ORCPT ); Thu, 8 Sep 2022 07:26:18 -0400 Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DDB58D2769 for ; Thu, 8 Sep 2022 04:26:01 -0700 (PDT) Received: by mail-wr1-x42a.google.com with SMTP id b17so12177979wrq.3 for ; Thu, 08 Sep 2022 04:26:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=2uCwmHdjg21zPOoZO9GyiM8A7cUULvVI0yDuz4f3uYI=; b=dncoAgdXRlqn6xPQpT3Rz/JvkGUvD35uikKY/S8ciePn0uZEXuzAXIPzrL9qcwlGwf tPKzT5JqSxIcgjS2aOIFFUPbF9uVC7c8NkqkHYjFhflNVIydqhB71dYTjN8Srs0qS5Uf TjYXRXpLl2hhlD/tfhSjhW3NpvvLJzq6whUKSJVj+G8EIwxKeCcDQXLeHwUMcoeNyCPl KeXUsdwoOtBvjMfowLxoBfKcWGq61miMU53iapcG1vjZdioSAlPCc3B+SHWt2/2paFi5 Wv486EySlyO8SO2K64CjABmcKeor1CvxFF1AokBfpNpeko8ASoIpF6MzlkM2VvHkrd2r HHvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=2uCwmHdjg21zPOoZO9GyiM8A7cUULvVI0yDuz4f3uYI=; b=mFzJC/n5s/dOI/DS3Czd6w1zc6lsop1Bh719SYXDJ09Q0lNr8MzWd+x7ialPaR9P/6 e6SFa9LeL8pl6q90eaUAvfzvOSXl55pzCcyCfWwKOBAKmnHGwGkGF4rjUsgmflCu+9J+ lCac56O7XwOQUd+WfIe7D69UpMFnNvch6r+nJGhNgpv0lTBR7iiqW3NgQnslkoxnFasS Gh9+0gfvkMCAjLS1Qfgo40PVbCU348oxxYWsgudA8TrrWW3Bkyu/t/Xzf3tg8bxn/51E mfpPYs73efDSS7y5w143VTPHPQBjomO8ZXEFz6grM4Vyg61Ve+MaiKin1Sq3WHz5Aqur 0llQ== X-Gm-Message-State: ACgBeo1O8m9htwm6gBfm/lHo9n6HbbP6E7alocdIPtrE4h+RKle2Mpid 5EV2KWNPpQVwKyB9opZx8MkxIw== X-Google-Smtp-Source: AA6agR5HkrW5SuUm5+J2yTFzMytf1r040Wtzkb7Ckqs8wjSJ7h23PEaX9dcTdx3VtW9xy1uWFAi5rw== X-Received: by 2002:a5d:6504:0:b0:228:c94b:a5bb with SMTP id x4-20020a5d6504000000b00228c94ba5bbmr4607620wru.623.1662636360180; Thu, 08 Sep 2022 04:26:00 -0700 (PDT) Received: from sagittarius-a.chello.ie (188-141-3-169.dynamic.upc.ie. [188.141.3.169]) by smtp.gmail.com with ESMTPSA id w10-20020a05600c474a00b003a608d69a64sm2582382wmo.21.2022.09.08.04.25.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Sep 2022 04:25:59 -0700 (PDT) From: Bryan O'Donoghue To: agross@kernel.org, andersson@kernel.org, konrad.dybcio@somainline.org, myungjoo.ham@samsung.com, cw00.choi@samsung.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, gurus@codeaurora.org, marijn.suijten@somainline.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org Cc: bryan.odonoghue@linaro.org, Rob Herring Subject: [PATCH v4 1/2 RESEND] dt-bindings: pm8941-misc: Fix usb_id and usb_vbus definitions Date: Thu, 8 Sep 2022 12:25:55 +0100 Message-Id: <20220908112556.860343-2-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220908112556.860343-1-bryan.odonoghue@linaro.org> References: <20220908112556.860343-1-bryan.odonoghue@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org dts validation is throwing an error for me on 8916 and 8939 with extcon@1300. In that case we have usb_vbus but not usb_id. It wasn't immediately obvious if there was a valid use-case for the existing code for usb_id in isolation, however discussing further, we concluded that usb_id, usb_vbus or (usb_id | usb_vbus) are valid combinations as an external IC may be responsible for usb_id or usb_vbus. Expand the definition with anyOf to capture the three different valid modes. Fixes: 4fcdd677c4ea ("bindings: pm8941-misc: Add support for VBUS detection") Reviewed-by: Rob Herring Reviewed-by: Marijn Suijten Signed-off-by: Bryan O'Donoghue --- .../devicetree/bindings/extcon/qcom,pm8941-misc.yaml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Documentation/devicetree/bindings/extcon/qcom,pm8941-misc.yaml b/Documentation/devicetree/bindings/extcon/qcom,pm8941-misc.yaml index 6a9c96f0352ac..1bc412a4ac5e6 100644 --- a/Documentation/devicetree/bindings/extcon/qcom,pm8941-misc.yaml +++ b/Documentation/devicetree/bindings/extcon/qcom,pm8941-misc.yaml @@ -27,10 +27,14 @@ properties: interrupt-names: minItems: 1 - items: - - const: usb_id - - const: usb_vbus - + anyOf: + - items: + - const: usb_id + - const: usb_vbus + - items: + - const: usb_id + - items: + - const: usb_vbus required: - compatible - reg From patchwork Thu Sep 8 11:25:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bryan O'Donoghue X-Patchwork-Id: 12969968 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5F2F3C6FA8A for ; Thu, 8 Sep 2022 11:26:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231225AbiIHL0V (ORCPT ); Thu, 8 Sep 2022 07:26:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52022 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231236AbiIHL0T (ORCPT ); Thu, 8 Sep 2022 07:26:19 -0400 Received: from mail-wr1-x433.google.com (mail-wr1-x433.google.com [IPv6:2a00:1450:4864:20::433]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9492BF56D0 for ; Thu, 8 Sep 2022 04:26:02 -0700 (PDT) Received: by mail-wr1-x433.google.com with SMTP id e20so25478397wri.13 for ; Thu, 08 Sep 2022 04:26:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=j2BR3h16Mhy5gM4KsP6TulbAM/2F99pvBCc7QlwzcZ4=; b=uXljko84xfgZ+EbWTYKt+EYyPNAn2VCe1GJ+ETRhy7sJdtRxGnwvZOum0FJuZHL2VU IoeKUEB1eJ7UfdasgqTG3JkOddRqmhCSxKk2QVh7KBD45mNSCRuWZS8sFHmJpV+0n3tP vZlxfYJ6wg6cMZSgs6NtQD+gWvLmVptb7GZ9ydpNpiDnVg79gUUb6heLomAGq9+Rtc3n hcr9zM8Gkba+NlaeHR/DVmijLFMlvGu9IaB5ZMqJp9CE6jyHMjiyAlpQYQqgeMvXbHoz +UBnGjRjju/4Esqao3NKDjhL64Pk+eG4JESKsPA/vG6B5ByCTN1aH5SLEDnfYNlhafLM Radw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=j2BR3h16Mhy5gM4KsP6TulbAM/2F99pvBCc7QlwzcZ4=; b=7arpTx7DpnVtVw4rWSzcWRerFEz0pVq9uyFkKZ1il5yTXejx0s/v0qTSgsws/RCp9B NsHgYBUYqszTnPpssph6tCZ4+Qv8FVdi3iE9Kw6KOTKwNFtK31ehQipOvtF2RXW8xN5+ TWtMp/Yk4HsAGWUzr04CKgge4UwuRCXF/b6iZxpk7Co7sD8qBP3sbGxAO019nte1wV1O Oqd8xMrIWVWjiFF9sIZFvAHGUcTGe9p/EAlUsNH4unKU6fbn1/J+oo+GU/+Ec7vEbZ1C J4lIOxIki7JskRBMCSDvG+X/gr04rcvJkiw4j3JEkAf2TAMtunjjJAWiAnoH0NL4S5M1 qw4g== X-Gm-Message-State: ACgBeo3c2hi6BmlroG3hYOYjiVEU1fF1pFsaPv1eI9RSyKfPrNouJe/m CqLxZc5CroExlsmMhu6igsvWGw== X-Google-Smtp-Source: AA6agR57oyHKdotUmWefM1G8UI42vl/MzGn78mUd6ti+t+FghYyFCFPVXHGvm9GSes3OXkJLgot2zg== X-Received: by 2002:a05:6000:1146:b0:228:d61c:2c83 with SMTP id d6-20020a056000114600b00228d61c2c83mr4888181wrx.332.1662636361097; Thu, 08 Sep 2022 04:26:01 -0700 (PDT) Received: from sagittarius-a.chello.ie (188-141-3-169.dynamic.upc.ie. [188.141.3.169]) by smtp.gmail.com with ESMTPSA id w10-20020a05600c474a00b003a608d69a64sm2582382wmo.21.2022.09.08.04.26.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Sep 2022 04:26:00 -0700 (PDT) From: Bryan O'Donoghue To: agross@kernel.org, andersson@kernel.org, konrad.dybcio@somainline.org, myungjoo.ham@samsung.com, cw00.choi@samsung.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, gurus@codeaurora.org, marijn.suijten@somainline.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org Cc: bryan.odonoghue@linaro.org Subject: [PATCH v4 2/2 RESEND] extcon: qcom-spmi: Switch to platform_get_irq_byname_optional Date: Thu, 8 Sep 2022 12:25:56 +0100 Message-Id: <20220908112556.860343-3-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220908112556.860343-1-bryan.odonoghue@linaro.org> References: <20220908112556.860343-1-bryan.odonoghue@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Valid configurations for the extcon interrupt declarations are - usb_id - usb_vbus - (usb_id | usb_vbus) In the case of a standalone usb_id or usb_vbus failure to find one of the interrupts shouldn't generate a warning message. A warning is already in place if both IRQs are missing. Switch to using platform_get_irq_byname_optional() in order to facilitate this behaviour. Suggested-by: Marijn Suijten Signed-off-by: Bryan O'Donoghue --- drivers/extcon/extcon-qcom-spmi-misc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/extcon/extcon-qcom-spmi-misc.c b/drivers/extcon/extcon-qcom-spmi-misc.c index eb02cb962b5e1..f72e90ceca53d 100644 --- a/drivers/extcon/extcon-qcom-spmi-misc.c +++ b/drivers/extcon/extcon-qcom-spmi-misc.c @@ -123,7 +123,7 @@ static int qcom_usb_extcon_probe(struct platform_device *pdev) if (ret) return ret; - info->id_irq = platform_get_irq_byname(pdev, "usb_id"); + info->id_irq = platform_get_irq_byname_optional(pdev, "usb_id"); if (info->id_irq > 0) { ret = devm_request_threaded_irq(dev, info->id_irq, NULL, qcom_usb_irq_handler, @@ -136,7 +136,7 @@ static int qcom_usb_extcon_probe(struct platform_device *pdev) } } - info->vbus_irq = platform_get_irq_byname(pdev, "usb_vbus"); + info->vbus_irq = platform_get_irq_byname_optional(pdev, "usb_vbus"); if (info->vbus_irq > 0) { ret = devm_request_threaded_irq(dev, info->vbus_irq, NULL, qcom_usb_irq_handler,