@@ -135,9 +135,11 @@ struct rzg2l_register_offsets {
/**
* struct rzg2l_hwcfg - hardware configuration data structure
* @regs: hardware specific register offsets
+ * @func_base: base number for port function (see register PFC)
*/
struct rzg2l_hwcfg {
const struct rzg2l_register_offsets regs;
+ u8 func_base;
};
struct rzg2l_dedicated_configs {
@@ -220,6 +222,7 @@ static int rzg2l_pinctrl_set_mux(struct pinctrl_dev *pctldev,
unsigned int group_selector)
{
struct rzg2l_pinctrl *pctrl = pinctrl_dev_get_drvdata(pctldev);
+ const struct rzg2l_hwcfg *hwcfg = pctrl->data->hwcfg;
struct function_desc *func;
unsigned int i, *psel_val;
struct group_desc *group;
@@ -241,9 +244,9 @@ static int rzg2l_pinctrl_set_mux(struct pinctrl_dev *pctldev,
u32 pin = RZG2L_PIN_ID_TO_PIN(pins[i]);
dev_dbg(pctrl->dev, "port:%u pin: %u off:%x PSEL:%u\n",
- RZG2L_PIN_ID_TO_PORT(pins[i]), pin, off, psel_val[i]);
+ RZG2L_PIN_ID_TO_PORT(pins[i]), pin, off, psel_val[i] - hwcfg->func_base);
- rzg2l_pinctrl_set_pfc_mode(pctrl, pin, off, psel_val[i]);
+ rzg2l_pinctrl_set_pfc_mode(pctrl, pin, off, psel_val[i] - hwcfg->func_base);
}
return 0;