From patchwork Sun Jul 17 12:33:03 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: 12920520 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 3FC3DCCA480 for ; Sun, 17 Jul 2022 12:33:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231534AbiGQMdR (ORCPT ); Sun, 17 Jul 2022 08:33:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58744 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229621AbiGQMdQ (ORCPT ); Sun, 17 Jul 2022 08:33:16 -0400 Received: from mail-wr1-x42e.google.com (mail-wr1-x42e.google.com [IPv6:2a00:1450:4864:20::42e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A5E2B15A2E for ; Sun, 17 Jul 2022 05:33:15 -0700 (PDT) Received: by mail-wr1-x42e.google.com with SMTP id v16so13223162wrd.13 for ; Sun, 17 Jul 2022 05:33:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=2uCwmHdjg21zPOoZO9GyiM8A7cUULvVI0yDuz4f3uYI=; b=t32K0zJnrJk84Oroej5+duxaqm9tE5E/z9ohHiatAtOz0K9wrvwbIbXSP8oUZX3yU3 Idflt8y7m7oVEDfymBlfVzJKdR0iFa03OQJVN4hNxDOEunTqS+Wnn9BYvsvrzbHLjtk8 cM1cj9V4ZO7Y6jHRvwUGNnOxQXXmp2qn1VNufvPhMgBQMk3aCneUs55XCW6yzRDUcVf1 CQ1ARAYVHUCb1BOvVeD9GsKuB9NrcywXserD+qiH88lHk6d/4mS1EQZQwhSW6ovxYsc3 xYtpbqq7vu0vd+5a1KuikKyqemhqPS9iaAo7e6PjwRQVZddRuswuvAADy8zht61+8m/G NkCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=2uCwmHdjg21zPOoZO9GyiM8A7cUULvVI0yDuz4f3uYI=; b=HHq6ZJcQJsX1hnGMoKob+TQxiWUrEp/ckIyPgRRfoizmZrvwwtfWHiN7uzIZE6XkSx LaB1JJA2uMg9qRlGjC6sIUFFPIl7iYsQbreOthPwOahuRc+C6AtcMheB0PQ+RuusOXgg U44RghFIym9O8idqIvGiJFpuUGFeYhjmGXalFjfYCGtfBTsqft9fmoufU6vHCzzKIdQm +JMxV1S6x9tw+/K2PcbX6r5AEmYZZG8TK0Qgz3uO+Qp8muptP5owo19Sva46cwLD6ijB LFPGGxIFSJshPBk8t+Z5unOsiR/R9ZFyv5tPJj7QqOquP7LDk0VM3AhbCUnCV026zbRF r1mw== X-Gm-Message-State: AJIora8927Ifv2vwIoh6iiTZvFi2rZO4hBh6VrN7N15znm9L34PZ/nb9 HsDiGOhnTdTZ6RSyGBSHV1LS2A== X-Google-Smtp-Source: AGRyM1ujSirm/jZ8J8Xz8yhFRzFmuzdM5ekAtCUG9NdHduCUcRFsy6B14AY8FTjzyClLzEpZyVs/sQ== X-Received: by 2002:a5d:5a9d:0:b0:21b:8247:7ec4 with SMTP id bp29-20020a5d5a9d000000b0021b82477ec4mr19225709wrb.561.1658061194249; Sun, 17 Jul 2022 05:33:14 -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 m9-20020adfe949000000b0021d4694fcaesm8146790wrn.107.2022.07.17.05.33.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 17 Jul 2022 05:33:13 -0700 (PDT) From: Bryan O'Donoghue To: agross@kernel.org, bjorn.andersson@linaro.org, konrad.dybcio@somainline.org, myungjoo.ham@samsung.com, cw00.choi@samsung.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org Cc: linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, marijn.suijten@somainline.org, bryan.odonoghue@linaro.org, Rob Herring Subject: [PATCH v4 1/2] dt-bindings: pm8941-misc: Fix usb_id and usb_vbus definitions Date: Sun, 17 Jul 2022 13:33:03 +0100 Message-Id: <20220717123304.938259-2-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220717123304.938259-1-bryan.odonoghue@linaro.org> References: <20220717123304.938259-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 Sun Jul 17 12:33:04 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: 12920521 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 39F38C433EF for ; Sun, 17 Jul 2022 12:33:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229621AbiGQMdS (ORCPT ); Sun, 17 Jul 2022 08:33:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58760 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232136AbiGQMdR (ORCPT ); Sun, 17 Jul 2022 08:33:17 -0400 Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9077614D29 for ; Sun, 17 Jul 2022 05:33:16 -0700 (PDT) Received: by mail-wr1-x432.google.com with SMTP id bk26so13239518wrb.11 for ; Sun, 17 Jul 2022 05:33:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=j2BR3h16Mhy5gM4KsP6TulbAM/2F99pvBCc7QlwzcZ4=; b=ZbBiwnWJNKIr+NR37XpR7bSyqYBFbDrUDPWbNlxfXdnHWQXDVq5CxgdOJ2DGKUn/oa WYxvBFZWZC6ja2EyLW2VpjNJpx2FOVobl0NvrD2nX1gDIHmmqOTzJ8PVgtyVOVWXjAxi pJ/M+i1IomOyh8qmq7hHDgUE8pf2nJGcHJJPt38ZjFtRQSte4lfn7rkFXWLOgkC3Og5I sPg612k6g8V0OAbkMGdlaXT7+h3MXpSCrmsdFILk1d7hzJV80OBdZ0AYlH+TkObC1i2O 1WAEWsI9AyVq3lIgQasMJ6eAjXIevem2cUa7OOlcspp57I+10sr/TbQD6SMcSXKmdlIG Ghig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=j2BR3h16Mhy5gM4KsP6TulbAM/2F99pvBCc7QlwzcZ4=; b=IzVE6OSrcFunU5ZzRYy9S/bsV1dwQsBPJaxKwIk4CWRiUBb4V+VvSakHcbchg+LEu9 p/FZIaI4bHGm1eSnWO6yiswepB0qyWjm6koaizkQSJeIgv8WKkh4dLlp/Eus/pGnSBwW 0oYfZDJOqIwVJ6Xgx4p/tY+5ZZCM9diqkjMOlon7DBwG9KcLORfBthJW9kdujdsoXS/l i2kRlC14VppykpPTvPd2TyGqIcrOlZpGCz6UuDZbyz5D80Y3BybPZkRXetDX1qydxogU R6UWlpHoad1RMVBu/C9R/yl+Hmi+KV29vXimB4t+nnAC5MaOoOKlConF0A6yeQuATh6E yESA== X-Gm-Message-State: AJIora8tL+0vwf2XjVq0SeakpmDwhi+p7NAq5YaXZmRB94BR7f/yMCxs 6mCM8xrx1wLpMXHM+iJMzAohdw== X-Google-Smtp-Source: AGRyM1tK90tcONCCmwdcbnUBnjLYo/lZl+KlirKq1g/sxB3t+rAkHO/ZgXor1/8R6Ulss4TnZXfVUg== X-Received: by 2002:a05:6000:250:b0:21d:b3b5:3438 with SMTP id m16-20020a056000025000b0021db3b53438mr18010565wrz.203.1658061195148; Sun, 17 Jul 2022 05:33:15 -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 m9-20020adfe949000000b0021d4694fcaesm8146790wrn.107.2022.07.17.05.33.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 17 Jul 2022 05:33:14 -0700 (PDT) From: Bryan O'Donoghue To: agross@kernel.org, bjorn.andersson@linaro.org, konrad.dybcio@somainline.org, myungjoo.ham@samsung.com, cw00.choi@samsung.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org Cc: linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, marijn.suijten@somainline.org, bryan.odonoghue@linaro.org Subject: [PATCH v4 2/2] extcon: qcom-spmi: Switch to platform_get_irq_byname_optional Date: Sun, 17 Jul 2022 13:33:04 +0100 Message-Id: <20220717123304.938259-3-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220717123304.938259-1-bryan.odonoghue@linaro.org> References: <20220717123304.938259-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,