int ext_gpio_indrt_access;
};
-extern struct mutex smi_lock;
extern struct rtl83xx_soc_info soc_info;
+DEFINE_MUTEX(miim_lock);
+
static u32 rtl8231_read(struct rtl8231_gpios *gpios, u32 reg)
{
u32 t = 0, n = 0;
struct rtl8231_gpios *gpios = gpiochip_get_data(gc);
pr_debug("%s: %d\n", __func__, offset);
- mutex_lock(&smi_lock);
+ mutex_lock(&miim_lock);
err = rtl8231_pin_dir(gpios, offset, 1);
- mutex_unlock(&smi_lock);
+ mutex_unlock(&miim_lock);
return err;
}
struct rtl8231_gpios *gpios = gpiochip_get_data(gc);
pr_debug("%s: %d\n", __func__, offset);
- mutex_lock(&smi_lock);
+ mutex_lock(&miim_lock);
err = rtl8231_pin_dir(gpios, offset, 0);
- mutex_unlock(&smi_lock);
+ mutex_unlock(&miim_lock);
if (!err)
err = rtl8231_pin_set(gpios, offset, value);
return err;
struct rtl8231_gpios *gpios = gpiochip_get_data(gc);
pr_debug("%s: %d\n", __func__, offset);
- mutex_lock(&smi_lock);
+ mutex_lock(&miim_lock);
rtl8231_pin_dir_get(gpios, offset, &v);
- mutex_unlock(&smi_lock);
+ mutex_unlock(&miim_lock);
return v;
}
u16 state = 0;
struct rtl8231_gpios *gpios = gpiochip_get_data(gc);
- mutex_lock(&smi_lock);
+ mutex_lock(&miim_lock);
rtl8231_pin_get(gpios, offset, &state);
- mutex_unlock(&smi_lock);
+ mutex_unlock(&miim_lock);
if (state & (1 << (offset % 16)))
return 1;
return 0;