Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 287266
b: refs/heads/master
c: 876cf5e
h: refs/heads/master
v: v3
  • Loading branch information
Thomas Abraham authored and Grant Likely committed Feb 2, 2012
1 parent 20e8b07 commit 0e3723a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 95120d5d1bc17bdec29085186b6ab3d90e92d6f3
refs/heads/master: 876cf5e7b9e4bae014b0fa2cc18b21bce6d99073
23 changes: 13 additions & 10 deletions trunk/drivers/gpio/gpio-samsung.c
Original file line number Diff line number Diff line change
Expand Up @@ -2387,27 +2387,30 @@ static struct samsung_gpio_chip exynos4_gpios_3[] = {
};

#if defined(CONFIG_ARCH_EXYNOS4) && defined(CONFIG_OF)
static int exynos4_gpio_xlate(struct gpio_chip *gc, struct device_node *np,
const void *gpio_spec, u32 *flags)
static int exynos4_gpio_xlate(struct gpio_chip *gc,
const struct of_phandle_args *gpiospec, u32 *flags)
{
const __be32 *gpio = gpio_spec;
const u32 n = be32_to_cpup(gpio);
unsigned int pin = gc->base + be32_to_cpu(gpio[0]);
unsigned int pin;

if (WARN_ON(gc->of_gpio_n_cells < 4))
return -EINVAL;

if (n > gc->ngpio)
if (WARN_ON(gpiospec->args_count < gc->of_gpio_n_cells))
return -EINVAL;

if (s3c_gpio_cfgpin(pin, S3C_GPIO_SFN(be32_to_cpu(gpio[1]))))
if (gpiospec->args[0] > gc->ngpio)
return -EINVAL;

pin = gc->base + gpiospec->args[0];

if (s3c_gpio_cfgpin(pin, S3C_GPIO_SFN(gpiospec->args[1])))
pr_warn("gpio_xlate: failed to set pin function\n");
if (s3c_gpio_setpull(pin, be32_to_cpu(gpio[2])))
if (s3c_gpio_setpull(pin, gpiospec->args[2]))
pr_warn("gpio_xlate: failed to set pin pull up/down\n");
if (s5p_gpio_set_drvstr(pin, be32_to_cpu(gpio[3])))
if (s5p_gpio_set_drvstr(pin, gpiospec->args[3]))
pr_warn("gpio_xlate: failed to set pin drive strength\n");

return n;
return gpiospec->args[0];
}

static const struct of_device_id exynos4_gpio_dt_match[] __initdata = {
Expand Down

0 comments on commit 0e3723a

Please sign in to comment.