hw->nbase = hw->soc->nbase_names;
- mutex_init(&hw->lock);
+ spin_lock_init(&hw->lock);
/* Copy from internal struct mtk_pin_desc to register to the core */
pins = devm_kmalloc_array(&pdev->dev, hw->soc->npins, sizeof(*pins),
void mtk_rmw(struct mtk_pinctrl *pctl, u8 i, u32 reg, u32 mask, u32 set)
{
u32 val;
+ unsigned long flags;
- mutex_lock(&pctl->lock);
+ spin_lock_irqsave(&pctl->lock, flags);
val = mtk_r32(pctl, i, reg);
val &= ~mask;
val |= set;
mtk_w32(pctl, i, reg, val);
- mutex_unlock(&pctl->lock);
+ spin_unlock_irqrestore(&pctl->lock, flags);
}
static int mtk_hw_pin_field_lookup(struct mtk_pinctrl *hw,
struct mtk_pinctrl_group *groups;
const char **grp_names;
/* lock pin's register resource to avoid multiple threads issue*/
- struct mutex lock;
+ spinlock_t lock;
};
void mtk_rmw(struct mtk_pinctrl *pctl, u8 i, u32 reg, u32 mask, u32 set);