gpio: samsung: adapt to changes in gpio specifier translator function declaration
Commit 15c9a0acc3
(of: create of_phandle_args to simplify return of phandle
parsing data) modifies the parameter list of of_xlate function pointer declaration
in gpio_chip. Adapt the gpio specifier translate function for this change.
Reported-by: Tushar Behera <tushar.behera@linaro.org>
Signed-off-by: Thomas Abraham <thomas.abraham@linaro.org>
Tested-by: Karol Lewandowski <k.lewandowsk@samsung.com>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
This commit is contained in:
committed by
Grant Likely
parent
95120d5d1b
commit
876cf5e7b9
@@ -2387,27 +2387,30 @@ static struct samsung_gpio_chip exynos4_gpios_3[] = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
#if defined(CONFIG_ARCH_EXYNOS4) && defined(CONFIG_OF)
|
#if defined(CONFIG_ARCH_EXYNOS4) && defined(CONFIG_OF)
|
||||||
static int exynos4_gpio_xlate(struct gpio_chip *gc, struct device_node *np,
|
static int exynos4_gpio_xlate(struct gpio_chip *gc,
|
||||||
const void *gpio_spec, u32 *flags)
|
const struct of_phandle_args *gpiospec, u32 *flags)
|
||||||
{
|
{
|
||||||
const __be32 *gpio = gpio_spec;
|
unsigned int pin;
|
||||||
const u32 n = be32_to_cpup(gpio);
|
|
||||||
unsigned int pin = gc->base + be32_to_cpu(gpio[0]);
|
|
||||||
|
|
||||||
if (WARN_ON(gc->of_gpio_n_cells < 4))
|
if (WARN_ON(gc->of_gpio_n_cells < 4))
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
if (n > gc->ngpio)
|
if (WARN_ON(gpiospec->args_count < gc->of_gpio_n_cells))
|
||||||
return -EINVAL;
|
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");
|
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");
|
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");
|
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 = {
|
static const struct of_device_id exynos4_gpio_dt_match[] __initdata = {
|
||||||
|
Reference in New Issue
Block a user