From patchwork Mon Sep 26 11:31:42 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: 12988688 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 9EF4DC32771 for ; Mon, 26 Sep 2022 13:17:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234484AbiIZNRc (ORCPT ); Mon, 26 Sep 2022 09:17:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38666 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233785AbiIZNRG (ORCPT ); Mon, 26 Sep 2022 09:17:06 -0400 Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E7C9448E80 for ; Mon, 26 Sep 2022 04:44:56 -0700 (PDT) Received: by mail-wm1-f47.google.com with SMTP id u16-20020a05600c211000b003b5152ebf09so4759014wml.5 for ; Mon, 26 Sep 2022 04:44:56 -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=TERL3inRZq0WCbTMsYxYubxRLl19MBHAR6y43iE2+Y3K79F2k1sJgP8lWn5pU6tB4H gjnfZDpgdVrDYvUb/Hq8j+M9ntTgND+qM9eyR003CiHFp41Ohkk1CxJ4w3lcllnLtpbB yxtwc6FuyGOUtwCY4ae7R0nhCYQgzWe1PGX226pRQkKN9a+5oIHIOQYkMVwYAq20ZUAz 1bHzptIjfxbTQY6Kv/sbXgwO/GUkmltk5MQsL5RqHuOs20EgYAOmDjL0y+zlWdA3vEJN /BwBoF1ka9daQPM5rvEmH1dtDkfE9d0klBrmuhslpk6ug56x1mXPvZ3D3szXb/hY5C9E EZMA== 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=6Id9cPv42ab6bn4MLpkC5J0JvEavlxLxXWhHQhTA7k6zEM7zMJyojlK/YC9NYLB7XM PtJgsIOK2T69zL9fBxF5bdRwxiLseugppc9cSKwJnHJjhDyrgA9urhFuHxnKxJ1Hd2kS 4R0k6n2tUMFBbn7DKbZCXJq/u/0HIoGYxJ1jDwzdlXDmZPohyQ4xWYYDa9Wtoi08/38p oGfyGNKTOvsLI8VkoW50sMuHOyj9AWTYpSxVTF77OlBVeqSwMRB3yarZM8gme9at3dxl Ddg04a2jVl3kY9x/9px53ENc2WoGVljMbc9JhqTIx8N+yMJD64fNpja6DOz4n3UkRRJS 53ww== X-Gm-Message-State: ACrzQf1QkCjxkydibHdVXAYyL1IbjaXIxeXZsj9kKkkdU79+PsOKjGcx Y4N0jIg1pI9+Rx5swbw1rk/3ysyddjXQAg== X-Google-Smtp-Source: AMsMyM67FSLuZm5iPgZXwZg/yCN/P6KABChWbV6u33cpUuEe6UxI042iPcC5ny1YUZOonUFsggRoJA== X-Received: by 2002:a7b:c84c:0:b0:3b3:3faa:10c3 with SMTP id c12-20020a7bc84c000000b003b33faa10c3mr21612635wml.94.1664191906169; Mon, 26 Sep 2022 04:31:46 -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 x8-20020adfdcc8000000b0022a2dbc80fdsm14064882wrm.10.2022.09.26.04.31.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Sep 2022 04:31:45 -0700 (PDT) From: Bryan O'Donoghue To: myungjoo.ham@samsung.com, cw00.choi@samsung.com Cc: agross@kernel.org, bjorn.andersson@linaro.org, konrad.dybcio@somainline.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, gurus@codeaurora.org, aghayal@codeaurora.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, bryan.odonoghue@linaro.org, Rob Herring , Marijn Suijten Subject: [PATCH v4 1/2 RESEND] dt-bindings: pm8941-misc: Fix usb_id and usb_vbus definitions Date: Mon, 26 Sep 2022 12:31:42 +0100 Message-Id: <20220926113143.40768-2-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220926113143.40768-1-bryan.odonoghue@linaro.org> References: <20220926113143.40768-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 Mon Sep 26 11:31:43 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: 12988680 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 4CFC1C07E9D for ; Mon, 26 Sep 2022 12:59:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234929AbiIZM73 (ORCPT ); Mon, 26 Sep 2022 08:59:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41534 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234903AbiIZM7N (ORCPT ); Mon, 26 Sep 2022 08:59:13 -0400 Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com [IPv6:2a00:1450:4864:20::42d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 075DB6CD08 for ; Mon, 26 Sep 2022 04:32:48 -0700 (PDT) Received: by mail-wr1-x42d.google.com with SMTP id bq9so9758028wrb.4 for ; Mon, 26 Sep 2022 04:32:48 -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=fEdQstABZ4T9ZxRQMaYKFiX2VfKeCXeT+d0SqgSdd0KTZhKNZQDYQynywvrs/z8/ic X1gKARKSK2iwvRqYp/PGiILjw08tjtUScR9bgzTxQxpGw45u4plJaUbi9mGoRAxrNGDe l0VzrWkMwhHdzIW/YLvIisEIqrbmAKEpiOpW8u7TeK1cnysOCdsEViRUONgehEvOQu/+ hbbujWSaB5weuOlcFY4K+jxbH3JNmYYD6TwVYdClzP3MkzmfWKadHUXhiCH71RmY31X9 S+T0poejEo9+AeyrS993Lu6H/zQ3pL/AAfbvdCz0DKtegoToj+FDvkYbLc/XfkKQscbC WqzQ== 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=HKPErp7rZSpkWUcP0LgFfvzPP76Mbi2AzGUhYUTZh/khWsTOD8EiHzOhCBaBsZzEck dUezzrmK8Gxox6f8pX9pFYlMIuATaTea1bs5cuxyuQ99XEJS91pzE6g9jgA4/rNPZFet PG681ay1P2yBK3cinuLXAxTlP3MucW5A4yko6smLSUhKw6+i68rJNwEG48HqldgkEtoF msi9R9+QOBYvAkvYI1rHnqPkEUJ1br2IWRPZ9JB4VL0zqX8fLC4L3Z5gbb3vOa8sq6Na UZQoNeoleQnld+oU7hA44tfhte4pOnfjJRuThGPBCh91/HPOTJ7v4v5Tfjp4nvRqq+Xy rjhQ== X-Gm-Message-State: ACrzQf1KDHEzGIvgzhy90bQ9t8Oo7eIXMjyTgxizTr9fF2r0HQh5t1CZ su+d3yy+Oqh0nFHNxGXLW0I/m+TeuLvAQA== X-Google-Smtp-Source: AMsMyM682xh7J7Wj8Cw43cFgxn2+yt+i7wbEaSQ7vTW3H11GCJK7bOeZO2JW2I6i0Xs5JQ4q2Zb59A== X-Received: by 2002:a05:6000:18ca:b0:22b:d28:5b96 with SMTP id w10-20020a05600018ca00b0022b0d285b96mr12723689wrq.608.1664191907780; Mon, 26 Sep 2022 04:31:47 -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 x8-20020adfdcc8000000b0022a2dbc80fdsm14064882wrm.10.2022.09.26.04.31.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Sep 2022 04:31:47 -0700 (PDT) From: Bryan O'Donoghue To: myungjoo.ham@samsung.com, cw00.choi@samsung.com Cc: agross@kernel.org, bjorn.andersson@linaro.org, konrad.dybcio@somainline.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, gurus@codeaurora.org, aghayal@codeaurora.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, bryan.odonoghue@linaro.org, Marijn Suijten Subject: [PATCH v4 2/2 RESEND] extcon: qcom-spmi: Switch to platform_get_irq_byname_optional Date: Mon, 26 Sep 2022 12:31:43 +0100 Message-Id: <20220926113143.40768-3-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220926113143.40768-1-bryan.odonoghue@linaro.org> References: <20220926113143.40768-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 Reviewed-by: Marijn Suijten --- 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,