From: Russell King - ARM Linux <linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org>
To: Vitaly Wool <vitalywool-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
Kevin Wells <kevin.wells-3arQi8VN3Tc@public.gmane.org>
Cc: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: [PATCH 07/10] ARM: PNX4008: move i2c suspend/resume callbacks into driver
Date: Fri, 20 Nov 2009 10:50:34 +0000 [thread overview]
Message-ID: <E1NBUkU-0004Pm-Nv@rmk-PC.arm.linux.org.uk> (raw)
In-Reply-To: <20091120144422.GA18223-l+eeeJia6m9vn6HldHNs0ANdhmdF6hFW@public.gmane.org>
Signed-off-by: Russell King <rmk+kernel-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org>
---
arch/arm/mach-pnx4008/i2c.c | 24 ------------------------
drivers/i2c/busses/i2c-pnx.c | 9 +++++++--
include/linux/i2c-pnx.h | 4 ----
3 files changed, 7 insertions(+), 30 deletions(-)
diff --git a/arch/arm/mach-pnx4008/i2c.c b/arch/arm/mach-pnx4008/i2c.c
index c986b3a..707d819 100644
--- a/arch/arm/mach-pnx4008/i2c.c
+++ b/arch/arm/mach-pnx4008/i2c.c
@@ -48,24 +48,6 @@ static int set_clock_stop(struct platform_device *pdev)
return retval;
}
-static int i2c_pnx_suspend(struct platform_device *pdev, pm_message_t state)
-{
- int retval = 0;
-#ifdef CONFIG_PM
- retval = set_clock_run(pdev);
-#endif
- return retval;
-}
-
-static int i2c_pnx_resume(struct platform_device *pdev)
-{
- int retval = 0;
-#ifdef CONFIG_PM
- retval = set_clock_run(pdev);
-#endif
- return retval;
-}
-
static u32 calculate_input_freq(struct platform_device *pdev)
{
return HCLK_MHZ;
@@ -102,8 +84,6 @@ static struct i2c_adapter pnx_adapter2 = {
};
static struct i2c_pnx_data i2c0_data = {
- .suspend = i2c_pnx_suspend,
- .resume = i2c_pnx_resume,
.calculate_input_freq = calculate_input_freq,
.set_clock_run = set_clock_run,
.set_clock_stop = set_clock_stop,
@@ -111,8 +91,6 @@ static struct i2c_pnx_data i2c0_data = {
};
static struct i2c_pnx_data i2c1_data = {
- .suspend = i2c_pnx_suspend,
- .resume = i2c_pnx_resume,
.calculate_input_freq = calculate_input_freq,
.set_clock_run = set_clock_run,
.set_clock_stop = set_clock_stop,
@@ -120,8 +98,6 @@ static struct i2c_pnx_data i2c1_data = {
};
static struct i2c_pnx_data i2c2_data = {
- .suspend = i2c_pnx_suspend,
- .resume = i2c_pnx_resume,
.calculate_input_freq = calculate_input_freq,
.set_clock_run = set_clock_run,
.set_clock_stop = set_clock_stop,
diff --git a/drivers/i2c/busses/i2c-pnx.c b/drivers/i2c/busses/i2c-pnx.c
index 1fca590..8fe7de8 100644
--- a/drivers/i2c/busses/i2c-pnx.c
+++ b/drivers/i2c/busses/i2c-pnx.c
@@ -545,18 +545,23 @@ static struct i2c_algorithm pnx_algorithm = {
.functionality = i2c_pnx_func,
};
+#ifdef CONFIG_PM
static int i2c_pnx_controller_suspend(struct platform_device *pdev,
pm_message_t state)
{
struct i2c_pnx_data *i2c_pnx = platform_get_drvdata(pdev);
- return i2c_pnx->suspend(pdev, state);
+ return i2c_pnx->set_clock_run(pdev);
}
static int i2c_pnx_controller_resume(struct platform_device *pdev)
{
struct i2c_pnx_data *i2c_pnx = platform_get_drvdata(pdev);
- return i2c_pnx->resume(pdev);
+ return i2c_pnx->set_clock_run(pdev);
}
+#else
+#define i2c_pnx_controller_suspend NULL
+#define i2c_pnx_controller_resume NULL
+#endif
static int __devinit i2c_pnx_probe(struct platform_device *pdev)
{
diff --git a/include/linux/i2c-pnx.h b/include/linux/i2c-pnx.h
index 9eb07bb..71de7f9 100644
--- a/include/linux/i2c-pnx.h
+++ b/include/linux/i2c-pnx.h
@@ -12,8 +12,6 @@
#ifndef __I2C_PNX_H__
#define __I2C_PNX_H__
-#include <linux/pm.h>
-
struct platform_device;
struct i2c_pnx_mif {
@@ -34,8 +32,6 @@ struct i2c_pnx_algo_data {
};
struct i2c_pnx_data {
- int (*suspend) (struct platform_device *pdev, pm_message_t state);
- int (*resume) (struct platform_device *pdev);
u32 (*calculate_input_freq) (struct platform_device *pdev);
int (*set_clock_run) (struct platform_device *pdev);
int (*set_clock_stop) (struct platform_device *pdev);
--
1.6.2.5
next prev parent reply other threads:[~2009-11-20 10:50 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-20 14:44 [PATCH 0/10] PNX clock API fixes Russell King - ARM Linux
[not found] ` <20091120144422.GA18223-l+eeeJia6m9vn6HldHNs0ANdhmdF6hFW@public.gmane.org>
2009-11-20 10:46 ` [PATCH 06/10] ARM: PNX4008: convert i2c clocks to match by device only Russell King - ARM Linux
2009-11-20 10:50 ` Russell King - ARM Linux [this message]
[not found] ` <E1NBUkU-0004Pm-Nv-eh5Bv4kxaXIANfyc6IWni62ZND6+EDdj@public.gmane.org>
2009-11-21 12:53 ` [PATCH 07/10] ARM: PNX4008: move i2c suspend/resume callbacks into driver Russell King - ARM Linux
2009-11-23 18:22 ` Vitaly Wool
2009-11-21 17:27 ` Linus Walleij
[not found] ` <63386a3d0911210927u47c7d6d6i65fc7d60563f8db2-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2009-11-21 18:59 ` Russell King - ARM Linux
[not found] ` <20091121185947.GD13956-l+eeeJia6m9vn6HldHNs0ANdhmdF6hFW@public.gmane.org>
2009-11-23 17:30 ` Kevin Wells
2009-11-25 21:19 ` Kevin Wells
[not found] ` <083DF309106F364B939360100EC290F804F55C9221-SIPbe8o7cfX8DdpCu65jn8FrZmdRls4ZQQ4Iyu8u01E@public.gmane.org>
2009-12-14 23:06 ` Russell King - ARM Linux
[not found] ` <20091214230655.GB16953-l+eeeJia6m9vn6HldHNs0ANdhmdF6hFW@public.gmane.org>
2009-12-15 0:16 ` Kevin Wells
2009-11-20 11:12 ` [PATCH 08/10] ARM: PNX4008: move i2c clock start/stop " Russell King - ARM Linux
2009-11-20 11:44 ` [PATCH 09/10] ARM: PNX4008: convert i2c-pnx to use clk API enable/disable calls Russell King - ARM Linux
2009-11-20 12:46 ` [PATCH 10/10] ARM: PNX4008: get i2c clock rate from clk API Russell King - ARM Linux
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=E1NBUkU-0004Pm-Nv@rmk-PC.arm.linux.org.uk \
--to=linux-lfz/pmaqli7xmaaqvzeohq@public.gmane.org \
--cc=kevin.wells-3arQi8VN3Tc@public.gmane.org \
--cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
--cc=linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=vitalywool-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).