Hi David,
Am Dienstag, 14. Februar 2017, 18:35:40 CET schrieb David Wu:
From: "david.wu" <david.wu@xxxxxxxxxxxxxx>
struct rockchip_pin_config {
@@ -1355,6 +1358,53 @@ static int rockchip_set_pull(struct rockchip_pin_bank
*bank, return ret;
}
+static int rockchip_get_schmitt(struct rockchip_pin_bank *bank, int
pin_num) +{
+ struct rockchip_pinctrl *info = bank->drvdata;
+ struct rockchip_pin_ctrl *ctrl = info->ctrl;
+ struct regmap *regmap;
+ int reg, ret;
+ u8 bit;
+ u32 data;
+
+ ctrl->schmitt_calc_reg(bank, pin_num, ®map, ®, &bit);
we might want to have and check an actual return value here.
On things like the rk3288 only some special pins have these schmitt triggers
it seems, so we might want to abort if something tries to access an
unsupported one.
+
+ ret = regmap_read(regmap, reg, &data);
+ if (ret)
+ return ret;
+
+ data >>= bit;
+ return data & 0x1;
The mask seems to also be variable, for example on the rk3399 there seem to be
multiple "levels" for at least gpio2. So your calc-callback might want to also
set the right mask.
Otherwise looks good.
Heiko