From patchwork Mon Oct 4 23:22:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 515217 Delivered-To: patch@linaro.org Received: by 2002:adf:fbc8:0:0:0:0:0 with SMTP id d8csp4818321wrs; Mon, 4 Oct 2021 16:22:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzeh7irlb/90b8RyHRS/tnFenoJlRs8rl5jtIZApsnrPnijZGPH9mjJHXaqVIZxcMoIGxfB X-Received: by 2002:a17:90b:4ac1:: with SMTP id mh1mr39882960pjb.238.1633389758553; Mon, 04 Oct 2021 16:22:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633389758; cv=none; d=google.com; s=arc-20160816; b=ojsm8DOeKalcLRucyolBe3RxoB2ByKNct/j0414+cfGRr6zgjdAtYl/QWqF5iAQZ+K 4n3rwXMnPxlwLVrnAicAWCT6vmbmXRqOs+zEEb4AJdYhExqrY6pmncl8pP0+hpoObMfa MOX4gdoA26DrkQh26mVcwjwsuSqgo8t6WxqjwmrTA2rGjYnusZq0AV5pTlyfyFQFD3NQ p6oqkFXO/MXil+GZ0zItbTLAq1CHrlP34WPbyT868PseBvkiS8vGVDI46fENCu2dDFJi rjYI8Bq/8EmuKkGCpWR3dUpa3nSQrhHksHl4ValbeapajjLSvMXTCgyKgS1ioKajffho XnCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=fSoTwIybzpP2ja1UE0gJTnY+M6QRSJ7ijJBeYL79794=; b=vfiTZA6zmi6Mf0B0pv+VDJZnXyY11MDa8XCkw7O+B2UQ9/8fWw3jiISACSRZCTCEVA 5iBmHXSGNyCA/exq8Lm5vpF+1/UfOdjk5PF99keu9spUwda4AvNdb86Zekg2CfXuDmR6 FLCsH0/w7C86TF9aZyFY0iylLRbPJCk7xABhZYyXtacIhKX3r1arMENhjX2NFOhCAXoa JpiQx8RpICHZfD3c5z/p+7CC2hTVuRsWsHEqmv3OjD58yPqI0hHu4XjY/qfoWCFZDXAX QjvFi+awE7ewS+wB/zZ6oFEWdzlhJH4LkdOjrdlZGt34Mj/DXKQdVeOHPyTtiRVsYt+8 gU3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Ae1WSuuk; spf=pass (google.com: domain of linux-gpio-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-gpio-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r15si26921829pjj.71.2021.10.04.16.22.38; Mon, 04 Oct 2021 16:22:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-gpio-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Ae1WSuuk; spf=pass (google.com: domain of linux-gpio-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-gpio-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235421AbhJDXYZ (ORCPT + 3 others); Mon, 4 Oct 2021 19:24:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33680 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237029AbhJDXYY (ORCPT ); Mon, 4 Oct 2021 19:24:24 -0400 Received: from mail-lf1-x12e.google.com (mail-lf1-x12e.google.com [IPv6:2a00:1450:4864:20::12e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 947FCC061767 for ; Mon, 4 Oct 2021 16:22:32 -0700 (PDT) Received: by mail-lf1-x12e.google.com with SMTP id n8so22591388lfk.6 for ; Mon, 04 Oct 2021 16:22:32 -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=fSoTwIybzpP2ja1UE0gJTnY+M6QRSJ7ijJBeYL79794=; b=Ae1WSuukxg4h733uCGW7Okza8bs4gUBceaq/6+pGiZ71a1WN4m1B3msi4Ni5jbz/n9 MN/9aubugtLhrM4Nz9w5m9D5r6+NE9Hd2jn4yPC82IuX8MYSCQyt4iMAKKcrZAZs824U y2ztkOJHKc603+8ousBzylI+FQSxH8K2vEsIuekDxxF//g7a+nDfLDkdsOcTwwkrfakS ldWkmymYB4s0IKIL7tWpyVvXzGGaoKrstVaPy4TG43sLFtAvSglHp3AB9y8dR3AE004J lTcLPEilhXsN5lwt6QOT5WUWf2wN1luNYd3/InUx73wpBl2Lykx9qJ+7WY5XJ6X+slsd EAOA== 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=fSoTwIybzpP2ja1UE0gJTnY+M6QRSJ7ijJBeYL79794=; b=zqfU6T3333A/0RtRhBH5gbRxSbdR806RxAdchPG7h3mfs4JTfNtnvVW+ydO47HBzTq behNYImB1A5Azry5FAr3tq7rXYHL3KFr8xmW1Fc9G/YGA2c7iIr2EWx6QdreIqsRueCG 7P7KL8gVlmBFSfvUa6LeDbkYN1LBTtBR2A98S23TOmlBmxYVTsMpiVN+ijAtFIRKl2mD ucX26mRbaEagI3mALBuCqZtIJdQ+h9BsLEEdS9zKrv0oRbD/GqZlSmA99DzxpdW/QuCY KDofT6P3tyv2gmJ41lmRTeis+gn9/fqf0hDIv1J9hRWglC2Kdimhe6JgJlpvX7Ia2zVm RXZA== X-Gm-Message-State: AOAM530Pe+f+Cm/sYT6N0Az5YTeJzzB5QkM0h067FHtbC8Sdy+0Dv6GY QS0sK5DyoUIVFsu2WjUgXZtW9g== X-Received: by 2002:a2e:8603:: with SMTP id a3mr19178645lji.142.1633389750937; Mon, 04 Oct 2021 16:22:30 -0700 (PDT) Received: from umbar.lan ([37.153.55.125]) by smtp.gmail.com with ESMTPSA id h23sm1786219lja.131.2021.10.04.16.22.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Oct 2021 16:22:30 -0700 (PDT) From: Dmitry Baryshkov To: Andy Gross , Bjorn Andersson , Linus Walleij , Rob Herring Cc: linux-gpio@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-msm@vger.kernel.org Subject: [PATCH 5/6] pinctrl: qcom: spmi-mpp: hardcode IRQ counts Date: Tue, 5 Oct 2021 02:22:24 +0300 Message-Id: <20211004232225.2260665-6-dmitry.baryshkov@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211004232225.2260665-1-dmitry.baryshkov@linaro.org> References: <20211004232225.2260665-1-dmitry.baryshkov@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org The probing of this driver calls platform_irq_count, which will setup all of the IRQs that are configured in device tree. In preparation for converting this driver to be a hierarchical IRQ chip, hardcode the IRQ count based on the hardware type so that all the IRQs are not configured immediately and are configured on an as-needed basis later in the boot process. This change will also allow for the removal of the interrupts property later in this patch series once the hierarchical IRQ chip support is in. This patch also removes the generic qcom,spmi-mpp OF match since we don't know the number of pins. All of the existing upstream bindings already include the more-specific binding. Signed-off-by: Dmitry Baryshkov --- drivers/pinctrl/qcom/pinctrl-spmi-mpp.c | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) -- 2.30.2 diff --git a/drivers/pinctrl/qcom/pinctrl-spmi-mpp.c b/drivers/pinctrl/qcom/pinctrl-spmi-mpp.c index 2da9b5f68f3f..a9f994863126 100644 --- a/drivers/pinctrl/qcom/pinctrl-spmi-mpp.c +++ b/drivers/pinctrl/qcom/pinctrl-spmi-mpp.c @@ -812,11 +812,7 @@ static int pmic_mpp_probe(struct platform_device *pdev) return ret; } - npins = platform_irq_count(pdev); - if (!npins) - return -EINVAL; - if (npins < 0) - return npins; + npins = (uintptr_t) device_get_match_data(&pdev->dev); BUG_ON(npins > ARRAY_SIZE(pmic_mpp_groups)); @@ -912,16 +908,15 @@ static int pmic_mpp_remove(struct platform_device *pdev) } static const struct of_device_id pmic_mpp_of_match[] = { - { .compatible = "qcom,pm8019-mpp" }, /* 6 MPP's */ - { .compatible = "qcom,pm8841-mpp" }, /* 4 MPP's */ - { .compatible = "qcom,pm8916-mpp" }, /* 4 MPP's */ - { .compatible = "qcom,pm8941-mpp" }, /* 8 MPP's */ - { .compatible = "qcom,pm8950-mpp" }, /* 4 MPP's */ - { .compatible = "qcom,pmi8950-mpp" }, /* 4 MPP's */ - { .compatible = "qcom,pm8994-mpp" }, /* 8 MPP's */ - { .compatible = "qcom,pma8084-mpp" }, /* 8 MPP's */ - { .compatible = "qcom,pmi8994-mpp" }, /* 4 MPP's */ - { .compatible = "qcom,spmi-mpp" }, /* Generic */ + { .compatible = "qcom,pm8019-mpp", .data = (void *) 6 }, + { .compatible = "qcom,pm8841-mpp", .data = (void *) 4 }, + { .compatible = "qcom,pm8916-mpp", .data = (void *) 4 }, + { .compatible = "qcom,pm8941-mpp", .data = (void *) 8 }, + { .compatible = "qcom,pm8950-mpp", .data = (void *) 4 }, + { .compatible = "qcom,pmi8950-mpp", .data = (void *) 4 }, + { .compatible = "qcom,pm8994-mpp", .data = (void *) 8 }, + { .compatible = "qcom,pma8084-mpp", .data = (void *) 8 }, + { .compatible = "qcom,pmi8994-mpp", .data = (void *) 4 }, { }, };