@@ -573,9 +573,9 @@ static const char * const irq_type_names[] = {
573
573
[IRQ_TYPE_LEVEL_LOW ] = "level-low" ,
574
574
};
575
575
576
- static bool strict_gpiod ;
577
- module_param (strict_gpiod , bool , 0644 );
578
- MODULE_PARM_DESC (strict_gpiod , "unless true, outputs remain outputs when freed" );
576
+ static bool persist_gpio_outputs = true ;
577
+ module_param (persist_gpio_outputs , bool , 0644 );
578
+ MODULE_PARM_DESC (persist_gpio_outputs , "Enable GPIO_OUT persistence when pin is freed" );
579
579
580
580
static int rp1_pinconf_set (struct pinctrl_dev * pctldev ,
581
581
unsigned int offset , unsigned long * configs ,
@@ -1205,11 +1205,12 @@ static int rp1_pmx_free(struct pinctrl_dev *pctldev, unsigned offset)
1205
1205
struct rp1_pin_info * pin = rp1_get_pin_pctl (pctldev , offset );
1206
1206
u32 fsel = rp1_get_fsel (pin );
1207
1207
1208
- /* Return non-GPIOs to GPIO_IN, unless strict_gpiod is set */
1209
- if (strict_gpiod || fsel != RP1_FSEL_GPIO ) {
1210
- rp1_set_dir (pin , RP1_DIR_INPUT );
1211
- rp1_set_fsel (pin , RP1_FSEL_GPIO );
1212
- }
1208
+ /* Return all pins to GPIO_IN, unless persist_gpio_outputs is set */
1209
+ if (persist_gpio_outputs && fsel == RP1_FSEL_GPIO )
1210
+ return 0 ;
1211
+
1212
+ rp1_set_dir (pin , RP1_DIR_INPUT );
1213
+ rp1_set_fsel (pin , RP1_FSEL_GPIO );
1213
1214
1214
1215
return 0 ;
1215
1216
}
0 commit comments