MLK-17491-9 pinctrl: imx: cleanup gpio_set_direction
First of all, the design of using CONFIG_IBE_OBE is wrong as both VF and IMX has IBE and OBE while current code defined it in common code but for only IMX which causes a bit confusing. Second, remove the following invalid comments as we will clear IBE. "IBE always enabled allows us to read the value on the wire" Last, replace the complicated "if else" statement with a much simpler one. Cc: Bai Ping <ping.bai@nxp.com> Reviewed-by: Peng Fan <peng.fan@nxp.com> Reviewed-by: Fugang Duan <fugang.duan@nxp.com> Fixes: 07787c40ff3b ("MLK-13485-3 pinctrl: imx: modify the imx pinctrl to support imx7ulp gpio") Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>pull/10/head
parent
a8b54542fe
commit
fefd3119a6
|
@ -83,6 +83,8 @@ struct imx_pinctrl_soc_info {
|
|||
/* MUX_MODE shift and mask in case SHARE_MUX_CONF_REG */
|
||||
unsigned int mux_mask;
|
||||
u8 mux_shift;
|
||||
u32 ibe_bit;
|
||||
u32 obe_bit;
|
||||
|
||||
/* generic pinconf */
|
||||
bool generic_pinconf;
|
||||
|
@ -119,8 +121,6 @@ struct imx_pinctrl {
|
|||
|
||||
#define SHARE_MUX_CONF_REG 0x1
|
||||
#define ZERO_OFFSET_VALID 0x2
|
||||
#define CONFIG_IBE_OBE 0x4
|
||||
|
||||
#define IMX8_ENABLE_MUX_CONFIG (1 << 29)
|
||||
#define IMX8_ENABLE_PAD_CONFIG (1 << 30)
|
||||
#define IMX8_USE_SCU (1 << 31)
|
||||
|
|
|
@ -443,6 +443,8 @@ static struct imx_pinctrl_soc_info imx7ulp_pinctrl_info_0 = {
|
|||
.decodes = imx7ulp_cfg_decodes,
|
||||
.num_decodes = ARRAY_SIZE(imx7ulp_cfg_decodes),
|
||||
.fixup = imx7ulp_cfg_params_fixup,
|
||||
.ibe_bit = BIT(16),
|
||||
.obe_bit = BIT(17),
|
||||
};
|
||||
|
||||
static struct imx_pinctrl_soc_info imx7ulp_pinctrl_info_1 = {
|
||||
|
@ -455,6 +457,8 @@ static struct imx_pinctrl_soc_info imx7ulp_pinctrl_info_1 = {
|
|||
.decodes = imx7ulp_cfg_decodes,
|
||||
.num_decodes = ARRAY_SIZE(imx7ulp_cfg_decodes),
|
||||
.fixup = imx7ulp_cfg_params_fixup,
|
||||
.ibe_bit = BIT(16),
|
||||
.obe_bit = BIT(17),
|
||||
};
|
||||
|
||||
static struct of_device_id imx7ulp_pinctrl_of_match[] = {
|
||||
|
|
|
@ -30,9 +30,6 @@
|
|||
|
||||
#define IMX_PAD_SION 0x40000000 /* set SION */
|
||||
|
||||
#define IOMUXC_IBE (1 << 16)
|
||||
#define IOMUXC_OBE (1 << 17)
|
||||
|
||||
int imx_pmx_set_one_pin_mem(struct imx_pinctrl *ipctl, struct imx_pin *pin)
|
||||
{
|
||||
const struct imx_pinctrl_soc_info *info = ipctl->info;
|
||||
|
|
|
@ -326,6 +326,8 @@ static struct imx_pinctrl_soc_info vf610_pinctrl_info = {
|
|||
.gpio_set_direction = vf610_pmx_gpio_set_direction,
|
||||
.mux_mask = 0x700000,
|
||||
.mux_shift = 20,
|
||||
.ibe_bit = BIT(0),
|
||||
.obe_bit = BIT(1),
|
||||
};
|
||||
|
||||
static const struct of_device_id vf610_pinctrl_of_match[] = {
|
||||
|
|
Loading…
Reference in New Issue