From patchwork Fri May 18 20:06:32 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Osipenko X-Patchwork-Id: 916583 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-tegra-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="H26r09eM"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 40nfRM0sdbz9s4V for ; Sat, 19 May 2018 06:10:07 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752337AbeERUHX (ORCPT ); Fri, 18 May 2018 16:07:23 -0400 Received: from mail-lf0-f67.google.com ([209.85.215.67]:34318 "EHLO mail-lf0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752231AbeERUHT (ORCPT ); Fri, 18 May 2018 16:07:19 -0400 Received: by mail-lf0-f67.google.com with SMTP id x145-v6so3656007lff.1; Fri, 18 May 2018 13:07:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=uhm8slZn/deSw/XDysMgM+vedWMBWO+VQAee2tzzL1w=; b=H26r09eMssc3ilxubEY4FLac09+Kwd2NZnL6U1l44kWgAm9WQb4YJlxm+OmREXUHLf i6QlncYjNyrqEGABLc9kECTxGQptNmDsUulZlueRA1h/LUjsf/Q85z5Y5Vz5jzwu8nBK zm77rYKT6cGdjgrui6LB3hyAeUavGlKv+oFCuwdiHWM62PuhZJ7UQXSJ54btWsidElb6 NAhx36GQjsRVEbhFKFjbwT83d+UgqvLQDHF9B0UY8qWlPWiVbbI2YLTS6fGupLT6PQl0 dic+xDSH+xknkXIq1QE1XotxisAMg5mCSdJeZZw45hQFAp9/jl64VnnMLW6zGJsYu6Q4 WZdw== 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=uhm8slZn/deSw/XDysMgM+vedWMBWO+VQAee2tzzL1w=; b=CD645EW8RDGid5ZawH8PJfLgwWqi0Gw2W9EGyYJNF3YAXj4rwbntyhAkyU+IlzFRDT MJBvvxi/sKgkhSAfyi4oz8FxkPFhPZ8ApZILAuLJIydOaNi79qcK+YBE8mAp9LMmcG7d gwU8pjbBwM1klFYqWiTw6iStw8XdTEtD414AgtYVWave7JiEgRbOmIu5K2mE0afkJTc2 An5nj7UUCNls5o+mKK1QaYWLHabvZR1waP9rS6euMXnL4Pl+Mb6urpjEWMpnZPuTCqdc u1kPWu+SiLyn/SPHwOHCDXb+oWrvkXi9gzRTVk1QWYr1VSfdogPqBsJ4z13kD6r5ikoQ kyaQ== X-Gm-Message-State: ALKqPwdpl2B2iyonFp3/8P/4Dl2QXUEVw5t9A6NbDMKmnRQnu6kOpVUl XGnN8o1PEqFC3J/ctFGlGew= X-Google-Smtp-Source: AB8JxZoUTF0qJ0Xex1nNz+5nFEuic36q9e/Gr/+tcK5v4ipUUwTGD42RssihYePT+dSHEdQWtePmAw== X-Received: by 2002:a19:cfc8:: with SMTP id f191-v6mr20752628lfg.92.1526674037441; Fri, 18 May 2018 13:07:17 -0700 (PDT) Received: from localhost.localdomain ([109.252.91.60]) by smtp.gmail.com with ESMTPSA id z132-v6sm2026987lfd.45.2018.05.18.13.07.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 18 May 2018 13:07:16 -0700 (PDT) From: Dmitry Osipenko To: "Rafael J. Wysocki" , Viresh Kumar , Thierry Reding , Jonathan Hunter Cc: linux-tegra@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Peter Geis Subject: [PATCH v2 01/11] cpufreq: tegra20: Change module description Date: Fri, 18 May 2018 23:06:32 +0300 Message-Id: <20180518200642.24815-2-digetx@gmail.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180518200642.24815-1-digetx@gmail.com> References: <20180518200642.24815-1-digetx@gmail.com> Sender: linux-tegra-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-tegra@vger.kernel.org Change module description to be in line with the other Tegra drivers, just for consistency. Signed-off-by: Dmitry Osipenko Acked-by: Viresh Kumar Acked-by: Thierry Reding --- drivers/cpufreq/tegra20-cpufreq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/cpufreq/tegra20-cpufreq.c b/drivers/cpufreq/tegra20-cpufreq.c index 2bd62845e9d5..10793498355e 100644 --- a/drivers/cpufreq/tegra20-cpufreq.c +++ b/drivers/cpufreq/tegra20-cpufreq.c @@ -210,7 +210,7 @@ static void __exit tegra_cpufreq_exit(void) MODULE_AUTHOR("Colin Cross "); -MODULE_DESCRIPTION("cpufreq driver for Nvidia Tegra2"); +MODULE_DESCRIPTION("NVIDIA Tegra20 cpufreq driver"); MODULE_LICENSE("GPL"); module_init(tegra_cpufreq_init); module_exit(tegra_cpufreq_exit); From patchwork Fri May 18 20:06:33 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Osipenko X-Patchwork-Id: 916584 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-tegra-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="i6AMFqZX"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 40nfRt6HrZz9s2k for ; Sat, 19 May 2018 06:10:34 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752535AbeERUKc (ORCPT ); Fri, 18 May 2018 16:10:32 -0400 Received: from mail-lf0-f68.google.com ([209.85.215.68]:35550 "EHLO mail-lf0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752234AbeERUHU (ORCPT ); Fri, 18 May 2018 16:07:20 -0400 Received: by mail-lf0-f68.google.com with SMTP id y72-v6so15692443lfd.2; Fri, 18 May 2018 13:07:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=0kXbxi/Bk+Gg1f+88Py/+77I9csMl4791Dw6gZgt+jo=; b=i6AMFqZXs7bzQkQhJJGQFeltDagAPYTtjiCyfe8hGmPdMutV3T1F0aY9zwzyJ5F2Ww FWp0DJIH7f2xgsyOQxf6+zCiiqXlXxda8rnYiuoJMOa75kdKIDgrpogQZy7YS6UL2Y52 tdps/yLruYm7rbMDKiuEDh2NCW3kYhUTAZ1Zw3MuQxgADEPdGLWZ0isJRT2WpGlhd27x MLR4QqAxzRKpTBi7uCagZDDu0s3j/AtL3bkOhZrOS+k8ucHjCJPRkGMA6zIn+KwtlGqW texmqHHFZ6pis+bjsEX2OdHmSfarxxVrQEb3I6cVODNWiEH8mhdQqkwPTmA9aCtW6cM5 fuCQ== 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=0kXbxi/Bk+Gg1f+88Py/+77I9csMl4791Dw6gZgt+jo=; b=js55VEPPeEUJFDg0x4CidP14kkTtqusV4Ko5EUDR7VTIArOT208m5ug7NhTlyEn/rZ X/f7LiN7JgVGNvBWWUjpRDGE+O6628ToxOaySfU8WxEE98xEpmHIZhdpAXmi9Z9d2ndN 5OZO5195D9JEuMiy+2ShLEGWJGOFM0/Y90NA8bA60or5jFkzQwDeIJzfupePCdLgq+d9 QddSeiMVisMZpHkzkGMM57x/n1RMrnlUZW6j8Rz0fQrxA0QJPpYQ9kjaUmbiShkBkHYS BYJI9D/7Nxjgunwt4AF3TeYjYmNleNC4bzl699U3jRa61BI/znlczatXinQPpzNqcp6Z fulQ== X-Gm-Message-State: ALKqPwck0+D395MnF+7j2vsVuohIPcsqo1ZAnw/gQYEeONURSMdCJmMj QVXgrSDnnmRtlI4O1TL1y/xqIEOM X-Google-Smtp-Source: AB8JxZrY9VBTgGOGpIuuXUx4PuR4Cnn7H1RgTB6Om3BsUn148P+lFv0/qF0fnvbgn0vXUiqIDyWlLQ== X-Received: by 2002:a19:df55:: with SMTP id q21-v6mr2175885lfj.56.1526674038552; Fri, 18 May 2018 13:07:18 -0700 (PDT) Received: from localhost.localdomain ([109.252.91.60]) by smtp.gmail.com with ESMTPSA id z132-v6sm2026987lfd.45.2018.05.18.13.07.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 18 May 2018 13:07:17 -0700 (PDT) From: Dmitry Osipenko To: "Rafael J. Wysocki" , Viresh Kumar , Thierry Reding , Jonathan Hunter Cc: linux-tegra@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Peter Geis Subject: [PATCH v2 02/11] cpufreq: tegra20: Clean up whitespaces in the code Date: Fri, 18 May 2018 23:06:33 +0300 Message-Id: <20180518200642.24815-3-digetx@gmail.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180518200642.24815-1-digetx@gmail.com> References: <20180518200642.24815-1-digetx@gmail.com> Sender: linux-tegra-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-tegra@vger.kernel.org Remove unneeded blank line and replace whitespaces with a tab in the code for consistency. Signed-off-by: Dmitry Osipenko Acked-by: Viresh Kumar Acked-by: Thierry Reding --- drivers/cpufreq/tegra20-cpufreq.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/cpufreq/tegra20-cpufreq.c b/drivers/cpufreq/tegra20-cpufreq.c index 10793498355e..dd8a76a64a8e 100644 --- a/drivers/cpufreq/tegra20-cpufreq.c +++ b/drivers/cpufreq/tegra20-cpufreq.c @@ -203,12 +203,11 @@ static int __init tegra_cpufreq_init(void) static void __exit tegra_cpufreq_exit(void) { - cpufreq_unregister_driver(&tegra_cpufreq_driver); + cpufreq_unregister_driver(&tegra_cpufreq_driver); clk_put(emc_clk); clk_put(cpu_clk); } - MODULE_AUTHOR("Colin Cross "); MODULE_DESCRIPTION("NVIDIA Tegra20 cpufreq driver"); MODULE_LICENSE("GPL"); From patchwork Fri May 18 20:06:34 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Osipenko X-Patchwork-Id: 916574 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-tegra-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="XPwVyHvF"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 40nfNK5hmQz9s29 for ; Sat, 19 May 2018 06:07:29 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752380AbeERUH1 (ORCPT ); Fri, 18 May 2018 16:07:27 -0400 Received: from mail-lf0-f65.google.com ([209.85.215.65]:45125 "EHLO mail-lf0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752296AbeERUHV (ORCPT ); Fri, 18 May 2018 16:07:21 -0400 Received: by mail-lf0-f65.google.com with SMTP id w202-v6so15630788lff.12; Fri, 18 May 2018 13:07:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=uDtSv42YvTM2Y3z8BY4cJICdeT8BTLBC2p3LnzbdG6g=; b=XPwVyHvFBpoNjly9q1JUP6Ym9GyLy6eTol/xaaUeJOh5MINbeXG/dyObmOgnemaNUt 0YuCUk4n4pxcjKB0+g2dglEpGgT/He1YhIp1tw035hT2htg9OBRkzhDF4HD9wS+yHnGd 5Q5qnO4leVqMsvC6UW6s5lSIB6uSoQxdroiTlEWdF0/bzISL6/UKjSTkoo22wUM6bbdp 3ypwX3dYxyTikmvxRCFCh15sIXmzvPMphRWAf1wM2NsOweJmxHWLEywYxWanL9BbCYGj EOY2cCjDlDJumLfPlY8OReYQQbiwHBmGLBXYEY4zsZocVsCMZ3IHIbPjfJgsh3xAf5ja oSCg== 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=uDtSv42YvTM2Y3z8BY4cJICdeT8BTLBC2p3LnzbdG6g=; b=IdMpiTulhvUlIAsMIStdaoxcgLK9zMrb3zwAFi0EpelQLbLiTbJ5kkeZ8mNg2Fo02I KMEuGkDYX+ZSyO7CgjBcYg+OhiuOM3Ezu+q/cPXltwO98pV9nAT0Ms7OA9YKd0viMp+B ZpKRyTdAuLL6qT2WGLYFw0O0quH/SWuOg/gdi+9meISOsmyVLb9gao6qwNNk2wi/oz4m vRJInlmrOkQQ68Ae/Pkq6Um5a5Ac4vAzJDNk/hHUrwQ/nvTje96ZolKjsiOmEVMVFeVz zkNlZlYup7LhCVTfllXkCK9Muxx2BqZfl++msThJcQKRBe6G3zzSkxw/qTXj5WG83h9y 4yeQ== X-Gm-Message-State: ALKqPwfnkqN8NFDljGaDYE2/E9CQGRL3VJWUQrAkxSUMVsit7+oFWVfJ HlXzxcxHLs6nA3ljHmGpz7Y= X-Google-Smtp-Source: AB8JxZp0SmsXLHxYWstg5mfREwdIWXvY5CpKjTJPpaDezEx+SYLkG+ypMb2r2Vu89owZsslJZJMliw== X-Received: by 2002:a19:a692:: with SMTP id p140-v6mr9881241lfe.121.1526674039686; Fri, 18 May 2018 13:07:19 -0700 (PDT) Received: from localhost.localdomain ([109.252.91.60]) by smtp.gmail.com with ESMTPSA id z132-v6sm2026987lfd.45.2018.05.18.13.07.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 18 May 2018 13:07:19 -0700 (PDT) From: Dmitry Osipenko To: "Rafael J. Wysocki" , Viresh Kumar , Thierry Reding , Jonathan Hunter Cc: linux-tegra@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Peter Geis Subject: [PATCH v2 03/11] cpufreq: tegra20: Clean up included headers Date: Fri, 18 May 2018 23:06:34 +0300 Message-Id: <20180518200642.24815-4-digetx@gmail.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180518200642.24815-1-digetx@gmail.com> References: <20180518200642.24815-1-digetx@gmail.com> Sender: linux-tegra-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-tegra@vger.kernel.org Remove unused/unneeded headers and sort them in the alphabet order. Signed-off-by: Dmitry Osipenko Acked-by: Thierry Reding Acked-by: Viresh Kumar --- drivers/cpufreq/tegra20-cpufreq.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/cpufreq/tegra20-cpufreq.c b/drivers/cpufreq/tegra20-cpufreq.c index dd8a76a64a8e..bec1a50a8138 100644 --- a/drivers/cpufreq/tegra20-cpufreq.c +++ b/drivers/cpufreq/tegra20-cpufreq.c @@ -16,16 +16,12 @@ * */ -#include -#include -#include -#include +#include #include -#include -#include #include -#include -#include +#include +#include +#include static struct cpufreq_frequency_table freq_table[] = { { .frequency = 216000 }, From patchwork Fri May 18 20:06:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Osipenko X-Patchwork-Id: 916581 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-tegra-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="mcGPliT4"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 40nfRH06ZHz9s4Y for ; Sat, 19 May 2018 06:10:03 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752354AbeERUHZ (ORCPT ); Fri, 18 May 2018 16:07:25 -0400 Received: from mail-lf0-f67.google.com ([209.85.215.67]:41571 "EHLO mail-lf0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751943AbeERUHW (ORCPT ); Fri, 18 May 2018 16:07:22 -0400 Received: by mail-lf0-f67.google.com with SMTP id m17-v6so15668928lfj.8; Fri, 18 May 2018 13:07:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=ZonjWTezhouA4obmngsNvlcSjlcVZzWCeJ3FeIp4ghI=; b=mcGPliT4ELs5yAr+Mn00uDl2nXytqIOj9zyHdJn2/j2Jx7VV/OOP5NQFSuhognHCFT zfQpeglFH0mMGkg/Hu9XN7oJPRNi00ACFVov9Cz0BLamnODyczdcvygzZoO5+ilZo2Rr r6qdwWqAnbN1QOh+78dOmNZ92dB8SmCo2TkJV4u4CEbXQ86Ru2/47027iP93siAXx9ff dBTtR81YtIEX+nPMzuzgFj+XZp7WHykJFnEvppHK7YSUwBueqiakdxiROxaIOs8uHW+a FlxunZAa6O/H3FtYPqiZK+wB+79w4PWcHGPgKqZSQYT3WQV9Z06fwq/kXyiTcd/4b4KL rSMw== 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=ZonjWTezhouA4obmngsNvlcSjlcVZzWCeJ3FeIp4ghI=; b=rMM9ZcqL5LsO7A6vsJyO+LiCKgwwLkpBkqkMHNX3xuRzg86RpRGLabmqsyuybQHjo9 R3N1uSbry5KxclHhnHF9MQGrjLNjdND5qvl23PXfzYvhioVYNH9nX2eWZSWjbRWDzfux gUVgB6sHkDFFcGAF5NFLMUHxE0UHZfKeKk8Rl/Ad/Rcy3nEA/AdldU/YBDJodGykruZh Vh/W2zTFisZhqmi6+nfDeQqJF/ojoc/MmRk00kQyWJHjiAtp0TMz643pvFUkPeWaLygE LWAsXAD3tB6tDkhw93xzGuwWxceh9eSVqC0hAxofGjkksepbHFY51g4CpAkjgoBZq6/u Klmw== X-Gm-Message-State: ALKqPweCczy6rXF177OrlYdwvN6aPlL7M+qX0Emw2cYCKIukJay4w+/w +mBg/dZB5nlwcYEmpf2YiL0= X-Google-Smtp-Source: AB8JxZqqNMrVWhfgGFP3qDxWm8rWwGTkQLhOKYRW1LnfvJdCjMX2YksQbMdFV4u5Ly2kX7ErtZ91FA== X-Received: by 2002:a19:e81d:: with SMTP id f29-v6mr2223694lfh.83.1526674040821; Fri, 18 May 2018 13:07:20 -0700 (PDT) Received: from localhost.localdomain ([109.252.91.60]) by smtp.gmail.com with ESMTPSA id z132-v6sm2026987lfd.45.2018.05.18.13.07.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 18 May 2018 13:07:20 -0700 (PDT) From: Dmitry Osipenko To: "Rafael J. Wysocki" , Viresh Kumar , Thierry Reding , Jonathan Hunter Cc: linux-tegra@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Peter Geis Subject: [PATCH v2 04/11] cpufreq: tegra20: Remove EMC clock usage Date: Fri, 18 May 2018 23:06:35 +0300 Message-Id: <20180518200642.24815-5-digetx@gmail.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180518200642.24815-1-digetx@gmail.com> References: <20180518200642.24815-1-digetx@gmail.com> Sender: linux-tegra-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-tegra@vger.kernel.org The EMC driver has been gone 4 years ago, since the commit a7cbe92cef27 ("ARM: tegra: remove tegra EMC scaling driver"). Remove the EMC clock usage as it does nothing. We may consider re-implementing the EMC scaling later, probably using PM Memory Bandwidth QoS API. Signed-off-by: Dmitry Osipenko Acked-by: Viresh Kumar Acked-by: Thierry Reding --- drivers/cpufreq/tegra20-cpufreq.c | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/drivers/cpufreq/tegra20-cpufreq.c b/drivers/cpufreq/tegra20-cpufreq.c index bec1a50a8138..4b09a8b410c4 100644 --- a/drivers/cpufreq/tegra20-cpufreq.c +++ b/drivers/cpufreq/tegra20-cpufreq.c @@ -40,7 +40,6 @@ static struct cpufreq_frequency_table freq_table[] = { static struct clk *cpu_clk; static struct clk *pll_x_clk; static struct clk *pll_p_clk; -static struct clk *emc_clk; static bool pll_x_prepared; static unsigned int tegra_get_intermediate(struct cpufreq_policy *policy, @@ -91,17 +90,6 @@ static int tegra_target(struct cpufreq_policy *policy, unsigned int index) unsigned int ifreq = clk_get_rate(pll_p_clk) / 1000; int ret = 0; - /* - * Vote on memory bus frequency based on cpu frequency - * This sets the minimum frequency, display or avp may request higher - */ - if (rate >= 816000) - clk_set_rate(emc_clk, 600000000); /* cpu 816 MHz, emc max */ - else if (rate >= 456000) - clk_set_rate(emc_clk, 300000000); /* cpu 456 MHz, emc 150Mhz */ - else - clk_set_rate(emc_clk, 100000000); /* emc 50Mhz */ - /* * target freq == pll_p, don't need to take extra reference to pll_x_clk * as it isn't used anymore. @@ -137,14 +125,12 @@ static int tegra_cpu_init(struct cpufreq_policy *policy) if (policy->cpu >= NUM_CPUS) return -EINVAL; - clk_prepare_enable(emc_clk); clk_prepare_enable(cpu_clk); /* FIXME: what's the actual transition time? */ ret = cpufreq_generic_init(policy, freq_table, 300 * 1000); if (ret) { clk_disable_unprepare(cpu_clk); - clk_disable_unprepare(emc_clk); return ret; } @@ -156,7 +142,6 @@ static int tegra_cpu_init(struct cpufreq_policy *policy) static int tegra_cpu_exit(struct cpufreq_policy *policy) { clk_disable_unprepare(cpu_clk); - clk_disable_unprepare(emc_clk); return 0; } @@ -188,19 +173,12 @@ static int __init tegra_cpufreq_init(void) if (IS_ERR(pll_p_clk)) return PTR_ERR(pll_p_clk); - emc_clk = clk_get_sys("cpu", "emc"); - if (IS_ERR(emc_clk)) { - clk_put(cpu_clk); - return PTR_ERR(emc_clk); - } - return cpufreq_register_driver(&tegra_cpufreq_driver); } static void __exit tegra_cpufreq_exit(void) { cpufreq_unregister_driver(&tegra_cpufreq_driver); - clk_put(emc_clk); clk_put(cpu_clk); } From patchwork Fri May 18 20:06:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Osipenko X-Patchwork-Id: 916582 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-tegra-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Kb2Glcq9"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 40nfRL2GmFz9s2k for ; Sat, 19 May 2018 06:10:06 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752228AbeERUKF (ORCPT ); Fri, 18 May 2018 16:10:05 -0400 Received: from mail-lf0-f67.google.com ([209.85.215.67]:44783 "EHLO mail-lf0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752332AbeERUHY (ORCPT ); Fri, 18 May 2018 16:07:24 -0400 Received: by mail-lf0-f67.google.com with SMTP id h197-v6so15646837lfg.11; Fri, 18 May 2018 13:07:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=PzvdQWNzLjuQdFPt1cKJzkvIL6qitp4Vvf6JntJtB6o=; b=Kb2Glcq93o32LEZECAczIYjO27JLpUTJWVns7zQo66GzC3wgiob4+lxSb/Ap1UUUE0 +e0PGj++PKxBNfdWV88PKQTrUG8KJE0k6HTZMdceudo/IsmU4ss8M8ak6oUzTDJdYSLM BQypIfZje9K6CKUCTcMXd2hbqjokhBjhgGv6ztgybVby5JSfbzCPhdzuyBTKMniCYsNT 4m/lCWrlvfblg4XXxmOj1b/nhuzoFT9zYn9PuWfXnMbpIGnPZCpsmC+kG01MeSLpdu/P HPj3oMVZqVBNq3s0HKRMsy/nzJSAykhxc7hHDS2bqICOSEyW4DhwfS/M2AlAz4pDZFo3 M2Yg== 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=PzvdQWNzLjuQdFPt1cKJzkvIL6qitp4Vvf6JntJtB6o=; b=Mae1yN7Vum5GHhZhKi1J9ea08f8mIYf9mslV1i7Timphj5KqNAfz0YQ36CiCzWYe8M G6aZmY4COBaHifUYerVl5Ji65SgA6J7Bo68UPsPw64t2aneby/Dglk87qwujmYoYSw6v YfCoGHW+aOqqz7XbO5TYaohpTpaSRyaPbNq5Ks9xFTQU3lVGdTUQ7q3hGp+rPmYGRxCs d7fbkVo7oCrwtPa/mwQ+JNOFNiFHLdwnWQsIwCw9EV+x2qr82dajNkkPeukvFjvJ7lO9 zeHvhsEII47FEY/fUs920IJFKEOjAInNHgTdX/Y1ToSCAjLo3zSBAGTOOpboXsdh+M8f 8DBA== X-Gm-Message-State: ALKqPwebTngjGpVKMXa0BNBghlUzffgYq1CaGVFFq7pMHSpcW7jcsY/c 5Vs/b62kz8dRtiNZ0zJoeBk= X-Google-Smtp-Source: AB8JxZqNR1Nm7Bmb6y1nH7fx+1/fUa9dCtAXGW00Lsti84XNaJUXQpYVy1Wu9fBELVw0QGlWJjoDuw== X-Received: by 2002:a19:a9d4:: with SMTP id s203-v6mr22881508lfe.37.1526674042011; Fri, 18 May 2018 13:07:22 -0700 (PDT) Received: from localhost.localdomain ([109.252.91.60]) by smtp.gmail.com with ESMTPSA id z132-v6sm2026987lfd.45.2018.05.18.13.07.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 18 May 2018 13:07:21 -0700 (PDT) From: Dmitry Osipenko To: "Rafael J. Wysocki" , Viresh Kumar , Thierry Reding , Jonathan Hunter Cc: linux-tegra@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Peter Geis Subject: [PATCH v2 05/11] cpufreq: tegra20: Release clocks properly Date: Fri, 18 May 2018 23:06:36 +0300 Message-Id: <20180518200642.24815-6-digetx@gmail.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180518200642.24815-1-digetx@gmail.com> References: <20180518200642.24815-1-digetx@gmail.com> Sender: linux-tegra-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-tegra@vger.kernel.org Properly put requested clocks in the module init/exit code. Signed-off-by: Dmitry Osipenko Acked-by: Viresh Kumar Acked-by: Thierry Reding --- drivers/cpufreq/tegra20-cpufreq.c | 31 ++++++++++++++++++++++++++----- 1 file changed, 26 insertions(+), 5 deletions(-) diff --git a/drivers/cpufreq/tegra20-cpufreq.c b/drivers/cpufreq/tegra20-cpufreq.c index 4b09a8b410c4..ea186d3f0faf 100644 --- a/drivers/cpufreq/tegra20-cpufreq.c +++ b/drivers/cpufreq/tegra20-cpufreq.c @@ -161,24 +161,45 @@ static struct cpufreq_driver tegra_cpufreq_driver = { static int __init tegra_cpufreq_init(void) { + int err; + cpu_clk = clk_get_sys(NULL, "cclk"); if (IS_ERR(cpu_clk)) return PTR_ERR(cpu_clk); pll_x_clk = clk_get_sys(NULL, "pll_x"); - if (IS_ERR(pll_x_clk)) - return PTR_ERR(pll_x_clk); + if (IS_ERR(pll_x_clk)) { + err = PTR_ERR(pll_x_clk); + goto put_cpu; + } pll_p_clk = clk_get_sys(NULL, "pll_p"); - if (IS_ERR(pll_p_clk)) - return PTR_ERR(pll_p_clk); + if (IS_ERR(pll_p_clk)) { + err = PTR_ERR(pll_p_clk); + goto put_pll_x; + } + + err = cpufreq_register_driver(&tegra_cpufreq_driver); + if (err) + goto put_pll_p; + + return 0; + +put_pll_p: + clk_put(pll_p_clk); +put_pll_x: + clk_put(pll_x_clk); +put_cpu: + clk_put(cpu_clk); - return cpufreq_register_driver(&tegra_cpufreq_driver); + return err; } static void __exit tegra_cpufreq_exit(void) { cpufreq_unregister_driver(&tegra_cpufreq_driver); + clk_put(pll_p_clk); + clk_put(pll_x_clk); clk_put(cpu_clk); } From patchwork Fri May 18 20:06:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Osipenko X-Patchwork-Id: 916580 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-tegra-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Cb1FWEOh"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 40nfRG20cGz9s4V for ; Sat, 19 May 2018 06:10:02 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752271AbeERUJt (ORCPT ); Fri, 18 May 2018 16:09:49 -0400 Received: from mail-lf0-f65.google.com ([209.85.215.65]:38454 "EHLO mail-lf0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752346AbeERUHZ (ORCPT ); Fri, 18 May 2018 16:07:25 -0400 Received: by mail-lf0-f65.google.com with SMTP id z142-v6so15659351lff.5; Fri, 18 May 2018 13:07:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=OOM0Ei/FWLfd36PPZ4/OEyTOfvRpATxIfGo99BTtxpM=; b=Cb1FWEOh+PoE6cEIcIlWS7PoMphhLRg07bGFpxf8lLOrMtfyyWWqLu6t239JGHeTuQ qpNz1HVF70GfSv4dgPsL2MHEq2cIrNp3WHFtNcL14VjyFrWqm/LcA9wlHmiUYoyf7Lhl ACrmp216OfEjBSskiVS+jiEQsVuNInC9yJyPP57JdPLsHiUz1701lG8uqDq4AaXqBu4H 5KgORwU5yRL0IGmY4Bt7sF6xaDZY4NLbqev9SLmR8lBXRUdUqDp6oMywStdlQQFiZtrr qEjSwDXMCZ84kKUdEqM6EKIU1+9f1BOj8WJXfQeYeMcuLKp+QaphNYBy1fezQnwseaz2 O5Ow== 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=OOM0Ei/FWLfd36PPZ4/OEyTOfvRpATxIfGo99BTtxpM=; b=sqxOgdLKa7MMfeYWT4uYRzkTyKkBcGbdTyCvyDYGZs3KeCwUPZ5sVPyJ6uCJwhV76l fat0licFd0ey959Q8VlrkT12fhCGFUKgUNAruc4nsGiclh+zQmKF3oqzQ4yskN8pZen8 T1zdKrN58AAhXjdptkVRcKarV4Uq48OUOt7mA3a2ZzZmiAWey8XhmCrQNmJRvOdgrqBg Aa2jdpmf43TV2rFXhzBRzk7TlHl6CObo4QWsZ9OZNcH4EoONpDjLAq2/6WfORQ2b4svp uR9IME99b4UMqxEVcbb4Off/0lwwCAUmkzzDJ6BnRnFrAMYK4lccEnJXfihj5lxo0Ewa VnHw== X-Gm-Message-State: ALKqPwfiTAYia5XEYlb6XqwhA9djArgNveNPggcgPU8dBi3JrorqACA7 FgZclQMJ1bxuXsINbvtWxFQ= X-Google-Smtp-Source: AB8JxZpSFef6NxkY3xF2fwip3lUgHFTr2ebwCOFkhrwmMxd0GclLc2HfhKEX3rRVqZI+N+YeFeh6Kg== X-Received: by 2002:a19:becb:: with SMTP id o194-v6mr22569003lff.13.1526674043117; Fri, 18 May 2018 13:07:23 -0700 (PDT) Received: from localhost.localdomain ([109.252.91.60]) by smtp.gmail.com with ESMTPSA id z132-v6sm2026987lfd.45.2018.05.18.13.07.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 18 May 2018 13:07:22 -0700 (PDT) From: Dmitry Osipenko To: "Rafael J. Wysocki" , Viresh Kumar , Thierry Reding , Jonathan Hunter Cc: linux-tegra@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Peter Geis Subject: [PATCH v2 06/11] cpufreq: tegra20: Remove unneeded check in tegra_cpu_init Date: Fri, 18 May 2018 23:06:37 +0300 Message-Id: <20180518200642.24815-7-digetx@gmail.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180518200642.24815-1-digetx@gmail.com> References: <20180518200642.24815-1-digetx@gmail.com> Sender: linux-tegra-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-tegra@vger.kernel.org Remove checking of the CPU number for consistency as it won't ever fail unless there is a severe bug in the cpufreq core. Signed-off-by: Dmitry Osipenko Acked-by: Viresh Kumar Acked-by: Thierry Reding --- drivers/cpufreq/tegra20-cpufreq.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/drivers/cpufreq/tegra20-cpufreq.c b/drivers/cpufreq/tegra20-cpufreq.c index ea186d3f0faf..df25e350c8e6 100644 --- a/drivers/cpufreq/tegra20-cpufreq.c +++ b/drivers/cpufreq/tegra20-cpufreq.c @@ -35,8 +35,6 @@ static struct cpufreq_frequency_table freq_table[] = { { .frequency = CPUFREQ_TABLE_END }, }; -#define NUM_CPUS 2 - static struct clk *cpu_clk; static struct clk *pll_x_clk; static struct clk *pll_p_clk; @@ -122,9 +120,6 @@ static int tegra_cpu_init(struct cpufreq_policy *policy) { int ret; - if (policy->cpu >= NUM_CPUS) - return -EINVAL; - clk_prepare_enable(cpu_clk); /* FIXME: what's the actual transition time? */ From patchwork Fri May 18 20:06:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Osipenko X-Patchwork-Id: 916577 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-tegra-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="CL1wVrGM"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 40nfPc1kYpz9s2k for ; Sat, 19 May 2018 06:08:36 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752403AbeERUHa (ORCPT ); Fri, 18 May 2018 16:07:30 -0400 Received: from mail-lf0-f66.google.com ([209.85.215.66]:34343 "EHLO mail-lf0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752374AbeERUH2 (ORCPT ); Fri, 18 May 2018 16:07:28 -0400 Received: by mail-lf0-f66.google.com with SMTP id x145-v6so3656601lff.1; Fri, 18 May 2018 13:07:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=5cH7W0NXhq3ZidYG1GxTeL1Yr1v6NahQJhxU4i+7szo=; b=CL1wVrGMel2c1CZaNPxfZMkRE7pyqIEd4vEo1ekwgtqvx5sIU4GSfgteDTdGyXjTXV AjDW6zbpTeOSBFEI59mTX2BnU7Wt/P1zixe/Ak32+OpwuGDVPHxYEvNJvVYwnJGclcy4 yDJzAn4iYp8INLbm0AlM+PRmLFIDnzqxxRygV+cUBhWe+KKlRxA90AzfaxOBVkaptCOR c/IJIWemFps0gETaCZrIrUthz7IyhlmGtFsQmQNk19cjXHj1q/LldTq4rZ6f8snLWqVj tfaotAvdM5CYLpb1JB3Y4qjBRvNrLVz+brAlrAURtPSLK/vBwzrivPdjmwh2FetKv0qy EQ/w== 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=5cH7W0NXhq3ZidYG1GxTeL1Yr1v6NahQJhxU4i+7szo=; b=b2gVmQTYEajka2YtP8wxp6/tZIXcLd6PvxhK5qlpaB96T1WjM4K0+ardqkZVZPvQK7 NfSZ4BLG/LWaT6+0zX8X5Siir4nO4Wmc3oGQq59Mr8yi/ITUk7BDPMfiFRZKq/oXcdv7 XudruDflSearo1sqqEARB6LGoSJrOrG/Nax/ldmVFP9/LkIRuuVRwBit3tprm4CHn/U8 5tt7b/kPQOgxDNonQu2yAMOYtwwnt9PH9SAadY7dGReAnI9d0TaqnSKcvgnKe/mutKfb 1Oa8o+e2ThPvrgl1qiznvkMuysQjnmNUYGHg4WkBiWY45O5FV/pkhNeps13QAUwRyxGH BqIA== X-Gm-Message-State: ALKqPweI+cvuS0CJ8XE1HGmC1Io1DfVbjPggpv8uvN1IQPAaSVkGGtfQ pM+BH7ZFPJM9Fs/dMTW45L4= X-Google-Smtp-Source: AB8JxZpQWyow3dx2Cf2EU3cz49a2+1SPYnnvC3yhvwjqS+FE9B/LGQkBD5OYm1fYYw3th5FNeYfBIg== X-Received: by 2002:a2e:954b:: with SMTP id t11-v6mr6912659ljh.138.1526674045733; Fri, 18 May 2018 13:07:25 -0700 (PDT) Received: from localhost.localdomain ([109.252.91.60]) by smtp.gmail.com with ESMTPSA id z132-v6sm2026987lfd.45.2018.05.18.13.07.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 18 May 2018 13:07:23 -0700 (PDT) From: Dmitry Osipenko To: "Rafael J. Wysocki" , Viresh Kumar , Thierry Reding , Jonathan Hunter Cc: linux-tegra@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Peter Geis Subject: [PATCH v2 07/11] cpufreq: tegra20: Remove unnecessary parentheses Date: Fri, 18 May 2018 23:06:38 +0300 Message-Id: <20180518200642.24815-8-digetx@gmail.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180518200642.24815-1-digetx@gmail.com> References: <20180518200642.24815-1-digetx@gmail.com> Sender: linux-tegra-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-tegra@vger.kernel.org Remove unnecessary parentheses as suggested by the checkpatch script. Signed-off-by: Dmitry Osipenko Acked-by: Thierry Reding Acked-by: Viresh Kumar --- drivers/cpufreq/tegra20-cpufreq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/cpufreq/tegra20-cpufreq.c b/drivers/cpufreq/tegra20-cpufreq.c index df25e350c8e6..4b85a6733533 100644 --- a/drivers/cpufreq/tegra20-cpufreq.c +++ b/drivers/cpufreq/tegra20-cpufreq.c @@ -50,7 +50,7 @@ static unsigned int tegra_get_intermediate(struct cpufreq_policy *policy, * - we are already at it, i.e. policy->cur == ifreq * - index corresponds to ifreq */ - if ((freq_table[index].frequency == ifreq) || (policy->cur == ifreq)) + if (freq_table[index].frequency == ifreq || policy->cur == ifreq) return 0; return ifreq; From patchwork Fri May 18 20:06:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Osipenko X-Patchwork-Id: 916578 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-tegra-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="G2wwdXxI"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 40nfPg6pbvz9s2k for ; Sat, 19 May 2018 06:08:39 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751545AbeERUIi (ORCPT ); Fri, 18 May 2018 16:08:38 -0400 Received: from mail-lf0-f66.google.com ([209.85.215.66]:44796 "EHLO mail-lf0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752386AbeERUH2 (ORCPT ); Fri, 18 May 2018 16:07:28 -0400 Received: by mail-lf0-f66.google.com with SMTP id h197-v6so15647200lfg.11; Fri, 18 May 2018 13:07:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=YfFnzQrqUqSMRimojtY/Cp7ewBGW+CwlDr2Na3KuSVk=; b=G2wwdXxIu0FBT3MmCcRvCTyvF71KZc4spV3me8yGnqZimUpukSUAez5YzMQGB0giS8 WzsQDJKtBQbOjDOPYXihvQxNQpc7qrHw+G4t7ryCH55uWL8+F7eTz8my5Dw2ctTUPK0X HoqVeUOx4MasmUfNZMgztTUsUgD3zSoHdcQ4lEvZtFwNfEyPTjzRCIDk1RFKJFn9uDrP hKyb6df0kzkSuEanYBOR65v0aM/qDudX+qkuE+6XumzcgKrUSPWKzSzir0UsK47HS9ez Ffpuk8m13deLwmBYLIop+eXCU2EgsjCGk+NCVJ3OoE5ewL2h9T3S7IGVr65hRC6ZnWs7 L6Ew== 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=YfFnzQrqUqSMRimojtY/Cp7ewBGW+CwlDr2Na3KuSVk=; b=oOi5Tc0nCQMTxkvFbPtDPhngQxXC3EUyTMzcQ0kRlEulcidK9kblIcE5BaCnWd6EVz 4v7TV+alU1iYx6m0Ez7IMq7fDm77T6yk2tTEG/Rhwz3yvsll/Y9mFp333tB6Xyh/A8Lk ThZZ1CbUvDMDbGbkwMXnL1i2v9TU9IA5P3RK42CkGHy4hWGlbtp8Trg+S9NwMj8FuDBN c4uRh8TopOiC+zH3oAF0IUEEo0bABQ6c8hMP9FxtUzGcoL8dhq3lzxOKbxmRdFQfFph9 I7fuxGbWrKlJojIP5OQVEBDzO5AugarMVNVH90ocUgzPPiI8DThPxiTu9jRKWb0dzoNF tpwQ== X-Gm-Message-State: ALKqPwdbXi05LNq1bbhmFfFPqX9zbXd4wYiZF+VbGFh7IazPy1yipGmk uZ4GsMKFpTdLJx6R1+2wmCE= X-Google-Smtp-Source: AB8JxZoc+rxXRPaGbYV2+CHWYzKZDmu+Jl0VkSn/JYIgXlDXS3nS1cb77fuhN1vMY9UNkBE7zFqULQ== X-Received: by 2002:a2e:918d:: with SMTP id f13-v6mr6482244ljg.24.1526674046941; Fri, 18 May 2018 13:07:26 -0700 (PDT) Received: from localhost.localdomain ([109.252.91.60]) by smtp.gmail.com with ESMTPSA id z132-v6sm2026987lfd.45.2018.05.18.13.07.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 18 May 2018 13:07:26 -0700 (PDT) From: Dmitry Osipenko To: "Rafael J. Wysocki" , Viresh Kumar , Thierry Reding , Jonathan Hunter Cc: linux-tegra@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Peter Geis Subject: [PATCH v2 08/11] cpufreq: tegra20: Remove unneeded variable initialization Date: Fri, 18 May 2018 23:06:39 +0300 Message-Id: <20180518200642.24815-9-digetx@gmail.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180518200642.24815-1-digetx@gmail.com> References: <20180518200642.24815-1-digetx@gmail.com> Sender: linux-tegra-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-tegra@vger.kernel.org Remove unneeded variable initialization solely for consistency. Signed-off-by: Dmitry Osipenko Acked-by: Viresh Kumar Acked-by: Thierry Reding --- drivers/cpufreq/tegra20-cpufreq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/cpufreq/tegra20-cpufreq.c b/drivers/cpufreq/tegra20-cpufreq.c index 4b85a6733533..36075aee2ff2 100644 --- a/drivers/cpufreq/tegra20-cpufreq.c +++ b/drivers/cpufreq/tegra20-cpufreq.c @@ -86,7 +86,7 @@ static int tegra_target(struct cpufreq_policy *policy, unsigned int index) { unsigned long rate = freq_table[index].frequency; unsigned int ifreq = clk_get_rate(pll_p_clk) / 1000; - int ret = 0; + int ret; /* * target freq == pll_p, don't need to take extra reference to pll_x_clk From patchwork Fri May 18 20:06:40 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Osipenko X-Patchwork-Id: 916579 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-tegra-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Qq7dHdHf"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 40nfQy0VVqz9s2k for ; Sat, 19 May 2018 06:09:45 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752524AbeERUIf (ORCPT ); Fri, 18 May 2018 16:08:35 -0400 Received: from mail-lf0-f68.google.com ([209.85.215.68]:34352 "EHLO mail-lf0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752259AbeERUH3 (ORCPT ); Fri, 18 May 2018 16:07:29 -0400 Received: by mail-lf0-f68.google.com with SMTP id x145-v6so3656757lff.1; Fri, 18 May 2018 13:07:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=XUOGODswHEeu01lcxwMYng2mz3cnybNc6Pi2wW4y2EE=; b=Qq7dHdHfWSqMvb9Bbg43CJtpEg55oZsuJWKZJrnY7WN1t2bFglCUEqS40M++/DIpvM Wn/fP5t1e3RxP21FBRrG31PWe907B5wez/wUIlkwdxRNCanp0lCqVfsU/cB5y/8goHXp FMl3pKN3amDgn986Kkm1WbkKC9JYA8DKLXVVNYRAF/EfNfb+gUYHCNKXNx5oP3OW6Kdr bhyFGNGZZm+priI25eTvMkM3nOVdMWrEh/4MSgdW5PhN7DgqfHpWQbt9Q+zVLWKVLVxX iXNNM35qMqx8Rp36v38d0Mp7NwXuA/zxVqiegTCKLzWXkDp05Ojvqo1+Tqb0e3hQAcal Vkbg== 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=XUOGODswHEeu01lcxwMYng2mz3cnybNc6Pi2wW4y2EE=; b=RSKnhUNUhdLM0aKC5r/XK7tnVk4OQQSfgm8gFv6i8HhOMW+EUVuucjvcp63YgEBkN0 amGd9eYMe5b3S449oU4o8K98cGOc9H1zv030RZmbNv+m2/1w/LD8Xl3I/PjmBxz3J1rx I2J3C4h5wgoxZBXNp+IPBpIxU6IV0kODVKzpfI6onCHrN3MBKdreI+ibd/Y5CLLQWUfK EOEx+KZDpJzTh4jGZWhYEF+JOXRARPMT3nqqwraJ8JojMIwGuZ8hiy/25wRpNdHpEJ5w FAZSBoDru+nnSQkR0nrXkHc5BsQ4DUg5ktOnwhnSfHS2OZst248nHZeHNj4r/3/+N8wQ W7RA== X-Gm-Message-State: ALKqPwf4ywAeB+nEhseWpc9fIigx7UFKXIE/iPb+UNr3MrDnA5Bqz6ee 2ONMdOi82jUoIClQvQCGULc= X-Google-Smtp-Source: AB8JxZojt8BbEQNiBZRPSVq4ZDp/l6qxK0van0X/OwMozbpCjgvHfvnLWQzTv9461J9BkfKKi63Urg== X-Received: by 2002:a2e:3e0c:: with SMTP id l12-v6mr6915267lja.23.1526674047969; Fri, 18 May 2018 13:07:27 -0700 (PDT) Received: from localhost.localdomain ([109.252.91.60]) by smtp.gmail.com with ESMTPSA id z132-v6sm2026987lfd.45.2018.05.18.13.07.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 18 May 2018 13:07:27 -0700 (PDT) From: Dmitry Osipenko To: "Rafael J. Wysocki" , Viresh Kumar , Thierry Reding , Jonathan Hunter Cc: linux-tegra@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Peter Geis Subject: [PATCH v2 09/11] cpufreq: tegra20: Check if this is Tegra20 machine Date: Fri, 18 May 2018 23:06:40 +0300 Message-Id: <20180518200642.24815-10-digetx@gmail.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180518200642.24815-1-digetx@gmail.com> References: <20180518200642.24815-1-digetx@gmail.com> Sender: linux-tegra-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-tegra@vger.kernel.org Don't even try to request the clocks during of module initialization on non-Tegra20 machines (this is the case for a multi-platform kernel) for consistency. Signed-off-by: Dmitry Osipenko Acked-by: Viresh Kumar Acked-by: Thierry Reding --- drivers/cpufreq/tegra20-cpufreq.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/cpufreq/tegra20-cpufreq.c b/drivers/cpufreq/tegra20-cpufreq.c index 36075aee2ff2..7b425ebe81e7 100644 --- a/drivers/cpufreq/tegra20-cpufreq.c +++ b/drivers/cpufreq/tegra20-cpufreq.c @@ -21,6 +21,7 @@ #include #include #include +#include #include static struct cpufreq_frequency_table freq_table[] = { @@ -158,6 +159,9 @@ static int __init tegra_cpufreq_init(void) { int err; + if (!of_machine_is_compatible("nvidia,tegra20")) + return -ENODEV; + cpu_clk = clk_get_sys(NULL, "cclk"); if (IS_ERR(cpu_clk)) return PTR_ERR(cpu_clk); From patchwork Fri May 18 20:06:41 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Osipenko X-Patchwork-Id: 916576 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-tegra-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="RbfpHmi8"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 40nfPY07VTz9s2k for ; Sat, 19 May 2018 06:08:33 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752506AbeERUIU (ORCPT ); Fri, 18 May 2018 16:08:20 -0400 Received: from mail-lf0-f67.google.com ([209.85.215.67]:32968 "EHLO mail-lf0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752400AbeERUHa (ORCPT ); Fri, 18 May 2018 16:07:30 -0400 Received: by mail-lf0-f67.google.com with SMTP id h9-v6so15700129lfi.0; Fri, 18 May 2018 13:07:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=IdYaQ1saPFYelX4gsO5pe1KIbhOd3xskmgKb/W4gYfc=; b=RbfpHmi8JSySbgBTzAMX5bLBsPrwUOvJHMUGMDXOEwrHvosrJZ/xXT8dFPKOo52kGH xF0TcI/s0uAF6GFW2N7n/Ic76KoOSrtA3V17Fn93RD2ooUiYyMfklO8U0WxDO653Ueet UWErS59c/qlTir4/8CfSSSsLzDqj3nsCCJ6v3g6xRvPtjZ9l8VPq/hpo7PsV1NIMojbv OBLHueHMjS3YN5VdYluZ0rhge+hrwKiJenCTL9WM55YIHV18oCjW9HLSBl/6d7nYJWID Gw4eKX35GOjprungXptqEB/R/5+Fmd/Ija/hzDgNnNjOVA1VhHShH0WFL0xMaGZnuVXM 0/LA== 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=IdYaQ1saPFYelX4gsO5pe1KIbhOd3xskmgKb/W4gYfc=; b=nftY/FkUzZkum7SGZLVKpV7lDxbzpbm2XF/UfLJYzb/a0QnQXJdZFKnG+ClRwtqho9 sWw7o8XgigFkoj25/HpaGMJuT9Z+913LfLej3Ivp5vcf2ynLoi/V/iMw2MYzlwjOqlah tPVci64FIp2Z/DvDy6gIwWfAxvkG6RISTYC/ySe9LYbcrChICwbVG4Zmcpw87tDHRa3H NyPTjRInqClKHdsJkyFn8xQ2gdmUakXuBy4dW816mpEyv7ZHnq6uDtXO/Q9tA9fG7Pn7 wPWyF1pY9bg5fyKqZoxbhfcKJdWf/lT8ucFrTSdsruMgN5f7oDL1Q+2EapkSn95oxLUf woVA== X-Gm-Message-State: ALKqPwcLH4FbutB6KIUQv8QRTj8HHtOEwif8BcIiMxBU2hnKekFoo/dY cSp0qFTiAhwLz7JMEazi6Gs= X-Google-Smtp-Source: AB8JxZpijk4fEqvLuw/+AtU3XtML9P1YCceaxlIcd+/9a+nbuZsAvEkd6oJgDahGuy4tFa3FvOU7SQ== X-Received: by 2002:a2e:7c02:: with SMTP id x2-v6mr6817274ljc.96.1526674049106; Fri, 18 May 2018 13:07:29 -0700 (PDT) Received: from localhost.localdomain ([109.252.91.60]) by smtp.gmail.com with ESMTPSA id z132-v6sm2026987lfd.45.2018.05.18.13.07.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 18 May 2018 13:07:28 -0700 (PDT) From: Dmitry Osipenko To: "Rafael J. Wysocki" , Viresh Kumar , Thierry Reding , Jonathan Hunter Cc: linux-tegra@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Peter Geis Subject: [PATCH v2 10/11] cpufreq: tegra20: Allow cpufreq driver to be built as loadable module Date: Fri, 18 May 2018 23:06:41 +0300 Message-Id: <20180518200642.24815-11-digetx@gmail.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180518200642.24815-1-digetx@gmail.com> References: <20180518200642.24815-1-digetx@gmail.com> Sender: linux-tegra-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-tegra@vger.kernel.org Nothing prevents Tegra20 CPUFreq module to be unloaded, hence allow it to be built as a non-builtin kernel module. Signed-off-by: Dmitry Osipenko Acked-by: Viresh Kumar Acked-by: Thierry Reding --- drivers/cpufreq/Kconfig.arm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/cpufreq/Kconfig.arm b/drivers/cpufreq/Kconfig.arm index 96b35b8b3606..a8a2e210c624 100644 --- a/drivers/cpufreq/Kconfig.arm +++ b/drivers/cpufreq/Kconfig.arm @@ -264,7 +264,7 @@ config ARM_TANGO_CPUFREQ default y config ARM_TEGRA20_CPUFREQ - bool "Tegra20 CPUFreq support" + tristate "Tegra20 CPUFreq support" depends on ARCH_TEGRA default y help From patchwork Fri May 18 20:06:42 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Osipenko X-Patchwork-Id: 916575 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-tegra-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="VBC5tw9P"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 40nfP85zvMz9s29 for ; Sat, 19 May 2018 06:08:12 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752221AbeERUIA (ORCPT ); Fri, 18 May 2018 16:08:00 -0400 Received: from mail-lf0-f66.google.com ([209.85.215.66]:40671 "EHLO mail-lf0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752422AbeERUHc (ORCPT ); Fri, 18 May 2018 16:07:32 -0400 Received: by mail-lf0-f66.google.com with SMTP id u140-v6so3390156lff.7; Fri, 18 May 2018 13:07:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=rl+XAPkECY1ZRNrJOkBPoew/g2VOgb9MCdgd6bLxaPw=; b=VBC5tw9Pc5BK/8TaOUF9+YfdWOMauxAIksjiz0dwTLfrrNpBRuR4Ol3ppGCpHjSL6/ XDVZwnVHYeWuqk0dgLalf3CNfK6dKKp1y+nGWJV79qAYX7I4IIUI0m1qdl+V/0VUbr1+ MZ2t6wJLvZalXscA7UPBhDA9T0QtDAIOdWN0CN2g1dPsbSGsHkB6vw7VO4e5g7VFZ5n9 DAMaNRiy00blGuOtKpBUnViJdD8Fa0d/Gp0pMudWok00Sj0vq+4hKNMndE1AgU+KPD5B YVcspBrgBEuc4Jn2a0GQ82zD3VkFUk4gc80mFU9tux68t7Ahde8V5r3Om3bSZzoPVQjk k3sA== 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=rl+XAPkECY1ZRNrJOkBPoew/g2VOgb9MCdgd6bLxaPw=; b=Io70Me17+6PqF4jJ3U1ry5nVUpYpQA0nAiuBOXcOB3x5v5fa+7pnLbOVZQN5PMjX7D Juv71MEz9kWjDZabHC9yU3jZcDObmsY7T366vshP33TbuAJKX1j1XOaRgILnN/1+Yyq5 8LWDeMB2EOsCe6XFQPOMA/sgjXOu1tiBpq2vfQIJLKfhj4GKNsOpDYEvBNXmohk1+MzU v+TLxK/jRNqQXnp/g7MS97shnKf4fngPVfFTebsrR5HAgFJ4MJfpH4/glVl7087o3A3H Mz2A4/dMYrFgku0/GKhqHXWgYKLxwYpp239BEoRuFgemu6xYoEW1lydi33iBre+kxpuL l0/A== X-Gm-Message-State: ALKqPwdyjBosy+U1n08cLf+3a+4ZutV+xqMwWY9XTdkg6aGgxI0mqmvu S+ZNfYtjxC6v2E00Yumo/CQ= X-Google-Smtp-Source: AB8JxZpBhq6XanGRA3a59KgVmrVC32AVFuWZ2wLjyUpGoNQxHwvDZ/5NeSYQhG2PDxNusc5RLgS4jg== X-Received: by 2002:a2e:8018:: with SMTP id j24-v6mr6420710ljg.92.1526674050341; Fri, 18 May 2018 13:07:30 -0700 (PDT) Received: from localhost.localdomain ([109.252.91.60]) by smtp.gmail.com with ESMTPSA id z132-v6sm2026987lfd.45.2018.05.18.13.07.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 18 May 2018 13:07:29 -0700 (PDT) From: Dmitry Osipenko To: "Rafael J. Wysocki" , Viresh Kumar , Thierry Reding , Jonathan Hunter Cc: linux-tegra@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Peter Geis Subject: [PATCH v2 11/11] cpufreq: tegra20: Wrap cpufreq into platform driver Date: Fri, 18 May 2018 23:06:42 +0300 Message-Id: <20180518200642.24815-12-digetx@gmail.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180518200642.24815-1-digetx@gmail.com> References: <20180518200642.24815-1-digetx@gmail.com> Sender: linux-tegra-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-tegra@vger.kernel.org Currently tegra20-cpufreq kernel module isn't getting autoloaded because there is no device associated with the module, this is one of two patches that resolves the module autoloading. This patch adds a module alias that will associate the tegra20-cpufreq kernel module with the platform device, other patch will instantiate the actual platform device. And now it makes sense to wrap cpufreq driver into a platform driver for consistency. Signed-off-by: Dmitry Osipenko Acked-by: Viresh Kumar --- drivers/cpufreq/tegra20-cpufreq.c | 145 ++++++++++++++++++------------ 1 file changed, 86 insertions(+), 59 deletions(-) diff --git a/drivers/cpufreq/tegra20-cpufreq.c b/drivers/cpufreq/tegra20-cpufreq.c index 7b425ebe81e7..05f57dcd5215 100644 --- a/drivers/cpufreq/tegra20-cpufreq.c +++ b/drivers/cpufreq/tegra20-cpufreq.c @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include static struct cpufreq_frequency_table freq_table[] = { @@ -36,15 +36,20 @@ static struct cpufreq_frequency_table freq_table[] = { { .frequency = CPUFREQ_TABLE_END }, }; -static struct clk *cpu_clk; -static struct clk *pll_x_clk; -static struct clk *pll_p_clk; -static bool pll_x_prepared; +struct tegra20_cpufreq { + struct device *dev; + struct cpufreq_driver driver; + struct clk *cpu_clk; + struct clk *pll_x_clk; + struct clk *pll_p_clk; + bool pll_x_prepared; +}; static unsigned int tegra_get_intermediate(struct cpufreq_policy *policy, unsigned int index) { - unsigned int ifreq = clk_get_rate(pll_p_clk) / 1000; + struct tegra20_cpufreq *cpufreq = cpufreq_get_driver_data(); + unsigned int ifreq = clk_get_rate(cpufreq->pll_p_clk) / 1000; /* * Don't switch to intermediate freq if: @@ -60,6 +65,7 @@ static unsigned int tegra_get_intermediate(struct cpufreq_policy *policy, static int tegra_target_intermediate(struct cpufreq_policy *policy, unsigned int index) { + struct tegra20_cpufreq *cpufreq = cpufreq_get_driver_data(); int ret; /* @@ -72,21 +78,22 @@ static int tegra_target_intermediate(struct cpufreq_policy *policy, * Also, we wouldn't be using pll_x anymore and must not take extra * reference to it, as it can be disabled now to save some power. */ - clk_prepare_enable(pll_x_clk); + clk_prepare_enable(cpufreq->pll_x_clk); - ret = clk_set_parent(cpu_clk, pll_p_clk); + ret = clk_set_parent(cpufreq->cpu_clk, cpufreq->pll_p_clk); if (ret) - clk_disable_unprepare(pll_x_clk); + clk_disable_unprepare(cpufreq->pll_x_clk); else - pll_x_prepared = true; + cpufreq->pll_x_prepared = true; return ret; } static int tegra_target(struct cpufreq_policy *policy, unsigned int index) { + struct tegra20_cpufreq *cpufreq = cpufreq_get_driver_data(); unsigned long rate = freq_table[index].frequency; - unsigned int ifreq = clk_get_rate(pll_p_clk) / 1000; + unsigned int ifreq = clk_get_rate(cpufreq->pll_p_clk) / 1000; int ret; /* @@ -94,14 +101,14 @@ static int tegra_target(struct cpufreq_policy *policy, unsigned int index) * as it isn't used anymore. */ if (rate == ifreq) - return clk_set_parent(cpu_clk, pll_p_clk); + return clk_set_parent(cpufreq->cpu_clk, cpufreq->pll_p_clk); - ret = clk_set_rate(pll_x_clk, rate * 1000); + ret = clk_set_rate(cpufreq->pll_x_clk, rate * 1000); /* Restore to earlier frequency on error, i.e. pll_x */ if (ret) - pr_err("Failed to change pll_x to %lu\n", rate); + dev_err(cpufreq->dev, "Failed to change pll_x to %lu\n", rate); - ret = clk_set_parent(cpu_clk, pll_x_clk); + ret = clk_set_parent(cpufreq->cpu_clk, cpufreq->pll_x_clk); /* This shouldn't fail while changing or restoring */ WARN_ON(ret); @@ -109,9 +116,9 @@ static int tegra_target(struct cpufreq_policy *policy, unsigned int index) * Drop count to pll_x clock only if we switched to intermediate freq * earlier while transitioning to a target frequency. */ - if (pll_x_prepared) { - clk_disable_unprepare(pll_x_clk); - pll_x_prepared = false; + if (cpufreq->pll_x_prepared) { + clk_disable_unprepare(cpufreq->pll_x_clk); + cpufreq->pll_x_prepared = false; } return ret; @@ -119,91 +126,111 @@ static int tegra_target(struct cpufreq_policy *policy, unsigned int index) static int tegra_cpu_init(struct cpufreq_policy *policy) { + struct tegra20_cpufreq *cpufreq = cpufreq_get_driver_data(); int ret; - clk_prepare_enable(cpu_clk); + clk_prepare_enable(cpufreq->cpu_clk); /* FIXME: what's the actual transition time? */ ret = cpufreq_generic_init(policy, freq_table, 300 * 1000); if (ret) { - clk_disable_unprepare(cpu_clk); + clk_disable_unprepare(cpufreq->cpu_clk); return ret; } - policy->clk = cpu_clk; + policy->clk = cpufreq->cpu_clk; policy->suspend_freq = freq_table[0].frequency; return 0; } static int tegra_cpu_exit(struct cpufreq_policy *policy) { - clk_disable_unprepare(cpu_clk); + struct tegra20_cpufreq *cpufreq = cpufreq_get_driver_data(); + + clk_disable_unprepare(cpufreq->cpu_clk); return 0; } -static struct cpufreq_driver tegra_cpufreq_driver = { - .flags = CPUFREQ_NEED_INITIAL_FREQ_CHECK, - .verify = cpufreq_generic_frequency_table_verify, - .get_intermediate = tegra_get_intermediate, - .target_intermediate = tegra_target_intermediate, - .target_index = tegra_target, - .get = cpufreq_generic_get, - .init = tegra_cpu_init, - .exit = tegra_cpu_exit, - .name = "tegra", - .attr = cpufreq_generic_attr, - .suspend = cpufreq_generic_suspend, -}; - -static int __init tegra_cpufreq_init(void) +static int tegra20_cpufreq_probe(struct platform_device *pdev) { + struct tegra20_cpufreq *cpufreq; int err; - if (!of_machine_is_compatible("nvidia,tegra20")) - return -ENODEV; + cpufreq = devm_kzalloc(&pdev->dev, sizeof(*cpufreq), GFP_KERNEL); + if (!cpufreq) + return -ENOMEM; - cpu_clk = clk_get_sys(NULL, "cclk"); - if (IS_ERR(cpu_clk)) - return PTR_ERR(cpu_clk); + cpufreq->cpu_clk = clk_get_sys(NULL, "cclk"); + if (IS_ERR(cpufreq->cpu_clk)) + return PTR_ERR(cpufreq->cpu_clk); - pll_x_clk = clk_get_sys(NULL, "pll_x"); - if (IS_ERR(pll_x_clk)) { - err = PTR_ERR(pll_x_clk); + cpufreq->pll_x_clk = clk_get_sys(NULL, "pll_x"); + if (IS_ERR(cpufreq->pll_x_clk)) { + err = PTR_ERR(cpufreq->pll_x_clk); goto put_cpu; } - pll_p_clk = clk_get_sys(NULL, "pll_p"); - if (IS_ERR(pll_p_clk)) { - err = PTR_ERR(pll_p_clk); + cpufreq->pll_p_clk = clk_get_sys(NULL, "pll_p"); + if (IS_ERR(cpufreq->pll_p_clk)) { + err = PTR_ERR(cpufreq->pll_p_clk); goto put_pll_x; } - err = cpufreq_register_driver(&tegra_cpufreq_driver); + cpufreq->dev = &pdev->dev; + cpufreq->driver.get = cpufreq_generic_get; + cpufreq->driver.attr = cpufreq_generic_attr; + cpufreq->driver.init = tegra_cpu_init; + cpufreq->driver.exit = tegra_cpu_exit; + cpufreq->driver.flags = CPUFREQ_NEED_INITIAL_FREQ_CHECK; + cpufreq->driver.verify = cpufreq_generic_frequency_table_verify; + cpufreq->driver.suspend = cpufreq_generic_suspend; + cpufreq->driver.driver_data = cpufreq; + cpufreq->driver.target_index = tegra_target; + cpufreq->driver.get_intermediate = tegra_get_intermediate; + cpufreq->driver.target_intermediate = tegra_target_intermediate; + snprintf(cpufreq->driver.name, CPUFREQ_NAME_LEN, "tegra"); + + err = cpufreq_register_driver(&cpufreq->driver); if (err) goto put_pll_p; + platform_set_drvdata(pdev, cpufreq); + return 0; put_pll_p: - clk_put(pll_p_clk); + clk_put(cpufreq->pll_p_clk); put_pll_x: - clk_put(pll_x_clk); + clk_put(cpufreq->pll_x_clk); put_cpu: - clk_put(cpu_clk); + clk_put(cpufreq->cpu_clk); return err; } -static void __exit tegra_cpufreq_exit(void) +static int tegra20_cpufreq_remove(struct platform_device *pdev) { - cpufreq_unregister_driver(&tegra_cpufreq_driver); - clk_put(pll_p_clk); - clk_put(pll_x_clk); - clk_put(cpu_clk); + struct tegra20_cpufreq *cpufreq = platform_get_drvdata(pdev); + + cpufreq_unregister_driver(&cpufreq->driver); + + clk_put(cpufreq->pll_p_clk); + clk_put(cpufreq->pll_x_clk); + clk_put(cpufreq->cpu_clk); + + return 0; } +static struct platform_driver tegra20_cpufreq_driver = { + .probe = tegra20_cpufreq_probe, + .remove = tegra20_cpufreq_remove, + .driver = { + .name = "tegra20-cpufreq", + }, +}; +module_platform_driver(tegra20_cpufreq_driver); + +MODULE_ALIAS("platform:tegra20-cpufreq"); MODULE_AUTHOR("Colin Cross "); MODULE_DESCRIPTION("NVIDIA Tegra20 cpufreq driver"); MODULE_LICENSE("GPL"); -module_init(tegra_cpufreq_init); -module_exit(tegra_cpufreq_exit);