From patchwork Fri Oct 8 01:25:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 515548 Delivered-To: patch@linaro.org Received: by 2002:ac0:b5cc:0:0:0:0:0 with SMTP id x12csp1676071ime; Thu, 7 Oct 2021 18:27:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzfLIzsCSez2SHKy88hdhCgufCAp1021UiR0u2U7zqOX9WYEULvECdDKpKDwrqpHZdw2NbA X-Received: by 2002:a63:e756:: with SMTP id j22mr2281394pgk.362.1633656349411; Thu, 07 Oct 2021 18:25:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633656349; cv=none; d=google.com; s=arc-20160816; b=S4hYQsWV98n7Rybhb7srtQhFpytnet/gSTspp5IFqCT22RrIVscf2o5Df8hP6DwzMN A8DQ8+f4ZeE0TyUyp9FyELHi99sf+bC2+0P/NveZzzH/atp8YCuVdRB70Lhg9XoKkuf6 R0rbmI+WoxVPv40dj5eXJRUm+nKmT8ulxDzXDUlmavfQQf3WSUnzLibLkGGMCNGT7R7P e78mIOfLz9eKq4W/WAU2xFpNhvca/l6NkhonZHSpRrEUpUkmr/WbiDaO9HBjnQO0IeWK rrq4eZwkuXTsURD8pTbAl50WdkK7P+uShNgM1GG76f6VtVCmY2ZSe92yBwzsC3c8Id2J VMtg== 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=B1tfgMXD/HCZM2/dbxQ/czHnewIDG6QY34tUjSKvwfk=; b=P+U+fHWdZFVV0XCDZJBL48vjSq6ffe7LHz0NLsbofWR0rIyGzwyS10ykrBEqsegyLN lSMYI4rY2g47rmA3p/rZluS8nZRIvPMiUBiRxn9864Co0j2eYFFC6j7FwX0BAItjkGn7 L/zUzdAP9FhYnogIlSuZjK1MzcRejD+xRJRL6DgzLii45KXTE5TbINtyX0FHSq8kojd6 6cb61bfNuiCrtT9/YBqXeOVSVgx7ZiQ4PoYcnRKfgIykugE2SbQTJIjhs+d5Y61H+0io LHL68AeYA4S9bRUXbinbbBTr4Xb/DIS5WzVkR89YeDxaFP3rITELlVtY836vXzv7ZLkA FMOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HREMM7Yv; 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.48; Thu, 07 Oct 2021 18:25:49 -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=HREMM7Yv; 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 S241532AbhJHB1m (ORCPT + 7 others); Thu, 7 Oct 2021 21:27:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38874 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234356AbhJHB1d (ORCPT ); Thu, 7 Oct 2021 21:27:33 -0400 Received: from mail-lf1-x12d.google.com (mail-lf1-x12d.google.com [IPv6:2a00:1450:4864:20::12d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3DAF1C061714 for ; Thu, 7 Oct 2021 18:25:38 -0700 (PDT) Received: by mail-lf1-x12d.google.com with SMTP id m3so32596150lfu.2 for ; Thu, 07 Oct 2021 18:25:38 -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=B1tfgMXD/HCZM2/dbxQ/czHnewIDG6QY34tUjSKvwfk=; b=HREMM7YvdSBGH5yCfeBE1GD/MG6qFX3jZvB/hGwR7HZ7db3jFWbR6EjuTL16AfB5UQ koYroB34dm/ZoDXxlxZVaIHC4zdDpnu6Vy7uRPrWOm4t2C6XxRFlKNFN4bTUuSTVTNQY vWACLWBR1Dx5Fz8akQdBCY0VkhkjI8/HeGv+6PNn0pwg170Zq0EUF59oUw3iZN0/fLHe czilOud48xH7CG4PmSkcxH9wRtV9Z1XSRrA24s+ddMsvShtrB0qTXgf9QcU0USltGVH/ 1Do+dge+n5Hnn6CI7GkrIBwFtvS0ZZ7AmfQJzIjXrhHvobw1K1U5m8Eo4xvBONkk8TOi wjZA== 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=B1tfgMXD/HCZM2/dbxQ/czHnewIDG6QY34tUjSKvwfk=; b=aVrBtcUmJrCSykQT4UtNXE9zBUV32OZlCWgSct11SV6FxXIgTdwxQT0ChhZUqISMPQ LZ9ftZf5g1k2By1TwFEKLVWWcFZuuDv5dJfdW8JdZ5ZygVPJ1b+7Xwp+spDQL/YcmHl2 BCAHj6oczBVYxCK/DPg7p41LB6iU9DBLcRCG6uUw7VPAneFKuhV9pwDMv5SP+1sPQuiO 5JkdwHMx9jN30NF+Jw/t1aS11TEahqRX7FFD7Qxs9LrxrjppKaW2UxnNrcGTgRMUypOr vEWCTJlAhJDzyw1FmT5Us+iyx8Vp81QjEs403mJLpKtzmMgbqTWS6Obqx/Ya5xY2sgc3 s5pQ== X-Gm-Message-State: AOAM531Mo4ZW368FaJhHNg9Ypk9226dpotTu4gQ//s7q+X7dybnniMzi 2bF+Jn7zAhCHfeV3eAy+tblAgg== X-Received: by 2002:a05:6512:96f:: with SMTP id v15mr7510057lft.455.1633656336652; Thu, 07 Oct 2021 18:25:36 -0700 (PDT) Received: from umbar.lan ([37.153.55.125]) by smtp.gmail.com with ESMTPSA id s4sm112875ljp.115.2021.10.07.18.25.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Oct 2021 18:25:36 -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 13/25] pinctrl: qcom: ssbi-mpp: hardcode IRQ counts Date: Fri, 8 Oct 2021 04:25:12 +0300 Message-Id: <20211008012524.481877-14-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,ssbi-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-ssbi-mpp.c | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) -- 2.30.2 diff --git a/drivers/pinctrl/qcom/pinctrl-ssbi-mpp.c b/drivers/pinctrl/qcom/pinctrl-ssbi-mpp.c index 92e7f2602847..a90cada1d657 100644 --- a/drivers/pinctrl/qcom/pinctrl-ssbi-mpp.c +++ b/drivers/pinctrl/qcom/pinctrl-ssbi-mpp.c @@ -733,13 +733,12 @@ static int pm8xxx_pin_populate(struct pm8xxx_mpp *pctrl, } static const struct of_device_id pm8xxx_mpp_of_match[] = { - { .compatible = "qcom,pm8018-mpp" }, - { .compatible = "qcom,pm8038-mpp" }, - { .compatible = "qcom,pm8058-mpp" }, - { .compatible = "qcom,pm8917-mpp" }, - { .compatible = "qcom,pm8821-mpp" }, - { .compatible = "qcom,pm8921-mpp" }, - { .compatible = "qcom,ssbi-mpp" }, + { .compatible = "qcom,pm8018-mpp", .data = (void *) 6 }, + { .compatible = "qcom,pm8038-mpp", .data = (void *) 6 }, + { .compatible = "qcom,pm8058-mpp", .data = (void *) 12 }, + { .compatible = "qcom,pm8821-mpp", .data = (void *) 4 }, + { .compatible = "qcom,pm8917-mpp", .data = (void *) 10 }, + { .compatible = "qcom,pm8921-mpp", .data = (void *) 12 }, { }, }; MODULE_DEVICE_TABLE(of, pm8xxx_mpp_of_match); @@ -750,19 +749,14 @@ static int pm8xxx_mpp_probe(struct platform_device *pdev) struct pinctrl_pin_desc *pins; struct pm8xxx_mpp *pctrl; int ret; - int i, npins; + int i; pctrl = devm_kzalloc(&pdev->dev, sizeof(*pctrl), GFP_KERNEL); if (!pctrl) return -ENOMEM; pctrl->dev = &pdev->dev; - npins = platform_irq_count(pdev); - if (!npins) - return -EINVAL; - if (npins < 0) - return npins; - pctrl->npins = npins; + pctrl->npins = (uintptr_t) device_get_match_data(&pdev->dev); pctrl->regmap = dev_get_regmap(pdev->dev.parent, NULL); if (!pctrl->regmap) {