aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpio
diff options
context:
space:
mode:
authorMichal Simek <monstr@monstr.eu>2010-09-29 01:52:12 -0400
committerGrant Likely <grant.likely@secretlab.ca>2010-09-29 02:28:08 -0400
commita04e78b8579272c37c42a9badb6dae71f38fe4a9 (patch)
tree9d68419ada3b3d457237f9ad67e82e3d9340fd97 /drivers/gpio
parent899611ee7d373e5eeda08e9a8632684e1ebbbf00 (diff)
of: GPIO: Fix OF probing on little-endian systems
DTB is always big-endian that's why is necessary to convert it. Signed-off-by: Michal Simek <monstr@monstr.eu> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Diffstat (limited to 'drivers/gpio')
-rw-r--r--drivers/gpio/xilinx_gpio.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/gpio/xilinx_gpio.c b/drivers/gpio/xilinx_gpio.c
index 709690995d0d..846fbd5e31bf 100644
--- a/drivers/gpio/xilinx_gpio.c
+++ b/drivers/gpio/xilinx_gpio.c
@@ -171,13 +171,13 @@ static int __devinit xgpio_of_probe(struct device_node *np)
171 /* Update GPIO state shadow register with default value */ 171 /* Update GPIO state shadow register with default value */
172 tree_info = of_get_property(np, "xlnx,dout-default", NULL); 172 tree_info = of_get_property(np, "xlnx,dout-default", NULL);
173 if (tree_info) 173 if (tree_info)
174 chip->gpio_state = *tree_info; 174 chip->gpio_state = be32_to_cpup(tree_info);
175 175
176 /* Update GPIO direction shadow register with default value */ 176 /* Update GPIO direction shadow register with default value */
177 chip->gpio_dir = 0xFFFFFFFF; /* By default, all pins are inputs */ 177 chip->gpio_dir = 0xFFFFFFFF; /* By default, all pins are inputs */
178 tree_info = of_get_property(np, "xlnx,tri-default", NULL); 178 tree_info = of_get_property(np, "xlnx,tri-default", NULL);
179 if (tree_info) 179 if (tree_info)
180 chip->gpio_dir = *tree_info; 180 chip->gpio_dir = be32_to_cpup(tree_info);
181 181
182 /* Check device node and parent device node for device width */ 182 /* Check device node and parent device node for device width */
183 chip->mmchip.gc.ngpio = 32; /* By default assume full GPIO controller */ 183 chip->mmchip.gc.ngpio = 32; /* By default assume full GPIO controller */
@@ -186,7 +186,7 @@ static int __devinit xgpio_of_probe(struct device_node *np)
186 tree_info = of_get_property(np->parent, 186 tree_info = of_get_property(np->parent,
187 "xlnx,gpio-width", NULL); 187 "xlnx,gpio-width", NULL);
188 if (tree_info) 188 if (tree_info)
189 chip->mmchip.gc.ngpio = *tree_info; 189 chip->mmchip.gc.ngpio = be32_to_cpup(tree_info);
190 190
191 spin_lock_init(&chip->gpio_lock); 191 spin_lock_init(&chip->gpio_lock);
192 192