aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms/52xx
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/52xx
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/52xx')
-rw-r--r--arch/powerpc/platforms/52xx/lite5200.c1
-rw-r--r--arch/powerpc/platforms/52xx/mpc52xx_gpio.c36
-rw-r--r--arch/powerpc/platforms/52xx/mpc52xx_gpt.c33
-rw-r--r--arch/powerpc/platforms/52xx/mpc52xx_lpbfifo.c6
4 files changed, 36 insertions, 40 deletions
diff --git a/arch/powerpc/platforms/52xx/lite5200.c b/arch/powerpc/platforms/52xx/lite5200.c
index 6d584f4e3c9a..de55bc0584b5 100644
--- a/arch/powerpc/platforms/52xx/lite5200.c
+++ b/arch/powerpc/platforms/52xx/lite5200.c
@@ -18,6 +18,7 @@
18#include <linux/init.h> 18#include <linux/init.h>
19#include <linux/pci.h> 19#include <linux/pci.h>
20#include <linux/of.h> 20#include <linux/of.h>
21#include <linux/of_address.h>
21#include <linux/root_dev.h> 22#include <linux/root_dev.h>
22#include <linux/initrd.h> 23#include <linux/initrd.h>
23#include <asm/time.h> 24#include <asm/time.h>
diff --git a/arch/powerpc/platforms/52xx/mpc52xx_gpio.c b/arch/powerpc/platforms/52xx/mpc52xx_gpio.c
index ca5305a5bd61..0dad9a935eb5 100644
--- a/arch/powerpc/platforms/52xx/mpc52xx_gpio.c
+++ b/arch/powerpc/platforms/52xx/mpc52xx_gpio.c
@@ -147,26 +147,25 @@ mpc52xx_wkup_gpio_dir_out(struct gpio_chip *gc, unsigned int gpio, int val)
147 return 0; 147 return 0;
148} 148}
149 149
150static int __devinit mpc52xx_wkup_gpiochip_probe(struct of_device *ofdev, 150static int __devinit mpc52xx_wkup_gpiochip_probe(struct platform_device *ofdev,
151 const struct of_device_id *match) 151 const struct of_device_id *match)
152{ 152{
153 struct mpc52xx_gpiochip *chip; 153 struct mpc52xx_gpiochip *chip;
154 struct mpc52xx_gpio_wkup __iomem *regs; 154 struct mpc52xx_gpio_wkup __iomem *regs;
155 struct of_gpio_chip *ofchip; 155 struct gpio_chip *gc;
156 int ret; 156 int ret;
157 157
158 chip = kzalloc(sizeof(*chip), GFP_KERNEL); 158 chip = kzalloc(sizeof(*chip), GFP_KERNEL);
159 if (!chip) 159 if (!chip)
160 return -ENOMEM; 160 return -ENOMEM;
161 161
162 ofchip = &chip->mmchip.of_gc; 162 gc = &chip->mmchip.gc;
163 163
164 ofchip->gpio_cells = 2; 164 gc->ngpio = 8;
165 ofchip->gc.ngpio = 8; 165 gc->direction_input = mpc52xx_wkup_gpio_dir_in;
166 ofchip->gc.direction_input = mpc52xx_wkup_gpio_dir_in; 166 gc->direction_output = mpc52xx_wkup_gpio_dir_out;
167 ofchip->gc.direction_output = mpc52xx_wkup_gpio_dir_out; 167 gc->get = mpc52xx_wkup_gpio_get;
168 ofchip->gc.get = mpc52xx_wkup_gpio_get; 168 gc->set = mpc52xx_wkup_gpio_set;
169 ofchip->gc.set = mpc52xx_wkup_gpio_set;
170 169
171 ret = of_mm_gpiochip_add(ofdev->dev.of_node, &chip->mmchip); 170 ret = of_mm_gpiochip_add(ofdev->dev.of_node, &chip->mmchip);
172 if (ret) 171 if (ret)
@@ -180,7 +179,7 @@ static int __devinit mpc52xx_wkup_gpiochip_probe(struct of_device *ofdev,
180 return 0; 179 return 0;
181} 180}
182 181
183static int mpc52xx_gpiochip_remove(struct of_device *ofdev) 182static int mpc52xx_gpiochip_remove(struct platform_device *ofdev)
184{ 183{
185 return -EBUSY; 184 return -EBUSY;
186} 185}
@@ -311,11 +310,11 @@ mpc52xx_simple_gpio_dir_out(struct gpio_chip *gc, unsigned int gpio, int val)
311 return 0; 310 return 0;
312} 311}
313 312
314static int __devinit mpc52xx_simple_gpiochip_probe(struct of_device *ofdev, 313static int __devinit mpc52xx_simple_gpiochip_probe(struct platform_device *ofdev,
315 const struct of_device_id *match) 314 const struct of_device_id *match)
316{ 315{
317 struct mpc52xx_gpiochip *chip; 316 struct mpc52xx_gpiochip *chip;
318 struct of_gpio_chip *ofchip; 317 struct gpio_chip *gc;
319 struct mpc52xx_gpio __iomem *regs; 318 struct mpc52xx_gpio __iomem *regs;
320 int ret; 319 int ret;
321 320
@@ -323,14 +322,13 @@ static int __devinit mpc52xx_simple_gpiochip_probe(struct of_device *ofdev,
323 if (!chip) 322 if (!chip)
324 return -ENOMEM; 323 return -ENOMEM;
325 324
326 ofchip = &chip->mmchip.of_gc; 325 gc = &chip->mmchip.gc;
327 326
328 ofchip->gpio_cells = 2; 327 gc->ngpio = 32;
329 ofchip->gc.ngpio = 32; 328 gc->direction_input = mpc52xx_simple_gpio_dir_in;
330 ofchip->gc.direction_input = mpc52xx_simple_gpio_dir_in; 329 gc->direction_output = mpc52xx_simple_gpio_dir_out;
331 ofchip->gc.direction_output = mpc52xx_simple_gpio_dir_out; 330 gc->get = mpc52xx_simple_gpio_get;
332 ofchip->gc.get = mpc52xx_simple_gpio_get; 331 gc->set = mpc52xx_simple_gpio_set;
333 ofchip->gc.set = mpc52xx_simple_gpio_set;
334 332
335 ret = of_mm_gpiochip_add(ofdev->dev.of_node, &chip->mmchip); 333 ret = of_mm_gpiochip_add(ofdev->dev.of_node, &chip->mmchip);
336 if (ret) 334 if (ret)
diff --git a/arch/powerpc/platforms/52xx/mpc52xx_gpt.c b/arch/powerpc/platforms/52xx/mpc52xx_gpt.c
index 46c93578cbf0..fea833e18ad5 100644
--- a/arch/powerpc/platforms/52xx/mpc52xx_gpt.c
+++ b/arch/powerpc/platforms/52xx/mpc52xx_gpt.c
@@ -78,7 +78,7 @@ MODULE_LICENSE("GPL");
78 * @dev: pointer to device structure 78 * @dev: pointer to device structure
79 * @regs: virtual address of GPT registers 79 * @regs: virtual address of GPT registers
80 * @lock: spinlock to coordinate between different functions. 80 * @lock: spinlock to coordinate between different functions.
81 * @of_gc: of_gpio_chip instance structure; used when GPIO is enabled 81 * @gc: gpio_chip instance structure; used when GPIO is enabled
82 * @irqhost: Pointer to irq_host instance; used when IRQ mode is supported 82 * @irqhost: Pointer to irq_host instance; used when IRQ mode is supported
83 * @wdt_mode: only relevant for gpt0: bit 0 (MPC52xx_GPT_CAN_WDT) indicates 83 * @wdt_mode: only relevant for gpt0: bit 0 (MPC52xx_GPT_CAN_WDT) indicates
84 * if the gpt may be used as wdt, bit 1 (MPC52xx_GPT_IS_WDT) indicates 84 * if the gpt may be used as wdt, bit 1 (MPC52xx_GPT_IS_WDT) indicates
@@ -94,7 +94,7 @@ struct mpc52xx_gpt_priv {
94 u8 wdt_mode; 94 u8 wdt_mode;
95 95
96#if defined(CONFIG_GPIOLIB) 96#if defined(CONFIG_GPIOLIB)
97 struct of_gpio_chip of_gc; 97 struct gpio_chip gc;
98#endif 98#endif
99}; 99};
100 100
@@ -280,7 +280,7 @@ mpc52xx_gpt_irq_setup(struct mpc52xx_gpt_priv *gpt, struct device_node *node)
280#if defined(CONFIG_GPIOLIB) 280#if defined(CONFIG_GPIOLIB)
281static inline struct mpc52xx_gpt_priv *gc_to_mpc52xx_gpt(struct gpio_chip *gc) 281static inline struct mpc52xx_gpt_priv *gc_to_mpc52xx_gpt(struct gpio_chip *gc)
282{ 282{
283 return container_of(to_of_gpio_chip(gc), struct mpc52xx_gpt_priv,of_gc); 283 return container_of(gc, struct mpc52xx_gpt_priv, gc);
284} 284}
285 285
286static int mpc52xx_gpt_gpio_get(struct gpio_chip *gc, unsigned int gpio) 286static int mpc52xx_gpt_gpio_get(struct gpio_chip *gc, unsigned int gpio)
@@ -336,28 +336,25 @@ mpc52xx_gpt_gpio_setup(struct mpc52xx_gpt_priv *gpt, struct device_node *node)
336 if (!of_find_property(node, "gpio-controller", NULL)) 336 if (!of_find_property(node, "gpio-controller", NULL))
337 return; 337 return;
338 338
339 gpt->of_gc.gc.label = kstrdup(node->full_name, GFP_KERNEL); 339 gpt->gc.label = kstrdup(node->full_name, GFP_KERNEL);
340 if (!gpt->of_gc.gc.label) { 340 if (!gpt->gc.label) {
341 dev_err(gpt->dev, "out of memory\n"); 341 dev_err(gpt->dev, "out of memory\n");
342 return; 342 return;
343 } 343 }
344 344
345 gpt->of_gc.gpio_cells = 2; 345 gpt->gc.ngpio = 1;
346 gpt->of_gc.gc.ngpio = 1; 346 gpt->gc.direction_input = mpc52xx_gpt_gpio_dir_in;
347 gpt->of_gc.gc.direction_input = mpc52xx_gpt_gpio_dir_in; 347 gpt->gc.direction_output = mpc52xx_gpt_gpio_dir_out;
348 gpt->of_gc.gc.direction_output = mpc52xx_gpt_gpio_dir_out; 348 gpt->gc.get = mpc52xx_gpt_gpio_get;
349 gpt->of_gc.gc.get = mpc52xx_gpt_gpio_get; 349 gpt->gc.set = mpc52xx_gpt_gpio_set;
350 gpt->of_gc.gc.set = mpc52xx_gpt_gpio_set; 350 gpt->gc.base = -1;
351 gpt->of_gc.gc.base = -1; 351 gpt->gc.of_node = node;
352 gpt->of_gc.xlate = of_gpio_simple_xlate;
353 node->data = &gpt->of_gc;
354 of_node_get(node);
355 352
356 /* Setup external pin in GPIO mode */ 353 /* Setup external pin in GPIO mode */
357 clrsetbits_be32(&gpt->regs->mode, MPC52xx_GPT_MODE_MS_MASK, 354 clrsetbits_be32(&gpt->regs->mode, MPC52xx_GPT_MODE_MS_MASK,
358 MPC52xx_GPT_MODE_MS_GPIO); 355 MPC52xx_GPT_MODE_MS_GPIO);
359 356
360 rc = gpiochip_add(&gpt->of_gc.gc); 357 rc = gpiochip_add(&gpt->gc);
361 if (rc) 358 if (rc)
362 dev_err(gpt->dev, "gpiochip_add() failed; rc=%i\n", rc); 359 dev_err(gpt->dev, "gpiochip_add() failed; rc=%i\n", rc);
363 360
@@ -723,7 +720,7 @@ static inline int mpc52xx_gpt_wdt_setup(struct mpc52xx_gpt_priv *gpt,
723/* --------------------------------------------------------------------- 720/* ---------------------------------------------------------------------
724 * of_platform bus binding code 721 * of_platform bus binding code
725 */ 722 */
726static int __devinit mpc52xx_gpt_probe(struct of_device *ofdev, 723static int __devinit mpc52xx_gpt_probe(struct platform_device *ofdev,
727 const struct of_device_id *match) 724 const struct of_device_id *match)
728{ 725{
729 struct mpc52xx_gpt_priv *gpt; 726 struct mpc52xx_gpt_priv *gpt;
@@ -769,7 +766,7 @@ static int __devinit mpc52xx_gpt_probe(struct of_device *ofdev,
769 return 0; 766 return 0;
770} 767}
771 768
772static int mpc52xx_gpt_remove(struct of_device *ofdev) 769static int mpc52xx_gpt_remove(struct platform_device *ofdev)
773{ 770{
774 return -EBUSY; 771 return -EBUSY;
775} 772}
diff --git a/arch/powerpc/platforms/52xx/mpc52xx_lpbfifo.c b/arch/powerpc/platforms/52xx/mpc52xx_lpbfifo.c
index e86aec644501..f4ac213c89c0 100644
--- a/arch/powerpc/platforms/52xx/mpc52xx_lpbfifo.c
+++ b/arch/powerpc/platforms/52xx/mpc52xx_lpbfifo.c
@@ -436,8 +436,8 @@ void mpc52xx_lpbfifo_abort(struct mpc52xx_lpbfifo_request *req)
436} 436}
437EXPORT_SYMBOL(mpc52xx_lpbfifo_abort); 437EXPORT_SYMBOL(mpc52xx_lpbfifo_abort);
438 438
439static int __devinit 439static int __devinit mpc52xx_lpbfifo_probe(struct platform_device *op,
440mpc52xx_lpbfifo_probe(struct of_device *op, const struct of_device_id *match) 440 const struct of_device_id *match)
441{ 441{
442 struct resource res; 442 struct resource res;
443 int rc = -ENOMEM; 443 int rc = -ENOMEM;
@@ -507,7 +507,7 @@ mpc52xx_lpbfifo_probe(struct of_device *op, const struct of_device_id *match)
507} 507}
508 508
509 509
510static int __devexit mpc52xx_lpbfifo_remove(struct of_device *op) 510static int __devexit mpc52xx_lpbfifo_remove(struct platform_device *op)
511{ 511{
512 if (lpbfifo.dev != &op->dev) 512 if (lpbfifo.dev != &op->dev)
513 return 0; 513 return 0;