drm/nouveau/clk: allow users to enable auto mode when loading driver
authorVince Hsu <vinceh@nvidia.com>
Mon, 22 Dec 2014 09:11:40 +0000 (17:11 +0800)
committerBen Skeggs <bskeggs@redhat.com>
Thu, 22 Jan 2015 02:15:05 +0000 (12:15 +1000)
This patch adds one option for the boot config strings "NvClkMode*", so
that we can enable the "auto" mode when loading module.

Signed-off-by: Vince Hsu <vinceh@nvidia.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/core/subdev/clock/base.c

index b1bbe764fa35ca7d05693cdcf6eeebf3a7c4358c..bc095b4701213dbbbe589be831da132e70c81aa3 100644 (file)
@@ -401,6 +401,9 @@ nouveau_clock_nstate(struct nouveau_clock *clk, const char *mode, int arglen)
 {
        int ret = 1;
 
+       if (clk->allow_reclock && !strncasecmpz(mode, "auto", arglen))
+               return -2;
+
        if (strncasecmpz(mode, "disabled", arglen)) {
                char save = mode[arglen];
                long v;