aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms/83xx
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-08-05 18:57:35 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-08-05 18:57:35 -0400
commit03c0c29aff7e56b722eb6c47eace222b140d0377 (patch)
tree47267a19b523159cf36a050ef3c35f4dbdb33016 /arch/powerpc/platforms/83xx
parentc60c6a96b7bb0f1f8bb635fdfcf5b592aaf062b4 (diff)
parent7fb8f881c54beb05dd4d2c947dada1c636581d87 (diff)
Merge branch 'next-devicetree' of git://git.secretlab.ca/git/linux-2.6
* 'next-devicetree' of git://git.secretlab.ca/git/linux-2.6: (63 commits) of/platform: Register of_platform_drivers with an "of:" prefix of/address: Clean up function declarations of/spi: call of_register_spi_devices() from spi core code of: Provide default of_node_to_nid() implementation. of/device: Make of_device_make_bus_id() usable by other code. of/irq: Fix endian issues in parsing interrupt specifiers of: Fix phandle endian issues of/flattree: fix of_flat_dt_is_compatible() to match the full compatible string of: remove of_default_bus_ids of: make of_find_device_by_node generic microblaze: remove references to of_device and to_of_device sparc: remove references to of_device and to_of_device powerpc: remove references to of_device and to_of_device of/device: Replace of_device with platform_device in includes and core code of/device: Protect against binding of_platform_drivers to non-OF devices of: remove asm/of_device.h of: remove asm/of_platform.h of/platform: remove all of_bus_type and of_platform_bus_type references of: Merge of_platform_bus_type with platform_bus_type drivercore/of: Add OF style matching to platform bus ... Fix up trivial conflicts in arch/microblaze/kernel/Makefile due to just some obj-y removals by the devicetree branch, while the microblaze updates added a new file.
Diffstat (limited to 'arch/powerpc/platforms/83xx')
-rw-r--r--arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c40
-rw-r--r--arch/powerpc/platforms/83xx/suspend.c6
2 files changed, 15 insertions, 31 deletions
diff --git a/arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c b/arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c
index d119a7c1c17a..70798ac911ef 100644
--- a/arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c
+++ b/arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c
@@ -35,9 +35,8 @@
35 35
36struct mcu { 36struct mcu {
37 struct mutex lock; 37 struct mutex lock;
38 struct device_node *np;
39 struct i2c_client *client; 38 struct i2c_client *client;
40 struct of_gpio_chip of_gc; 39 struct gpio_chip gc;
41 u8 reg_ctrl; 40 u8 reg_ctrl;
42}; 41};
43 42
@@ -56,8 +55,7 @@ static void mcu_power_off(void)
56 55
57static void mcu_gpio_set(struct gpio_chip *gc, unsigned int gpio, int val) 56static void mcu_gpio_set(struct gpio_chip *gc, unsigned int gpio, int val)
58{ 57{
59 struct of_gpio_chip *of_gc = to_of_gpio_chip(gc); 58 struct mcu *mcu = container_of(gc, struct mcu, gc);
60 struct mcu *mcu = container_of(of_gc, struct mcu, of_gc);
61 u8 bit = 1 << (4 + gpio); 59 u8 bit = 1 << (4 + gpio);
62 60
63 mutex_lock(&mcu->lock); 61 mutex_lock(&mcu->lock);
@@ -79,9 +77,7 @@ static int mcu_gpio_dir_out(struct gpio_chip *gc, unsigned int gpio, int val)
79static int mcu_gpiochip_add(struct mcu *mcu) 77static int mcu_gpiochip_add(struct mcu *mcu)
80{ 78{
81 struct device_node *np; 79 struct device_node *np;
82 struct of_gpio_chip *of_gc = &mcu->of_gc; 80 struct gpio_chip *gc = &mcu->gc;
83 struct gpio_chip *gc = &of_gc->gc;
84 int ret;
85 81
86 np = of_find_compatible_node(NULL, NULL, "fsl,mcu-mpc8349emitx"); 82 np = of_find_compatible_node(NULL, NULL, "fsl,mcu-mpc8349emitx");
87 if (!np) 83 if (!np)
@@ -94,32 +90,14 @@ static int mcu_gpiochip_add(struct mcu *mcu)
94 gc->base = -1; 90 gc->base = -1;
95 gc->set = mcu_gpio_set; 91 gc->set = mcu_gpio_set;
96 gc->direction_output = mcu_gpio_dir_out; 92 gc->direction_output = mcu_gpio_dir_out;
97 of_gc->gpio_cells = 2; 93 gc->of_node = np;
98 of_gc->xlate = of_gpio_simple_xlate;
99 94
100 np->data = of_gc; 95 return gpiochip_add(gc);
101 mcu->np = np;
102
103 /*
104 * We don't want to lose the node, its ->data and ->full_name...
105 * So, if succeeded, we don't put the node here.
106 */
107 ret = gpiochip_add(gc);
108 if (ret)
109 of_node_put(np);
110 return ret;
111} 96}
112 97
113static int mcu_gpiochip_remove(struct mcu *mcu) 98static int mcu_gpiochip_remove(struct mcu *mcu)
114{ 99{
115 int ret; 100 return gpiochip_remove(&mcu->gc);
116
117 ret = gpiochip_remove(&mcu->of_gc.gc);
118 if (ret)
119 return ret;
120 of_node_put(mcu->np);
121
122 return 0;
123} 101}
124 102
125static int __devinit mcu_probe(struct i2c_client *client, 103static int __devinit mcu_probe(struct i2c_client *client,
@@ -182,10 +160,16 @@ static const struct i2c_device_id mcu_ids[] = {
182}; 160};
183MODULE_DEVICE_TABLE(i2c, mcu_ids); 161MODULE_DEVICE_TABLE(i2c, mcu_ids);
184 162
163static struct of_device_id mcu_of_match_table[] __devinitdata = {
164 { .compatible = "fsl,mcu-mpc8349emitx", },
165 { },
166};
167
185static struct i2c_driver mcu_driver = { 168static struct i2c_driver mcu_driver = {
186 .driver = { 169 .driver = {
187 .name = "mcu-mpc8349emitx", 170 .name = "mcu-mpc8349emitx",
188 .owner = THIS_MODULE, 171 .owner = THIS_MODULE,
172 .of_match_table = mcu_of_match_table,
189 }, 173 },
190 .probe = mcu_probe, 174 .probe = mcu_probe,
191 .remove = __devexit_p(mcu_remove), 175 .remove = __devexit_p(mcu_remove),
diff --git a/arch/powerpc/platforms/83xx/suspend.c b/arch/powerpc/platforms/83xx/suspend.c
index ebe6c3537209..75ae77f1af6a 100644
--- a/arch/powerpc/platforms/83xx/suspend.c
+++ b/arch/powerpc/platforms/83xx/suspend.c
@@ -99,7 +99,7 @@ struct pmc_type {
99 int has_deep_sleep; 99 int has_deep_sleep;
100}; 100};
101 101
102static struct of_device *pmc_dev; 102static struct platform_device *pmc_dev;
103static int has_deep_sleep, deep_sleeping; 103static int has_deep_sleep, deep_sleeping;
104static int pmc_irq; 104static int pmc_irq;
105static struct mpc83xx_pmc __iomem *pmc_regs; 105static struct mpc83xx_pmc __iomem *pmc_regs;
@@ -318,7 +318,7 @@ static struct platform_suspend_ops mpc83xx_suspend_ops = {
318 .end = mpc83xx_suspend_end, 318 .end = mpc83xx_suspend_end,
319}; 319};
320 320
321static int pmc_probe(struct of_device *ofdev, 321static int pmc_probe(struct platform_device *ofdev,
322 const struct of_device_id *match) 322 const struct of_device_id *match)
323{ 323{
324 struct device_node *np = ofdev->dev.of_node; 324 struct device_node *np = ofdev->dev.of_node;
@@ -396,7 +396,7 @@ out:
396 return ret; 396 return ret;
397} 397}
398 398
399static int pmc_remove(struct of_device *ofdev) 399static int pmc_remove(struct platform_device *ofdev)
400{ 400{
401 return -EPERM; 401 return -EPERM;
402}; 402};