Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp2212890ybt; Mon, 15 Jun 2020 23:16:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxXvap8bINwO1t9l/Udr+0+S5lUkQPPGyUuoinF1WKIPbKb6GForJDtKiVsrQfkShXklm84 X-Received: by 2002:a17:906:6d3:: with SMTP id v19mr1294759ejb.306.1592288187423; Mon, 15 Jun 2020 23:16:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592288187; cv=none; d=google.com; s=arc-20160816; b=fxuxrGGbZ9Jv6r4Dp90SjMTAxhEQBtPwJdvBswx4CIaIPb/yX6+M7v67D3Fq0pPXoU 87/d285gGAjSNvu1KX49YNUPvyzxcgjBUYtCGb0yILnFnUIT8L93ysxBoLTR8/n9adXb /bOsCtg53Lj0RV7yV2thZM52bBPR5fScpeSw8rm2hXw6Fn7arZ+4FEgG1wlt9z5dXywB tCz6mIs8hyF6uUX++KtsPVzvrzsKiKI3uCKwnDpQF0pUzWKigumKF88QZYMV7LFuAh7F +mJCQOlcwfdBMDwqeqaY10i0L2cTuCCdM8D1VJ/vdP/cOYGd193ZgV3cfol2UFglhxkE fF/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=M2uJULnvxDpfHs89lgaTRTB9rey6NHbhAifKB1x72gQ=; b=dMcvQRQYJdwco+MYJQz/wMPhfRpLKZi97GUxBkOyEVJ/9EY7jVzKe9uRHjl+iTE5qM rjybEfcnvK99ler//2+LLZki4F0Z+sydSw5QirQHRmNyPOOXuDnrt3RHJgiKmOmgG8VP EANC62UexazG1vgGCVbjUnEeKeLCUTa6j6wdBKkqbV5OqXvQe33+TNaBFu8AFrdO2Wy4 D6LuahnH8l772edbkkXJ3qdIYErzdN+dniEbJ1sToGficqysPqTk94QycaB+PWB2hlso Zu/NlWVE/qQTQuZXg3EvtxOZqlD3ID0gh4fMZc16+CM/Y18IGt5NNzhXAxxrDf7bjxSH cgGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HS2MKGAs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-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 g25si4049400ejp.240.2020.06.15.23.16.05; Mon, 15 Jun 2020 23:16:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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=HS2MKGAs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-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 S1726398AbgFPGOE (ORCPT + 99 others); Tue, 16 Jun 2020 02:14:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42168 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727111AbgFPGNq (ORCPT ); Tue, 16 Jun 2020 02:13:46 -0400 Received: from mail-pl1-x644.google.com (mail-pl1-x644.google.com [IPv6:2607:f8b0:4864:20::644]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A6335C03E97C for ; Mon, 15 Jun 2020 23:13:46 -0700 (PDT) Received: by mail-pl1-x644.google.com with SMTP id n9so7930325plk.1 for ; Mon, 15 Jun 2020 23:13:46 -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; bh=M2uJULnvxDpfHs89lgaTRTB9rey6NHbhAifKB1x72gQ=; b=HS2MKGAsNdjUxJ+yy27jcpiH1bk7koug2OAXwLJHoTgucSozWnIJSObeAki8dM05am DLCS+qX0P1LSqKwIln1ckxouXz0KbXo3o0tpFiRBYmK+NPiqKE6pDzuqc9M+Woh0UQ59 0qIqzR0HzmFta9njqekXv2RYydZQgrYMTxUNtcLireoA0iUhs07M+xTESQi6DDO/vBQo bSM6fZK5iqdLi0jpB6PQWvFyk1ti/AJVyzKrfiIVqCShGFceJ3mF8PFRVhuFFpNV+gJ8 6/V4j3vwecDwCtqKeIWENohJF3zGujG5GiKGDkkY7rGGOJZOxBk/IL493YOcEiEuhVBI PAjg== 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=M2uJULnvxDpfHs89lgaTRTB9rey6NHbhAifKB1x72gQ=; b=smppFEbuFweV+hoy7Uh8zJMLy10rOQFYJ2Fqmu38HeKllug16uknj19BHCNJKko4Wr w+IsImkf+g873RBcgiU1RL0wJie5huQGEYM6q0ma9lpjNOJoRCMjTG60tDkgBaiNMbNe fEBlCiMrDWADoxujrmutfbgJ/l4QHDR9Zo/yjTzVntCFY4sQOkXbnNyxrL/mKgugQX9r FXLm/JFyobGiLgLxQv308XbNAbPUHp8MSawey9Y2EgRmAfaJMCMAE0Kr9Q1WpjjwBWJm pZrSkyEg41Bpmj0WQuV25hK/L6TlKSzQOMMsHwjwVmv4sGLEuIkPuO3F5cLi1+k5Aw/4 jkag== X-Gm-Message-State: AOAM531O3EyUL9RZg3WnsBa7E9NJOHdyXu/RAYu6YMOiaCPwDxViVMd7 mRRxMHP2kDJ7XyrSvZqZH+vn2q7EOtU= X-Received: by 2002:a17:90b:238d:: with SMTP id mr13mr1308289pjb.19.1592288025969; Mon, 15 Jun 2020 23:13:45 -0700 (PDT) Received: from localhost.localdomain ([2601:1c2:680:1319:692:26ff:feda:3a81]) by smtp.gmail.com with ESMTPSA id i26sm15642032pfo.0.2020.06.15.23.13.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Jun 2020 23:13:45 -0700 (PDT) From: John Stultz To: lkml Cc: John Stultz , Andy Gross , Bjorn Andersson , Joerg Roedel , Thomas Gleixner , Jason Cooper , Marc Zyngier , Linus Walleij , 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: [RFC][PATCH 3/5] irqchip: Allow QCOM_PDC to be loadable as a perment module Date: Tue, 16 Jun 2020 06:13:36 +0000 Message-Id: <20200616061338.109499-4-john.stultz@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200616061338.109499-1-john.stultz@linaro.org> References: <20200616061338.109499-1-john.stultz@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Allows qcom-pdc driver to be loaded as a permenent 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: 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 --- drivers/irqchip/Kconfig | 2 +- drivers/irqchip/qcom-pdc.c | 30 ++++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) 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..98d74160afcd 100644 --- a/drivers/irqchip/qcom-pdc.c +++ b/drivers/irqchip/qcom-pdc.c @@ -11,7 +11,9 @@ #include #include #include +#include #include +#include #include #include #include @@ -430,4 +432,32 @@ 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, + }, +}; +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"); -- 2.17.1