From patchwork Thu Mar 26 22:44:57 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 184935 Delivered-To: patches@linaro.org Received: by 2002:a92:de47:0:0:0:0:0 with SMTP id e7csp616616ilr; Thu, 26 Mar 2020 15:45:04 -0700 (PDT) X-Received: by 2002:a63:5fd8:: with SMTP id t207mr10479230pgb.186.1585262704628; Thu, 26 Mar 2020 15:45:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585262704; cv=none; d=google.com; s=arc-20160816; b=QljQxn4FXPHI/Hi5tx7Eg3bL1wZao76I9OonHXP2pr5KM4EHN1oVaZPYAhUJ7gzUXP zZ2spCpuqu3w2snyCTDc1TPo74dEtWa6HAnRUEtkip0muvMEiHIRWChmtEhM9DBWCO4w sMj6zY9thHhpQIksZHEYEP9R04WRGKrURxY3D8ynGQBTZVS3CONHhN71ADfIUL8cXq2z q+jS2loV+jGYgIDYRw1C5CBR7xn/Q11uEvsUa6VyWDJ0hdnL4H2Zx+8HYIHFu1jkXsm2 Wqkm7IJOPad5WOOUVTIVvo3pTSMZqLCHs9gXWCc6DXQmobcqGHfiGzUTcFDniBWE0hBS PkuA== 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=z3g/2X3xqKE2E6bsoNbDYiNdI89O/pvEeLJlm/o2OpE=; b=cNRc9344gr3vAMFtASGqSIAX+bQF8WrK6Hef7tfZXDDvqOeRFDxYS3kKKC5Zy6u+ev Y2xAfyZYv5kbh55Gu7y5zS5v+5ng+IOFRcULNM1Ir4X2PztmpTlAP02sJAj2F6vAs09s eqzuimLyzNFl3BJmo3aWeRUsBmsb+bC93h80RFRb5nezMBqJUEL99Cl2iXBNGZKppEU6 vXxjeUCqeQ1ahaA1y4XkZ/cMFO3WgRdnYkQ52KilSNqouLyZNoV6LUzmEAZ9sn1GJVQ8 xWtTddiumM0tv7wMKO33qQ1T1HZOTVnMVHkfIWL3VLSVFE9sb/2gFO9znlGLYbmkRU+U S+Zw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Xrz876FM; 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 i62sor4828047pfg.79.2020.03.26.15.45.04 for (Google Transport Security); Thu, 26 Mar 2020 15:45:04 -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=Xrz876FM; 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=z3g/2X3xqKE2E6bsoNbDYiNdI89O/pvEeLJlm/o2OpE=; b=Xrz876FMDozNGuIjV9RUCVbds29I/2Zmat9NHRrib4AsLtTtobMA/SSi7hjLncf2yA lqmiEa+GyH/VnRNlyHRoY6r/ULU9/llEgod1gbjGx7uDvyD7RMdeq+8czV/BMgZPuJcE oNQ0ye+dyQceMh07rv+amQjd810I+l0IR6ncwGE8ffkO0ZRSA/2EULHQOppY53VSu3kM FlkLV6LETgkJt8BiO23uay777rqryr5JLwfYLKGBbEwMzwRAYpoTinIzgoYxUqSHnvfR PJ1cfEsNaVBuKQ2uBTGdjF2QAP0HbfzB+TgJCQp4WT+WZiQjjbXamMlRP2PfzisA2pwu TH7A== 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=z3g/2X3xqKE2E6bsoNbDYiNdI89O/pvEeLJlm/o2OpE=; b=edt/F1tEzhuDU2Nln9F5m7bO61mWZd60CUP+urNtaiCFXpbPO9YFI3etpDPxHzwhaW EGHZ4Rit1fDEdDCdkYxxvLvd5o0fuQ0qJDvHSZ7t4aceELkV2FRwDef5/vHygw5CRupP j0aHTCRyg14nTnwz7yZTmTsZiJxT94hPAf7AyHW5H2qqd43xDKMCljeqrFa9HQVzMMYI 31gz8IwIeyvQLjTqZpjFpWeCwMh/yVbU/RtRA3gHGDTbU2rQKsCk/SeppoihFfM/OnNW Nb9DnUBt57+8VE/O/qAaDiH6Y5nScUUKbwZ2W3m5N592Sc6zq11TBGy4awAYGjy0jSXV E3GQ== X-Gm-Message-State: ANhLgQ3NWs4dx1duXlAGkyMET4yHzDR/8fRaWKA4uZwCIcajfsC9Gand 2CMJg9+8DkkLCYJ5h+7dvYqlblwb X-Google-Smtp-Source: ADFU+vtoCJXf8vwmtr6xsj2U3JR2F9hMCFfeXD53husYpJJuJFDNBaKMd5A71q5bsoMe9Y++eXFZAA== X-Received: by 2002:a62:3086:: with SMTP id w128mr11394896pfw.63.1585262704003; Thu, 26 Mar 2020 15:45:04 -0700 (PDT) Return-Path: Received: from localhost.localdomain ([2601:1c2:680:1319:692:26ff:feda:3a81]) by smtp.gmail.com with ESMTPSA id g10sm2592788pfk.90.2020.03.26.15.45.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2020 15:45:03 -0700 (PDT) From: John Stultz To: lkml Cc: John Stultz , Todd Kjos , Saravana Kannan , Andy Gross , Bjorn Andersson , Rajendra Nayak , linux-arm-msm@vger.kernel.org Subject: [PATCH v3 1/3] soc: qcom: rpmpd: Allow RPMPD driver to be loaded as a module Date: Thu, 26 Mar 2020 22:44:57 +0000 Message-Id: <20200326224459.105170-2-john.stultz@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200326224459.105170-1-john.stultz@linaro.org> References: <20200326224459.105170-1-john.stultz@linaro.org> This patch allow the rpmpd driver to be loaded as a permenent module. Meaning it can be loaded from a module, but then cannot be unloaded. Ideally, it would include a remove hook and related logic, but apparently the genpd code isn't able to track usage and cleaning things up? (See: https://lkml.org/lkml/2019/1/24/38) So making it a permenent module at least improves things slightly over requiring it to be a built in driver. Feedback would be appreciated! Cc: Todd Kjos Cc: Saravana Kannan Cc: Andy Gross Cc: Bjorn Andersson Cc: Rajendra Nayak Cc: linux-arm-msm@vger.kernel.org Acked-by: Saravana Kannan Signed-off-by: John Stultz --- v2: * Fix MODULE_LICENSE to be GPL v2 as suggested by Bjorn * Leave initcall as core_initcall, since that switches to module_initcall only when built as a module, also suggested by Bjorn * Add module tags taken from Rajendra's earlier patch --- drivers/soc/qcom/Kconfig | 4 ++-- drivers/soc/qcom/rpmpd.c | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) -- 2.17.1 diff --git a/drivers/soc/qcom/Kconfig b/drivers/soc/qcom/Kconfig index d0a73e76d563..af774555b9d2 100644 --- a/drivers/soc/qcom/Kconfig +++ b/drivers/soc/qcom/Kconfig @@ -123,8 +123,8 @@ config QCOM_RPMHPD for the voltage rail. config QCOM_RPMPD - bool "Qualcomm RPM Power domain driver" - depends on QCOM_SMD_RPM=y + tristate "Qualcomm RPM Power domain driver" + depends on QCOM_SMD_RPM help QCOM RPM Power domain driver to support power-domains with performance states. The driver communicates a performance state diff --git a/drivers/soc/qcom/rpmpd.c b/drivers/soc/qcom/rpmpd.c index 2b1834c5609a..22fe94c03e79 100644 --- a/drivers/soc/qcom/rpmpd.c +++ b/drivers/soc/qcom/rpmpd.c @@ -5,6 +5,7 @@ #include #include #include +#include #include #include #include @@ -226,6 +227,7 @@ static const struct of_device_id rpmpd_match_table[] = { { .compatible = "qcom,qcs404-rpmpd", .data = &qcs404_desc }, { } }; +MODULE_DEVICE_TABLE(of, rpmpd_match_table); static int rpmpd_send_enable(struct rpmpd *pd, bool enable) { @@ -422,3 +424,7 @@ static int __init rpmpd_init(void) return platform_driver_register(&rpmpd_driver); } core_initcall(rpmpd_init); + +MODULE_DESCRIPTION("Qualcomm Technologies, Inc. RPM Power Domain Driver"); +MODULE_LICENSE("GPL v2"); +MODULE_ALIAS("platform:qcom-rpmpd");