aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2009-11-20 05:50:34 -0500
committerRussell King <rmk+kernel@arm.linux.org.uk>2010-02-12 12:32:38 -0500
commita0dcf19f59d4f37150a6b7e115925d72aca15293 (patch)
tree589b1526ee3ca19000cafbcacf05779aa6e9d022
parentbba2be480b981bc1e7bea24c2a2552b0ad7e9774 (diff)
ARM: PNX4008: move i2c suspend/resume callbacks into driver
Acked-by: Vitaly Wool <vitalywool@gmail.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
-rw-r--r--arch/arm/mach-pnx4008/i2c.c24
-rw-r--r--drivers/i2c/busses/i2c-pnx.c9
-rw-r--r--include/linux/i2c-pnx.h4
3 files changed, 7 insertions, 30 deletions
diff --git a/arch/arm/mach-pnx4008/i2c.c b/arch/arm/mach-pnx4008/i2c.c
index c986b3a61311..707d819f1280 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)
48 return retval; 48 return retval;
49} 49}
50 50
51static int i2c_pnx_suspend(struct platform_device *pdev, pm_message_t state)
52{
53 int retval = 0;
54#ifdef CONFIG_PM
55 retval = set_clock_run(pdev);
56#endif
57 return retval;
58}
59
60static int i2c_pnx_resume(struct platform_device *pdev)
61{
62 int retval = 0;
63#ifdef CONFIG_PM
64 retval = set_clock_run(pdev);
65#endif
66 return retval;
67}
68
69static u32 calculate_input_freq(struct platform_device *pdev) 51static u32 calculate_input_freq(struct platform_device *pdev)
70{ 52{
71 return HCLK_MHZ; 53 return HCLK_MHZ;
@@ -102,8 +84,6 @@ static struct i2c_adapter pnx_adapter2 = {
102}; 84};
103 85
104static struct i2c_pnx_data i2c0_data = { 86static struct i2c_pnx_data i2c0_data = {
105 .suspend = i2c_pnx_suspend,
106 .resume = i2c_pnx_resume,
107 .calculate_input_freq = calculate_input_freq, 87 .calculate_input_freq = calculate_input_freq,
108 .set_clock_run = set_clock_run, 88 .set_clock_run = set_clock_run,
109 .set_clock_stop = set_clock_stop, 89 .set_clock_stop = set_clock_stop,
@@ -111,8 +91,6 @@ static struct i2c_pnx_data i2c0_data = {
111}; 91};
112 92
113static struct i2c_pnx_data i2c1_data = { 93static struct i2c_pnx_data i2c1_data = {
114 .suspend = i2c_pnx_suspend,
115 .resume = i2c_pnx_resume,
116 .calculate_input_freq = calculate_input_freq, 94 .calculate_input_freq = calculate_input_freq,
117 .set_clock_run = set_clock_run, 95 .set_clock_run = set_clock_run,
118 .set_clock_stop = set_clock_stop, 96 .set_clock_stop = set_clock_stop,
@@ -120,8 +98,6 @@ static struct i2c_pnx_data i2c1_data = {
120}; 98};
121 99
122static struct i2c_pnx_data i2c2_data = { 100static struct i2c_pnx_data i2c2_data = {
123 .suspend = i2c_pnx_suspend,
124 .resume = i2c_pnx_resume,
125 .calculate_input_freq = calculate_input_freq, 101 .calculate_input_freq = calculate_input_freq,
126 .set_clock_run = set_clock_run, 102 .set_clock_run = set_clock_run,
127 .set_clock_stop = set_clock_stop, 103 .set_clock_stop = set_clock_stop,
diff --git a/drivers/i2c/busses/i2c-pnx.c b/drivers/i2c/busses/i2c-pnx.c
index 5d1c2603a130..bc8075514e53 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 = {
545 .functionality = i2c_pnx_func, 545 .functionality = i2c_pnx_func,
546}; 546};
547 547
548#ifdef CONFIG_PM
548static int i2c_pnx_controller_suspend(struct platform_device *pdev, 549static int i2c_pnx_controller_suspend(struct platform_device *pdev,
549 pm_message_t state) 550 pm_message_t state)
550{ 551{
551 struct i2c_pnx_data *i2c_pnx = platform_get_drvdata(pdev); 552 struct i2c_pnx_data *i2c_pnx = platform_get_drvdata(pdev);
552 return i2c_pnx->suspend(pdev, state); 553 return i2c_pnx->set_clock_run(pdev);
553} 554}
554 555
555static int i2c_pnx_controller_resume(struct platform_device *pdev) 556static int i2c_pnx_controller_resume(struct platform_device *pdev)
556{ 557{
557 struct i2c_pnx_data *i2c_pnx = platform_get_drvdata(pdev); 558 struct i2c_pnx_data *i2c_pnx = platform_get_drvdata(pdev);
558 return i2c_pnx->resume(pdev); 559 return i2c_pnx->set_clock_run(pdev);
559} 560}
561#else
562#define i2c_pnx_controller_suspend NULL
563#define i2c_pnx_controller_resume NULL
564#endif
560 565
561static int __devinit i2c_pnx_probe(struct platform_device *pdev) 566static int __devinit i2c_pnx_probe(struct platform_device *pdev)
562{ 567{
diff --git a/include/linux/i2c-pnx.h b/include/linux/i2c-pnx.h
index 9eb07bbc6522..71de7f976adf 100644
--- a/include/linux/i2c-pnx.h
+++ b/include/linux/i2c-pnx.h
@@ -12,8 +12,6 @@
12#ifndef __I2C_PNX_H__ 12#ifndef __I2C_PNX_H__
13#define __I2C_PNX_H__ 13#define __I2C_PNX_H__
14 14
15#include <linux/pm.h>
16
17struct platform_device; 15struct platform_device;
18 16
19struct i2c_pnx_mif { 17struct i2c_pnx_mif {
@@ -34,8 +32,6 @@ struct i2c_pnx_algo_data {
34}; 32};
35 33
36struct i2c_pnx_data { 34struct i2c_pnx_data {
37 int (*suspend) (struct platform_device *pdev, pm_message_t state);
38 int (*resume) (struct platform_device *pdev);
39 u32 (*calculate_input_freq) (struct platform_device *pdev); 35 u32 (*calculate_input_freq) (struct platform_device *pdev);
40 int (*set_clock_run) (struct platform_device *pdev); 36 int (*set_clock_run) (struct platform_device *pdev);
41 int (*set_clock_stop) (struct platform_device *pdev); 37 int (*set_clock_stop) (struct platform_device *pdev);