From patchwork Thu Mar 19 19:49:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 184708 Delivered-To: patches@linaro.org Received: by 2002:a92:1f12:0:0:0:0:0 with SMTP id i18csp2381193ile; Thu, 19 Mar 2020 12:49:58 -0700 (PDT) X-Received: by 2002:a17:90b:908:: with SMTP id bo8mr5475335pjb.74.1584647398753; Thu, 19 Mar 2020 12:49:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584647398; cv=none; d=google.com; s=arc-20160816; b=SwSXLzHTmF79xNrp0oVSfst+SIoTSn+JM0k9TI/Y9fr2xH/iDZM2MCjkc88/ddQpUm K/q1n/uxnMSfGBMwh+y1zq4SiBLCh3Bk4Dwto+dIxsvPhFWk1rzDiNZAmOW4KZdwtcg3 0TlZEcQSk/igqpP6TV2kKgYd+IM3Q1YuYVq4OAa1lWx9JPYR42rQWZMBjRH7kwrwEKnM XMWEP36c8u/mmE+hXBaZ/orpTE/S3BG1EiNjzpWGVkXgPtrO3c/zRm8eRmkotEvzxyZZ 8j2hYP/GsgsLcpxK+nTpgZy8w0eOovIYpJLNqjeGLRvuwyntha7ZIFzLQQQNYlETfV2j RvnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:date:subject:cc:to:from:dkim-signature; bh=pYVz/q/oYfSRcEW9kuy6vXjgqJxNH9kUoZVwT624bk4=; b=CChWfOVc4jY4araJgPvZJnfWG0XFj0GFJf6jQUE8qJSMxZwaFWBrVmejYR1oYxsQTq tQAH372VX/dYv/DbjlEVph1nBKDy9J3MoMPcVc78C5Hz0wZz236JxKnADodTJS8PXT7c og41yB4r5xGaSYHcAw7EHojOXFJS3+um4QaSDWkxPpfdPqyRMNXfeVGVBE2XoVRoSqKM kJbOAy9ImzXHvSUw/PA+sSAbNNELBGuq9BKPv6sOS3LFbD25FdE42dQJ6BA3YEqMBrBE +mpT3Hsg0ffgJ1vyC0QeW23VA5Y0Yw+GbwifBbFGdBoRhjrvIQmOw0qVvouiDYmUM9Wi rYdA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=IP+8fN97; 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 i17sor4371537pgn.39.2020.03.19.12.49.58 for (Google Transport Security); Thu, 19 Mar 2020 12:49:58 -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=IP+8fN97; 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; bh=pYVz/q/oYfSRcEW9kuy6vXjgqJxNH9kUoZVwT624bk4=; b=IP+8fN97RRyISsjp13UrNbWub91yoKTrJ+dLi/IFdFwlMeln8RUzPJABNSvRg7oClB 4IDElPtf6Zru/hDRJxfOkImoE/cCiAZrwUfBKSF6Khxu4tws9CFZOSqS02HprXba4v5Q 48YvYNN/O4/8h1zIZB5nBxGah70564rlEWJtLtYlZnO8HFIlLenjL0hobrKL2mA6UvHm dXW0caDwGhwnvupdjGg57HjhXZlrcFEJRemF04YTcrUJeUR++df5K5mrlLj74xZ6mfUJ qMH5/ZPC/KKas94YUIfeh5x436aeTceIo2Two2AZQWmBRISXkbrw4koErmNvEP75UsAy f1Xg== 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; bh=pYVz/q/oYfSRcEW9kuy6vXjgqJxNH9kUoZVwT624bk4=; b=GLq9RD9lJ1KEzeXZljpj++3y1IOl3ytgJenijkKhJkej1EOY+CJiI6VYz24FNu6MFP zC4BKkU7CXZag8/MZ3R49fQXm00hjy7flNpNEvI/s94HhkrOvsWi1Md0AzNPVjjYkr9I uGJnAmE/2h66XBqjzXq+buXdqAjfKY16QrgbUDS+zg8zr+MddjDHgD8sPnyxWTBaTa50 06q2PpItIWWmVF/Z+XjdaiwZSDyNovYWaXW4iKrBhKiFzLfm1i4bD9BaoZFr9+nZf9/H 7d8SOjOxjWEwCak4KZ2hfYrIOMFOQasyY60AFOW0FF1RojdsBHyPhJHzW5U947TRNSbZ gRTQ== X-Gm-Message-State: ANhLgQ3Fzloqb2G/Xj+RijVd33/ENaBlyhq/d55OGK0z99A2La4R3rA0 o/nG8WwFXcG4zI3GCJYU1glTECDZ X-Google-Smtp-Source: ADFU+vvlVU94t5LjsSahudUpZjzSkyz8yES5tDVu4tZoZ6z3hwxUvIzmiDn8xe4iH/duCOlp9e8+ag== X-Received: by 2002:a63:8c51:: with SMTP id q17mr5094662pgn.320.1584647398261; Thu, 19 Mar 2020 12:49:58 -0700 (PDT) Return-Path: Received: from localhost.localdomain ([2601:1c2:680:1319:692:26ff:feda:3a81]) by smtp.gmail.com with ESMTPSA id y28sm2989377pgc.69.2020.03.19.12.49.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Mar 2020 12:49:57 -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 v2] soc: qcom: rpmpd: Allow RPMPD driver to be loaded as a module Date: Thu, 19 Mar 2020 19:49:54 +0000 Message-Id: <20200319194954.39853-1-john.stultz@linaro.org> X-Mailer: git-send-email 2.17.1 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 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");