struct pinctrl_pin_desc *pads;
unsigned int nr_pads;
-
- spinlock_t lock;
};
static int sh_pfc_get_groups_count(struct pinctrl_dev *pctldev)
struct pinmux_gpio *gpio, unsigned offset)
{
struct pinmux_data_reg *dummy;
- unsigned long flags;
int bit;
gpio->flags &= ~PINMUX_FLAG_TYPE;
gpio->flags |= PINMUX_TYPE_GPIO;
else {
gpio->flags |= PINMUX_TYPE_FUNCTION;
-
- spin_lock_irqsave(&pmx->lock, flags);
pmx->nr_functions++;
- spin_unlock_irqrestore(&pmx->lock, flags);
}
}
static int sh_pfc_map_functions(struct sh_pfc *pfc, struct sh_pfc_pinctrl *pmx)
{
- unsigned long flags;
int i, fn;
pmx->functions = devm_kzalloc(pfc->dev, pmx->nr_functions *
if (unlikely(!pmx->functions))
return -ENOMEM;
- spin_lock_irqsave(&pmx->lock, flags);
-
for (i = fn = 0; i < pmx->nr_pads; i++) {
struct pinmux_gpio *gpio = pfc->info->gpios + i;
pmx->functions[fn++] = gpio;
}
- spin_unlock_irqrestore(&pmx->lock, flags);
-
return 0;
}
if (unlikely(!pmx))
return -ENOMEM;
- spin_lock_init(&pmx->lock);
-
pmx->pfc = pfc;
pfc->pinctrl = pmx;