diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2009-11-20 05:50:34 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2010-02-12 12:32:38 -0500 |
commit | a0dcf19f59d4f37150a6b7e115925d72aca15293 (patch) | |
tree | 589b1526ee3ca19000cafbcacf05779aa6e9d022 | |
parent | bba2be480b981bc1e7bea24c2a2552b0ad7e9774 (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.c | 24 | ||||
-rw-r--r-- | drivers/i2c/busses/i2c-pnx.c | 9 | ||||
-rw-r--r-- | 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 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 | ||
51 | static 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 | |||
60 | static 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 | |||
69 | static u32 calculate_input_freq(struct platform_device *pdev) | 51 | static 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 | ||
104 | static struct i2c_pnx_data i2c0_data = { | 86 | static 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 | ||
113 | static struct i2c_pnx_data i2c1_data = { | 93 | static 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 | ||
122 | static struct i2c_pnx_data i2c2_data = { | 100 | static 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 | ||
548 | static int i2c_pnx_controller_suspend(struct platform_device *pdev, | 549 | static 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 | ||
555 | static int i2c_pnx_controller_resume(struct platform_device *pdev) | 556 | static 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 | ||
561 | static int __devinit i2c_pnx_probe(struct platform_device *pdev) | 566 | static 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 | |||
17 | struct platform_device; | 15 | struct platform_device; |
18 | 16 | ||
19 | struct i2c_pnx_mif { | 17 | struct i2c_pnx_mif { |
@@ -34,8 +32,6 @@ struct i2c_pnx_algo_data { | |||
34 | }; | 32 | }; |
35 | 33 | ||
36 | struct i2c_pnx_data { | 34 | struct 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); |