From mboxrd@z Thu Jan 1 00:00:00 1970 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A7637C433F5 for ; Mon, 4 Oct 2021 23:22:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8D119611C0 for ; Mon, 4 Oct 2021 23:22:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237070AbhJDXYZ (ORCPT ); Mon, 4 Oct 2021 19:24:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33672 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235421AbhJDXYX (ORCPT ); Mon, 4 Oct 2021 19:24:23 -0400 Received: from mail-lf1-x12b.google.com (mail-lf1-x12b.google.com [IPv6:2a00:1450:4864:20::12b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 48AA7C061753 for ; Mon, 4 Oct 2021 16:22:31 -0700 (PDT) Received: by mail-lf1-x12b.google.com with SMTP id b20so78874381lfv.3 for ; Mon, 04 Oct 2021 16:22:31 -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=bZNltq/oZbd2YVOmD/JOyx7+mRWiGRGSHOcZqLxUZ/OJ/a4X0CocMwnce8EI+bA0mr cYHYy3AcbjPmfqwtUgaug7V/ju9Jlk/9B8HiCZ0OGbeszUFlcZhCIoXa3mqrcVScykYK YaAx/nFHhpH8BtNYwHnxEWO+caFmC17qYD3j6jYWpUHPg3/s70fxTFRt6kjbZkhE7sMP iIcWH8IvN64mKUHMHBvLr0lKrpbKfTRuvXcH01R4SxlwYf8QTb3ZvO+pOdIKnJqC8k3U 0n2j4H5iI8LeXUw5XmMco55GxsF8PIYfV0KVCAq7lHwU7HP9yzS9eAV0MQeZlO+TLGtC lfPQ== 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=fV/AGz0gsVKDHwl/b243R9TODT58cq4xH5OyGSU9Jh813B9re4wkCyz0vjxyOmT+g9 z2XL5z742ahnthFS5ldHrsvSxIcp1tbX/7Kp7lHzNfG7nxp8RkBoLNN1GGMOhYL01w5l LZUSyqH2mLIkppbPRcrmCBcX7eE78tVFIKWxP4XXd/w9yXOu36gYjlRU4UHYaaOcO5os 3GHtgIDqd0WI7rei/copGKj02TPERpGwT5lsegGMLGqgLKmu3GwmmTXDVdZF4D/nuWFR aXGzmXhg5jXp45AIzJVmxBC8hBQXX1QMZjozaMEqcUByarUdYeMCDA+rpXpEd6pAahQG R3hg== X-Gm-Message-State: AOAM532SONf1QTtk1kmBBr9zkw1cydkMEQW8E3/uxBoXdpWKJfHNb0g/ Sr/jo7keNcDGwfFxV5B3M7pozA== X-Google-Smtp-Source: ABdhPJxxt4mXCwbIDPVV3zHHXX7p0UanlrXhf5LfoW0gVYJ6xPyx+YnOKRNwY+xifSobFiZQ+JuY+Q== X-Received: by 2002:ac2:4896:: with SMTP id x22mr17609034lfc.257.1633389749636; Mon, 04 Oct 2021 16:22:29 -0700 (PDT) Received: from umbar.lan ([37.153.55.125]) by smtp.gmail.com with ESMTPSA id h23sm1786219lja.131.2021.10.04.16.22.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Oct 2021 16:22:29 -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 3/6] pinctrl: qcom: ssbi-mpp: hardcode IRQ counts Date: Tue, 5 Oct 2021 02:22:22 +0300 Message-Id: <20211004232225.2260665-4-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 Content-Transfer-Encoding: 8bit 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(-) 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) { -- 2.30.2