intel-pinctrl for v5.10-2

* Respect bias setting when comes from ACPI
 
 The following is an automated git shortlog grouped by driver:
 
 intel:
  -  Set default bias in case no particular value given
  -  Fix 2 kOhm bias which is 833 Ohm
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEqaflIX74DDDzMJJtb7wzTHR8rCgFAl+lkxIACgkQb7wzTHR8
 rChnvA//WtUChge5HzlJu/6/Eim32S1N8HPaEsxEpNT3B/D8T3KFhpcbzTM+7tDC
 3HLgqTa/r/VmCbJH1Su//VFLBRIndYjSZKgLl2c++YQe5bTxWR0HY+su2U5Fzf24
 TwpeuhM8+7mWCvI4VeEOULZaZ+3OSfTbg9ccGZB7pD6GLonVSogs6eg4tdNeMDDs
 Lv5GQLc8NrPJZyKqnc5S3GScyY9bemQG8gGjtDSOo8YPMGxPQl2Mcz5iEOlw6lzT
 dGvB184X4XTD4L9RgYtEJmP9peEEG2xJuWOzxUI1EkitA7j9MwyNPjeQITv1UV5i
 HWIN91cqBGPv/ic286mVAdP0lnAcYiOF/yVHDkW4zKDj1QC35wj26eRQcuqTfEZS
 owqb0hEP2NlCqBGWHHOIsxCaTaPokO4pG0zsLjXNmw1z1wGfIJncRwNha0cfcQEE
 UDUXNcBiDceh5xYz/0unj4TxMTFOfmIwTtn3CkOVJMiNMsKCJfXl0+KKLN0D/ebg
 FtrXYfwK6f4clFBxD9wqLT7UwzYX6Bnn4fLA3Z+LPRKenpXDZ8guld//rn98mcAp
 0hAEER1YceUnADEPwKftBxH3iO4SLQQQdoLFWYu4MGybbzSLi65EkwI16GWy5y94
 EcQRFlGsdIMH7rSVV6934qI3CYq53intnjFNQh+Bk8omiteV9Us=
 =Voi9
 -----END PGP SIGNATURE-----

Merge tag 'intel-pinctrl-v5.10-2' of git://git.kernel.org/pub/scm/linux/kernel/git/pinctrl/intel into fixes

intel-pinctrl for v5.10-2

* Respect bias setting when comes from ACPI

The following is an automated git shortlog grouped by driver:

intel:
 -  Set default bias in case no particular value given
 -  Fix 2 kOhm bias which is 833 Ohm
This commit is contained in:
Linus Walleij 2020-11-10 15:35:41 +01:00
commit dadfab0fbf

View File

@ -62,10 +62,10 @@
#define PADCFG1_TERM_UP BIT(13)
#define PADCFG1_TERM_SHIFT 10
#define PADCFG1_TERM_MASK GENMASK(12, 10)
#define PADCFG1_TERM_20K 4
#define PADCFG1_TERM_2K 3
#define PADCFG1_TERM_5K 2
#define PADCFG1_TERM_1K 1
#define PADCFG1_TERM_20K BIT(2)
#define PADCFG1_TERM_5K BIT(1)
#define PADCFG1_TERM_1K BIT(0)
#define PADCFG1_TERM_833 (BIT(1) | BIT(0))
#define PADCFG2 0x008
#define PADCFG2_DEBEN BIT(0)
@ -549,12 +549,12 @@ static int intel_config_get_pull(struct intel_pinctrl *pctrl, unsigned int pin,
return -EINVAL;
switch (term) {
case PADCFG1_TERM_833:
*arg = 833;
break;
case PADCFG1_TERM_1K:
*arg = 1000;
break;
case PADCFG1_TERM_2K:
*arg = 2000;
break;
case PADCFG1_TERM_5K:
*arg = 5000;
break;
@ -570,6 +570,11 @@ static int intel_config_get_pull(struct intel_pinctrl *pctrl, unsigned int pin,
return -EINVAL;
switch (term) {
case PADCFG1_TERM_833:
if (!(community->features & PINCTRL_FEATURE_1K_PD))
return -EINVAL;
*arg = 833;
break;
case PADCFG1_TERM_1K:
if (!(community->features & PINCTRL_FEATURE_1K_PD))
return -EINVAL;
@ -678,6 +683,10 @@ static int intel_config_set_pull(struct intel_pinctrl *pctrl, unsigned int pin,
value |= PADCFG1_TERM_UP;
/* Set default strength value in case none is given */
if (arg == 1)
arg = 5000;
switch (arg) {
case 20000:
value |= PADCFG1_TERM_20K << PADCFG1_TERM_SHIFT;
@ -685,12 +694,12 @@ static int intel_config_set_pull(struct intel_pinctrl *pctrl, unsigned int pin,
case 5000:
value |= PADCFG1_TERM_5K << PADCFG1_TERM_SHIFT;
break;
case 2000:
value |= PADCFG1_TERM_2K << PADCFG1_TERM_SHIFT;
break;
case 1000:
value |= PADCFG1_TERM_1K << PADCFG1_TERM_SHIFT;
break;
case 833:
value |= PADCFG1_TERM_833 << PADCFG1_TERM_SHIFT;
break;
default:
ret = -EINVAL;
}
@ -700,6 +709,10 @@ static int intel_config_set_pull(struct intel_pinctrl *pctrl, unsigned int pin,
case PIN_CONFIG_BIAS_PULL_DOWN:
value &= ~(PADCFG1_TERM_UP | PADCFG1_TERM_MASK);
/* Set default strength value in case none is given */
if (arg == 1)
arg = 5000;
switch (arg) {
case 20000:
value |= PADCFG1_TERM_20K << PADCFG1_TERM_SHIFT;
@ -714,6 +727,13 @@ static int intel_config_set_pull(struct intel_pinctrl *pctrl, unsigned int pin,
}
value |= PADCFG1_TERM_1K << PADCFG1_TERM_SHIFT;
break;
case 833:
if (!(community->features & PINCTRL_FEATURE_1K_PD)) {
ret = -EINVAL;
break;
}
value |= PADCFG1_TERM_833 << PADCFG1_TERM_SHIFT;
break;
default:
ret = -EINVAL;
}