Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1589366
| From | "David.Wu" <david.wu@rock-chips.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH v1 1/2] pinctrl: rockchip:Add input schmitt support |
| Date | 2017-02-28 12:20 +0100 |
| Message-ID | <tfNYZ-3EB-3@gated-at.bofh.it> (permalink) |
| References | <taIGB-HJ-3@gated-at.bofh.it> <taIGB-HJ-1@gated-at.bofh.it> <te4Ui-3Wg-25@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
Hi Heiko,
在 2017/2/24 0:51, Heiko Stuebner 写道:
> Hi David,
>
> Am Dienstag, 14. Februar 2017, 18:35:40 CET schrieb David Wu:
>> From: "david.wu" <david.wu@rock-chips.com>
>>
>> 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.
Thanks, i forget to check the return value.
>
>> +
>> + 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.
To the multiple "levels", i think we can use the
"PIN_CONFIG_INPUT_SCHMITT" pin config, which described at pinconf-generic.h.
* @PIN_CONFIG_INPUT_SCHMITT: this will configure an input pin to run in
* schmitt-trigger mode. If the schmitt-trigger has adjustable hysteresis,
* the threshold value is given on a custom format as argument when
* setting pins to this mode.
>
> Otherwise looks good.
>
>
> Heiko
>
>
>
>
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
[PATCH v1 1/2] pinctrl: rockchip:Add input schmitt support David Wu <david.wu@rock-chips.com> - 2017-02-14 11:40 +0100
Re: [PATCH v1 1/2] pinctrl: rockchip:Add input schmitt support Heiko Stuebner <heiko@sntech.de> - 2017-02-23 18:00 +0100
Re: [PATCH v1 1/2] pinctrl: rockchip:Add input schmitt support "David.Wu" <david.wu@rock-chips.com> - 2017-02-28 12:20 +0100
csiph-web