gpio: s7: added judgment on unsupported driver strength [1/1]

PD#SWPL-154298

Problem:
S7 does not exist DS0.

Solution:
Added judgment on unsupported driver strength.

Verify:
S7/BH201

Change-Id: Ia358bb6221f0876c6010ba77399de92a82b2b755
Signed-off-by: Huqiang Qin <huqiang.qin@amlogic.com>
This commit is contained in:
Huqiang Qin
2024-01-16 13:30:21 +08:00
committed by Luan Yuan
parent 74dc728687
commit 4cdede9553
3 changed files with 7 additions and 0 deletions
+1
View File
@@ -1078,6 +1078,7 @@ static struct meson_pinctrl_data meson_s7_periphs_pinctrl_data __refdata = {
.pmx_ops = &meson_axg_pmx_ops,
.pmx_data = &meson_s7_periphs_pmx_banks_data,
.parse_dt = &meson_a1_parse_dt_extra,
.ds_mask = BIT(0), /* S7 does not exist DS0 */
};
static const struct of_device_id meson_s7_pinctrl_dt_match[] = {
+5
View File
@@ -382,6 +382,11 @@ static int meson_pinconf_set_drive_strength(struct meson_pinctrl *pc,
ds_val = MESON_PINCONF_DRV_4000UA;
}
if (BIT(ds_val) & pc->data->ds_mask) {
dev_err(pc->dev, "unsupported drive strength: ds%u\n", ds_val);
return -EOPNOTSUPP;
}
ret = regmap_update_bits(pc->reg_ds, reg, 0x3 << bit, ds_val << bit);
if (ret)
return ret;
+1
View File
@@ -152,6 +152,7 @@ struct meson_pinctrl_data {
unsigned int pmx_expand_num;
#endif
#endif
unsigned int ds_mask;
};
struct meson_pinctrl {