From patchwork Thu Jun 25 00:10:37 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 191719 Delivered-To: patches@linaro.org Received: by 2002:a92:d244:0:0:0:0:0 with SMTP id v4csp318403ilg; Wed, 24 Jun 2020 17:10:48 -0700 (PDT) X-Received: by 2002:a17:90a:fb94:: with SMTP id cp20mr367363pjb.142.1593043847829; Wed, 24 Jun 2020 17:10:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593043847; cv=none; d=google.com; s=arc-20160816; b=ydnna/V215bBUuxrkSKjrux+NqaT06GWSFgD0RV+EoJ0vIj4XVkHA2j7BpFD5NJ2gy Fe7Wd4Aj46xoHutwWuDKKU+pX5e5xd599WpGX3LMF5M6rfsttj825fsprCm6m0frXL5A 83oUUxaq2NOgJgA9mX/fsIoss4zP/8UW1Snk1dFze1RF1RyXdhZSclGEEC1/tr0yNzfd q6qXe08mGwDBt1+MFZqh84Sz++RPPFpaBeQPZnF7Q3OPq9KvCZZR8zoZRTyq1ewltB21 X/ed8pFE/cHwrde6tCphjvYQ+8gqp52J/WHJ3ZJA6DyECDDdM6SkXoLJeGmkYW/SJzlQ YnOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=1BQGhEnOTLcAnkOD6cOIMtUwarBXYNy82wKDCDvtQ90=; b=HnhFPqcD7ZfoeeGsLe5K63UQDxaC956QDN7JlRsD5gBI2oBBE/ItmwYPExfj00dL2G MDKcWPPLqjBBSs5JyhSakACw7/9YE/lop7RYkKCzYWkVlfM1yyKtWUyoClCkRufKx3Uk vuewadsvZu/iT/2cYig/ZeFRBjasuq3GnZsnLspuW3XT29Xs2fuIm82rahL31g1DJh5z YdJdrJO73McV06OK3iBTMs7C7wNs1cxkDOCaE8JF3gzX5Hn0+aAwX1ePqu6/y973B6bm MBNOJZss/e3U6kuNXeODmr4DBb14s7C9CvlaLn3A4wty4QiFw+czZkaWnZxytRXjGpMB fcqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=iy2r5e1b; spf=pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=john.stultz@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id h18sor12950966plr.14.2020.06.24.17.10.47 for (Google Transport Security); Wed, 24 Jun 2020 17:10:47 -0700 (PDT) Received-SPF: pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=iy2r5e1b; spf=pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=john.stultz@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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; bh=1BQGhEnOTLcAnkOD6cOIMtUwarBXYNy82wKDCDvtQ90=; b=iy2r5e1by3FC0GuBVTzvABwS1sD4L47z2FyOAtuRL5Nw4HSH7OnFvlk/D6A4mFIYFr r89IOmbNP/6C05wgPfM7ACNRmBaRJ/e2ia2g+EIA4Ej5K3IE4c1uBqd90U0mEnbQ2hoO 3VIavoCGYFVVjdBivRpG5i1uf1uEvt2eAEPRzkjB5FNpCjigxCV2y80rpo0qZSFhuWHA mEDDBcY4xInnbBSOa08upCkelmx6fzp7w2DO+Byrtx7O+hcgLnviBGoVmbuusHwQerqo 5XujoVtjN5X3htlhxMhTDYFJ87eeowerl8cx9iCtGDZhU4NNpCkYmSBUCyNIWcoBMWyi HxDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=1BQGhEnOTLcAnkOD6cOIMtUwarBXYNy82wKDCDvtQ90=; b=Ys3W4iTmfEzC5QdVFrNQFMi3iJ3HZaSX8ENhJNdII9F33328iVxYEP5CpdlHNqFhDr KZxVJdM5mGw+EzB4AZYcoZsUnlKR2pxgM/WlPFEL5x8lCZ5xSN4EuEmAcx0fCp5Yi8SS +rDY6TKw4429Y4OE2EpojHxQv6oJaLcGMedDsspR1k9xqdgS1fiqaQXCFgMZhxaVGKxI 6U2U/oxgEWH/ArApijIp5IQlLEJMRjk+Kt/cZVrMGKtCTq9eB/bOBYuwTPmJ18RV8SA2 tvBKSjdTFxckA5nb5ytvvXeIkrhM33QnypMcKLNGZxRYgOJGDqP6boc2Up7M6JWX6bWr lQyA== X-Gm-Message-State: AOAM531XWGFpafj5+vMCtamhrVtRAUADqObRJy4GgiDlIo5gKCv6PXnt hbbpTjkCdKCShK2Gw+N4A+abwlS1 X-Google-Smtp-Source: ABdhPJwDz2x/LmmZ4ChNgREsOBxp8f5ux0cChEqCx9b9fuxljjxzHtStIMBHmJqrHRJUwaMRnpVWew== X-Received: by 2002:a17:902:a585:: with SMTP id az5mr30012995plb.207.1593043847478; Wed, 24 Jun 2020 17:10:47 -0700 (PDT) Return-Path: Received: from localhost.localdomain ([2601:1c2:680:1319:692:26ff:feda:3a81]) by smtp.gmail.com with ESMTPSA id n19sm17458671pgb.0.2020.06.24.17.10.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Jun 2020 17:10:47 -0700 (PDT) From: John Stultz To: lkml Cc: John Stultz , Andy Gross , Bjorn Andersson , Joerg Roedel , Thomas Gleixner , Jason Cooper , Marc Zyngier , Linus Walleij , Maulik Shah , Lina Iyer , Saravana Kannan , Todd Kjos , Greg Kroah-Hartman , linux-arm-msm@vger.kernel.org, iommu@lists.linux-foundation.org, linux-gpio@vger.kernel.org Subject: [PATCH v2 3/5] irqchip: Allow QCOM_PDC to be loadable as a permanent module Date: Thu, 25 Jun 2020 00:10:37 +0000 Message-Id: <20200625001039.56174-4-john.stultz@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200625001039.56174-1-john.stultz@linaro.org> References: <20200625001039.56174-1-john.stultz@linaro.org> Allows qcom-pdc driver to be loaded as a permanent module Also, due to the fact that IRQCHIP_DECLARE becomes a no-op when building as a module, we have to add the platform driver hooks explicitly. Thanks to Saravana for his help on pointing out the IRQCHIP_DECLARE issue and guidance on a solution. Cc: Andy Gross Cc: Bjorn Andersson Cc: Joerg Roedel Cc: Thomas Gleixner Cc: Jason Cooper Cc: Marc Zyngier Cc: Linus Walleij Cc: Maulik Shah Cc: Lina Iyer Cc: Saravana Kannan Cc: Todd Kjos Cc: Greg Kroah-Hartman Cc: linux-arm-msm@vger.kernel.org Cc: iommu@lists.linux-foundation.org Cc: linux-gpio@vger.kernel.org Signed-off-by: John Stultz --- v2: Fix spelling, include order and set suppress_bind_attrs suggested by Maulik Shah --- drivers/irqchip/Kconfig | 2 +- drivers/irqchip/qcom-pdc.c | 31 +++++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) -- 2.17.1 diff --git a/drivers/irqchip/Kconfig b/drivers/irqchip/Kconfig index 29fead208cad..12765bed08f9 100644 --- a/drivers/irqchip/Kconfig +++ b/drivers/irqchip/Kconfig @@ -425,7 +425,7 @@ config GOLDFISH_PIC for Goldfish based virtual platforms. config QCOM_PDC - bool "QCOM PDC" + tristate "QCOM PDC" depends on ARCH_QCOM select IRQ_DOMAIN_HIERARCHY help diff --git a/drivers/irqchip/qcom-pdc.c b/drivers/irqchip/qcom-pdc.c index 6ae9e1f0819d..3fee8b655da1 100644 --- a/drivers/irqchip/qcom-pdc.c +++ b/drivers/irqchip/qcom-pdc.c @@ -11,9 +11,11 @@ #include #include #include +#include #include #include #include +#include #include #include #include @@ -430,4 +432,33 @@ static int qcom_pdc_init(struct device_node *node, struct device_node *parent) return ret; } +#ifdef MODULE +static int qcom_pdc_probe(struct platform_device *pdev) +{ + struct device_node *np = pdev->dev.of_node; + struct device_node *parent = of_irq_find_parent(np); + + return qcom_pdc_init(np, parent); +} + +static const struct of_device_id qcom_pdc_match_table[] = { + { .compatible = "qcom,pdc" }, + {} +}; +MODULE_DEVICE_TABLE(of, qcom_pdc_match_table); + +static struct platform_driver qcom_pdc_driver = { + .probe = qcom_pdc_probe, + .driver = { + .name = "qcom-pdc", + .of_match_table = qcom_pdc_match_table, + .suppress_bind_attrs = true, + }, +}; +module_platform_driver(qcom_pdc_driver); +#else IRQCHIP_DECLARE(qcom_pdc, "qcom,pdc", qcom_pdc_init); +#endif + +MODULE_DESCRIPTION("Qualcomm Technologies, Inc. Power Domain Controller"); +MODULE_LICENSE("GPL v2");