mirror of
https://github.com/hardkernel/kernel_common_drivers.git
synced 2026-06-25 12:03:48 +09:00
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:
@@ -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[] = {
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -152,6 +152,7 @@ struct meson_pinctrl_data {
|
||||
unsigned int pmx_expand_num;
|
||||
#endif
|
||||
#endif
|
||||
unsigned int ds_mask;
|
||||
};
|
||||
|
||||
struct meson_pinctrl {
|
||||
|
||||
Reference in New Issue
Block a user