From patchwork Fri Oct 8 01:25:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 515539 Delivered-To: patch@linaro.org Received: by 2002:ac0:b5cc:0:0:0:0:0 with SMTP id x12csp1675291ime; Thu, 7 Oct 2021 18:25:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyv81qAUUFY60naKpTRuNqhApDa0eRqcd6SWeyRB4X6ZfhkclP3FWrcbubR/ngI63gGSqCb X-Received: by 2002:a63:5f0d:: with SMTP id t13mr2378813pgb.22.1633656351904; Thu, 07 Oct 2021 18:25:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633656351; cv=none; d=google.com; s=arc-20160816; b=LkwrYyMyr5GmZo8gpzkBtfqovQrjGHIt6pCyjwOwzuNRZ7jIc8/ZPZornMZDbrJcy/ 12+FvIC4TjsX4iEG9JiGdKhi3XvqSb+d1vZB2cVpL+WeidJNkFR5F5oGApUozvuveHVK 9CRUiVj4naaxnvB7WaZeSRqiQgHy2p+zmq2sDIVMHRWl/sKA0hXq57papT2+ghhyFFQM 9DTOSY2BlW2MCOPCzzHGewaRgdqHRaXt7mdZ17X4NAX97pONZCuKu55vN8LRiMU312qk bVD8kIfdmOTEnbIpjIwzt1VuncNKR3EYiN1rSJaY6STc5OFO9kZj4YLkqW8UJiw5KK0+ kuqA== 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=IM0JlrJ1v+D9/jvxwF29+gSNn83UxhR1/j3VyaAFbim+9e38BKsvO4YFqVX04yMfHF uufJwxaEecbOMsEJufHMPWjYIYd0cABJTxstBnVoLZbRKVXz4phDA9x5WPWWmdF4kvy6 PxcSQMOevhyy4aUzOOrd2s1JH0W0U3n6tsKA7d+RxEEeWpRYWNQe2/IXgOfnCfdv99dR 3PLsSUM3UWHkUelMHn9gMQXdwHc+Gh0QwdiQ3r5XLe81v/1OfKQ45iqBGhx2zKTIG/dB 2I/5w9nAQj5yfwDjFNg5ISmwQP4b6OF4O7r99eQW1F81OQif5L2d6NZI2CXqDKeIuGEK Cmhg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=oDA2++oc; spf=pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-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 h7si1158223pgq.411.2021.10.07.18.25.51; Thu, 07 Oct 2021 18:25:51 -0700 (PDT) Received-SPF: pass (google.com: domain of devicetree-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=oDA2++oc; spf=pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-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 S238149AbhJHB1n (ORCPT + 7 others); Thu, 7 Oct 2021 21:27:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38934 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241270AbhJHB1e (ORCPT ); Thu, 7 Oct 2021 21:27:34 -0400 Received: from mail-lf1-x12c.google.com (mail-lf1-x12c.google.com [IPv6:2a00:1450:4864:20::12c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 81153C061768 for ; Thu, 7 Oct 2021 18:25:39 -0700 (PDT) Received: by mail-lf1-x12c.google.com with SMTP id x27so32285403lfa.9 for ; Thu, 07 Oct 2021 18:25:39 -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=oDA2++ocrLRqzpjQmU/xREOSMUf+3SK/Uz4PJIawPvLPy+KzpchgT6en08Uu7Mprh5 DGB1FPYYs1XiI8nmVRQJw7rIvS4rLymDnBQpEVl5FG2c3w4aWRer8j60QTHQxZfwoA0M MuC5M/pGdo0LYwV7SZzp9SmX+P1mc0+IcrhTuYAM+wPV2eeMiQHdM7IKBUiNa4kiW0Ii gqkw3YKeq1w+S2s2ucL4ELl+3iZFZYK24AoBTMUpUmgr+YBzktzRPEVnaLFKaTIuogFX CYM46PrI/FRXguKrfClvXqOOuVItxUbgWggDrhxvH4tZTz4xlm8UUk1TOEdpRwz9BDbO Ab/Q== 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=GYozpyyM2TPK7sL8ee5v5mhSlfL5018qTNoPk/+LzRKzXVfUA8rnZPpfX1J2p13HBu 5D7xSjXGtBtZ3l+DyphUaraRBXVYnQSvCGWsTcB6oOpu0f0D2UKaBav8T5+kzfGfPPD5 OgQKFWrTWKRf+hIcxj0RDL7Olw3IzDO9UtVK3VL6zbaGdKE/YjgxM6pn17tZ53JfE0i2 h5t1gcIjMJns/QE20wsOMwrxLKGgVHvW7SNJ7E+iG0VMijeBFgPJ73HB9q27UBFI6qrN 2KXFfJe2ZsxTy1/s1klatV4P6pPNIyYh/BBX8h9QSkVQNB13bztEY5zi+xwVNMIidGmW YGCQ== X-Gm-Message-State: AOAM531qJJdgh+GDP5b1nPs/VV+a3S9tvklnSY+DYoT07Dvh/5DeXZWB 2J3TTt35XEq9ddeOUpM29NOkcw== X-Received: by 2002:ac2:51cb:: with SMTP id u11mr7291691lfm.139.1633656337950; Thu, 07 Oct 2021 18:25:37 -0700 (PDT) Received: from umbar.lan ([37.153.55.125]) by smtp.gmail.com with ESMTPSA id s4sm112875ljp.115.2021.10.07.18.25.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Oct 2021 18:25:37 -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 v3 15/25] pinctrl: qcom: spmi-mpp: hardcode IRQ counts Date: Fri, 8 Oct 2021 04:25:14 +0300 Message-Id: <20211008012524.481877-16-dmitry.baryshkov@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211008012524.481877-1-dmitry.baryshkov@linaro.org> References: <20211008012524.481877-1-dmitry.baryshkov@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@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 }, { }, };