aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpio/gpio-samsung.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2012-03-14 02:44:11 -0400
committerIngo Molnar <mingo@elte.hu>2012-03-14 02:44:11 -0400
commitcd593accdcc27ccbe6498d9ad1c2b6cc8e1d830d (patch)
tree9424d3ac86e753706cc6c3d7e6072d2a73711e29 /drivers/gpio/gpio-samsung.c
parent11b91d6fe7272452c999573bab33c15c2f03dc31 (diff)
parentfde7d9049e55ab85a390be7f415d74c9f62dd0f9 (diff)
Merge tag 'v3.3-rc7' into x86/mce
Merge reason: Update from an ancient -rc1 base to an almost-final stable kernel. Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'drivers/gpio/gpio-samsung.c')
-rw-r--r--drivers/gpio/gpio-samsung.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/drivers/gpio/gpio-samsung.c b/drivers/gpio/gpio-samsung.c
index a7661773c052..0a79a1167a25 100644
--- a/drivers/gpio/gpio-samsung.c
+++ b/drivers/gpio/gpio-samsung.c
@@ -2387,27 +2387,30 @@ static struct samsung_gpio_chip exynos4_gpios_3[] = {
2387}; 2387};
2388 2388
2389#if defined(CONFIG_ARCH_EXYNOS4) && defined(CONFIG_OF) 2389#if defined(CONFIG_ARCH_EXYNOS4) && defined(CONFIG_OF)
2390static int exynos4_gpio_xlate(struct gpio_chip *gc, struct device_node *np, 2390static int exynos4_gpio_xlate(struct gpio_chip *gc,
2391 const void *gpio_spec, u32 *flags) 2391 const struct of_phandle_args *gpiospec, u32 *flags)
2392{ 2392{
2393 const __be32 *gpio = gpio_spec; 2393 unsigned int pin;
2394 const u32 n = be32_to_cpup(gpio);
2395 unsigned int pin = gc->base + be32_to_cpu(gpio[0]);
2396 2394
2397 if (WARN_ON(gc->of_gpio_n_cells < 4)) 2395 if (WARN_ON(gc->of_gpio_n_cells < 4))
2398 return -EINVAL; 2396 return -EINVAL;
2399 2397
2400 if (n > gc->ngpio) 2398 if (WARN_ON(gpiospec->args_count < gc->of_gpio_n_cells))
2401 return -EINVAL; 2399 return -EINVAL;
2402 2400
2403 if (s3c_gpio_cfgpin(pin, S3C_GPIO_SFN(be32_to_cpu(gpio[1])))) 2401 if (gpiospec->args[0] > gc->ngpio)
2402 return -EINVAL;
2403
2404 pin = gc->base + gpiospec->args[0];
2405
2406 if (s3c_gpio_cfgpin(pin, S3C_GPIO_SFN(gpiospec->args[1])))
2404 pr_warn("gpio_xlate: failed to set pin function\n"); 2407 pr_warn("gpio_xlate: failed to set pin function\n");
2405 if (s3c_gpio_setpull(pin, be32_to_cpu(gpio[2]))) 2408 if (s3c_gpio_setpull(pin, gpiospec->args[2]))
2406 pr_warn("gpio_xlate: failed to set pin pull up/down\n"); 2409 pr_warn("gpio_xlate: failed to set pin pull up/down\n");
2407 if (s5p_gpio_set_drvstr(pin, be32_to_cpu(gpio[3]))) 2410 if (s5p_gpio_set_drvstr(pin, gpiospec->args[3]))
2408 pr_warn("gpio_xlate: failed to set pin drive strength\n"); 2411 pr_warn("gpio_xlate: failed to set pin drive strength\n");
2409 2412
2410 return n; 2413 return gpiospec->args[0];
2411} 2414}
2412 2415
2413static const struct of_device_id exynos4_gpio_dt_match[] __initdata = { 2416static const struct of_device_id exynos4_gpio_dt_match[] __initdata = {