From patchwork Tue Oct 15 06:23:52 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naveen Krishna Ch X-Patchwork-Id: 283490 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 727B02C014B for ; Tue, 15 Oct 2013 17:22:16 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752393Ab3JOGVu (ORCPT ); Tue, 15 Oct 2013 02:21:50 -0400 Received: from mailout3.samsung.com ([203.254.224.33]:36826 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751603Ab3JOGVs (ORCPT ); Tue, 15 Oct 2013 02:21:48 -0400 Received: from epcpsbgr5.samsung.com (u145.gpu120.samsung.co.kr [203.254.230.145]) by mailout3.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MUP00E495OAOB40@mailout3.samsung.com>; Tue, 15 Oct 2013 15:21:47 +0900 (KST) Received: from epcpsbgm2.samsung.com ( [172.20.52.124]) by epcpsbgr5.samsung.com (EPCPMTA) with SMTP id 59.55.02244.AFEDC525; Tue, 15 Oct 2013 15:21:46 +0900 (KST) X-AuditID: cbfee691-b7fe06d0000008c4-22-525cdefa2e14 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id DF.14.05832.AFEDC525; Tue, 15 Oct 2013 15:21:46 +0900 (KST) Received: from naveen-linux.sisodomain.com ([107.108.83.161]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MUP00C125O4C600@mmp1.samsung.com>; Tue, 15 Oct 2013 15:21:46 +0900 (KST) From: Naveen Krishna Chatradhi To: linux-i2c@vger.kernel.org Cc: t.figa@samsung.com, sjg@chromium.org, linux-kernel@vger.kernel.org, linux-samsung-soc@vger.kernel.org, wsa@the-dreams.de, ben-linux@fluff.org, grant.likely@secretlab.ca, broonie@kernel.org, dianders@chromium.org, cpgs@samsung.com Subject: [PATCH v2] i2c: s3c2410: dont need CPU_FREQ transitions for exynos series Date: Tue, 15 Oct 2013 11:53:52 +0530 Message-id: <1381818232-12542-1-git-send-email-ch.naveen@samsung.com> X-Mailer: git-send-email 1.7.10.4 In-reply-to: <1381490814-20890-1-git-send-email-ch.naveen@samsung.com> References: <1381490814-20890-1-git-send-email-ch.naveen@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprEIsWRmVeSWpSXmKPExsWyRsSkRvfXvZgggwn/DS0mrTvAZDH14RM2 i5eHNC3OLjvIZvHqzEY2i46/XxgtLu+aw2Yx4/w+JotvW7YxWqyf8ZrFYuWJWcwO3B6zGy6y ePxd9YLZY9OqTjaPvi2rGD1+vtTxOHnqCYvH501yAexRXDYpqTmZZalF+nYJXBk9cw6wFpzk rrjYM4OpgfEMZxcjJ4eEgInEhbdr2SBsMYkL99YD2VwcQgJLGSXeTVnLBFN0bvpfdojEIkaJ rkmtjBBOD5PErTvtLCBVbAJmEgcXrWYHsUUEZCVaH6xhBrGZBd4zSpzq0AGxhQVCJKbdOw+2 jkVAVaLvUSsriM0r4Crx4/dERohtihLdzyaA1XAKuEm87zoIFOcAWuYq0X1dDWSvhMAxdok9 Z2cxQcwRkPg2+RALSI0E0N5NB5ghxkhKHFxxg2UCo/ACRoZVjKKpBckFxUnpRaZ6xYm5xaV5 6XrJ+bmbGIHxcfrfs4k7GO8fsD7EmAw0biKzlGhyPjC+8kriDY3NjCxMTUyNjcwtzUgTVhLn VW+xDhQSSE8sSc1OTS1ILYovKs1JLT7EyMTBKdXAuCOpPFVC/f+Pb9fri111z76Smbd9XdAi mY6lv3kbum5lvwybcjRc5ONUbu4oYf+Twp3TXrl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ter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Sender: linux-i2c-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org For Exynos4 and Exynos5 SoCs from Samsung the i2c clock is based on a fixed 66 MHz peripheral clock, and therefore is completely independent of the cpu frequency. Thus, registering for a CPU freq notifier is very wasteful. This patch modifes the code such that, i2c bus registers to cpu_freq_transition only if CONFIG_CPU_FREQ_S3C24XX is enabled. This change should save a bunch of cpufreq transitions calls which does not apply to exynos SoCs. Signed-off-by: Naveen Krishna Chatradhi Acked-by: Kyungmin Park Reviewed-by: Doug Anderson --- Changes since v1: Use CONFIG_CPU_FREQ_S3C24XX instead of (CONFIG_CPU_FREQ & !CONFIG_EXYNOS) As commented by Tomasz drivers/i2c/busses/i2c-s3c2410.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/i2c/busses/i2c-s3c2410.c b/drivers/i2c/busses/i2c-s3c2410.c index cab1c91..97f14f7 100644 --- a/drivers/i2c/busses/i2c-s3c2410.c +++ b/drivers/i2c/busses/i2c-s3c2410.c @@ -123,7 +123,7 @@ struct s3c24xx_i2c { struct s3c2410_platform_i2c *pdata; int gpios[2]; struct pinctrl *pctrl; -#ifdef CONFIG_CPU_FREQ +#if defined(CONFIG_CPU_FREQ_S3C24XX) struct notifier_block freq_transition; #endif }; @@ -843,7 +843,7 @@ static int s3c24xx_i2c_clockrate(struct s3c24xx_i2c *i2c, unsigned int *got) return 0; } -#ifdef CONFIG_CPU_FREQ +#if defined(CONFIG_CPU_FREQ_S3C24XX) #define freq_to_i2c(_n) container_of(_n, struct s3c24xx_i2c, freq_transition)