diff --git a/arch/arm/dts/ipq5018-soc.dtsi b/arch/arm/dts/ipq5018-soc.dtsi index b90548dc31..e8dc90212b 100644 --- a/arch/arm/dts/ipq5018-soc.dtsi +++ b/arch/arm/dts/ipq5018-soc.dtsi @@ -26,24 +26,22 @@ gpio1 { gpio = <20>; func = <1>; - pull = ; + pull = ; oe = ; drvstr = ; od_en = ; sr_en = ; pu_res =; - pu = <1>; }; gpio2 { gpio = <21>; func = <1>; - pull = ; + pull = ; oe = ; drvstr = ; od_en = ; sr_en = ; pu_res =; - pu = <1>; }; }; }; diff --git a/arch/arm/include/asm/arch-qca-common/gpio.h b/arch/arm/include/asm/arch-qca-common/gpio.h index 0fa96002a7..bc7a93d2ed 100644 --- a/arch/arm/include/asm/arch-qca-common/gpio.h +++ b/arch/arm/include/asm/arch-qca-common/gpio.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011-2012, 2016-2017 The Linux Foundation. All rights reserved. + * Copyright (c) 2011-2012, 2016-2017, 2019 The Linux Foundation. All rights reserved. * Source : APQ8064 LK Boot * * Redistribution and use in source and binary forms, with or without @@ -43,6 +43,7 @@ struct qca_gpio_config { unsigned int vm; unsigned int od_en; unsigned int pu_res; + unsigned int sr_en; }; void gpio_tlmm_config(struct qca_gpio_config *gpio_config); diff --git a/drivers/gpio/ipq_gpio.c b/drivers/gpio/ipq_gpio.c index 2bacd371af..dd57524cce 100644 --- a/drivers/gpio/ipq_gpio.c +++ b/drivers/gpio/ipq_gpio.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2017 The Linux Foundation. All rights reserved. + * Copyright (c) 2016-2017, 2019 The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and @@ -33,10 +33,15 @@ void gpio_tlmm_config(struct qca_gpio_config *gpio_config) val |= gpio_config->func << 2; val |= gpio_config->drvstr << 6; val |= gpio_config->oe << 9; +#ifdef CONFIG_IPQ5018 + val |= gpio_config->od_en << 10; + val |= gpio_config->sr_en << 11; + val |= gpio_config->pu_res << 12; +#else val |= gpio_config->vm << 11; val |= gpio_config->od_en << 12; val |= gpio_config->pu_res << 13; - +#endif unsigned int *addr = (unsigned int *)GPIO_CONFIG_ADDR(gpio_config->gpio); writel(val, addr); @@ -109,7 +114,8 @@ int qca_gpio_init(int offset) offset, "od_en", 0); gpio_config.pu_res = fdtdec_get_uint(gd->fdt_blob, offset, "pu_res", 0); - + gpio_config.sr_en = fdtdec_get_uint(gd->fdt_blob, + offset, "sr_en", 0); gpio_tlmm_config(&gpio_config); } return 0; diff --git a/include/dt-bindings/qcom/gpio-ipq5018.h b/include/dt-bindings/qcom/gpio-ipq5018.h index 17ac6caa75..1744a16529 100644 --- a/include/dt-bindings/qcom/gpio-ipq5018.h +++ b/include/dt-bindings/qcom/gpio-ipq5018.h @@ -42,10 +42,6 @@ #define GPIO_OE_DISABLE 0 #define GPIO_OE_ENABLE 1 -/* GPIO VM */ -#define GPIO_VM_ENABLE 1 -#define GPIO_VM_DISABLE 0 - /* GPIO OD */ #define GPIO_OD_ENABLE 1 #define GPIO_OD_DISABLE 0 @@ -54,14 +50,6 @@ #define GPIO_SR_ENABLE 1 #define GPIO_SR_DISABLE 0 -/* GPIO PD */ -#define GPIO_PD_ENABLE 1 -#define GPIO_PD_DISABLE 0 - -/* GPIO PU */ -#define GPIO_PU_ENABLE 1 -#define GPIO_PU_DISABLE 0 - /* GPIO PULLUP RES */ #define GPIO_PULL_RES0 0 #define GPIO_PULL_RES1 1