Commit dadfab0f authored by Linus Walleij's avatar Linus Walleij

Merge tag 'intel-pinctrl-v5.10-2' of...

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
parents b41efeed f3c75e7a
...@@ -62,10 +62,10 @@ ...@@ -62,10 +62,10 @@
#define PADCFG1_TERM_UP BIT(13) #define PADCFG1_TERM_UP BIT(13)
#define PADCFG1_TERM_SHIFT 10 #define PADCFG1_TERM_SHIFT 10
#define PADCFG1_TERM_MASK GENMASK(12, 10) #define PADCFG1_TERM_MASK GENMASK(12, 10)
#define PADCFG1_TERM_20K 4 #define PADCFG1_TERM_20K BIT(2)
#define PADCFG1_TERM_2K 3 #define PADCFG1_TERM_5K BIT(1)
#define PADCFG1_TERM_5K 2 #define PADCFG1_TERM_1K BIT(0)
#define PADCFG1_TERM_1K 1 #define PADCFG1_TERM_833 (BIT(1) | BIT(0))
#define PADCFG2 0x008 #define PADCFG2 0x008
#define PADCFG2_DEBEN BIT(0) #define PADCFG2_DEBEN BIT(0)
...@@ -549,12 +549,12 @@ static int intel_config_get_pull(struct intel_pinctrl *pctrl, unsigned int pin, ...@@ -549,12 +549,12 @@ static int intel_config_get_pull(struct intel_pinctrl *pctrl, unsigned int pin,
return -EINVAL; return -EINVAL;
switch (term) { switch (term) {
case PADCFG1_TERM_833:
*arg = 833;
break;
case PADCFG1_TERM_1K: case PADCFG1_TERM_1K:
*arg = 1000; *arg = 1000;
break; break;
case PADCFG1_TERM_2K:
*arg = 2000;
break;
case PADCFG1_TERM_5K: case PADCFG1_TERM_5K:
*arg = 5000; *arg = 5000;
break; break;
...@@ -570,6 +570,11 @@ static int intel_config_get_pull(struct intel_pinctrl *pctrl, unsigned int pin, ...@@ -570,6 +570,11 @@ static int intel_config_get_pull(struct intel_pinctrl *pctrl, unsigned int pin,
return -EINVAL; return -EINVAL;
switch (term) { switch (term) {
case PADCFG1_TERM_833:
if (!(community->features & PINCTRL_FEATURE_1K_PD))
return -EINVAL;
*arg = 833;
break;
case PADCFG1_TERM_1K: case PADCFG1_TERM_1K:
if (!(community->features & PINCTRL_FEATURE_1K_PD)) if (!(community->features & PINCTRL_FEATURE_1K_PD))
return -EINVAL; return -EINVAL;
...@@ -678,6 +683,10 @@ static int intel_config_set_pull(struct intel_pinctrl *pctrl, unsigned int pin, ...@@ -678,6 +683,10 @@ static int intel_config_set_pull(struct intel_pinctrl *pctrl, unsigned int pin,
value |= PADCFG1_TERM_UP; value |= PADCFG1_TERM_UP;
/* Set default strength value in case none is given */
if (arg == 1)
arg = 5000;
switch (arg) { switch (arg) {
case 20000: case 20000:
value |= PADCFG1_TERM_20K << PADCFG1_TERM_SHIFT; value |= PADCFG1_TERM_20K << PADCFG1_TERM_SHIFT;
...@@ -685,12 +694,12 @@ static int intel_config_set_pull(struct intel_pinctrl *pctrl, unsigned int pin, ...@@ -685,12 +694,12 @@ static int intel_config_set_pull(struct intel_pinctrl *pctrl, unsigned int pin,
case 5000: case 5000:
value |= PADCFG1_TERM_5K << PADCFG1_TERM_SHIFT; value |= PADCFG1_TERM_5K << PADCFG1_TERM_SHIFT;
break; break;
case 2000:
value |= PADCFG1_TERM_2K << PADCFG1_TERM_SHIFT;
break;
case 1000: case 1000:
value |= PADCFG1_TERM_1K << PADCFG1_TERM_SHIFT; value |= PADCFG1_TERM_1K << PADCFG1_TERM_SHIFT;
break; break;
case 833:
value |= PADCFG1_TERM_833 << PADCFG1_TERM_SHIFT;
break;
default: default:
ret = -EINVAL; ret = -EINVAL;
} }
...@@ -700,6 +709,10 @@ static int intel_config_set_pull(struct intel_pinctrl *pctrl, unsigned int pin, ...@@ -700,6 +709,10 @@ static int intel_config_set_pull(struct intel_pinctrl *pctrl, unsigned int pin,
case PIN_CONFIG_BIAS_PULL_DOWN: case PIN_CONFIG_BIAS_PULL_DOWN:
value &= ~(PADCFG1_TERM_UP | PADCFG1_TERM_MASK); value &= ~(PADCFG1_TERM_UP | PADCFG1_TERM_MASK);
/* Set default strength value in case none is given */
if (arg == 1)
arg = 5000;
switch (arg) { switch (arg) {
case 20000: case 20000:
value |= PADCFG1_TERM_20K << PADCFG1_TERM_SHIFT; value |= PADCFG1_TERM_20K << PADCFG1_TERM_SHIFT;
...@@ -714,6 +727,13 @@ static int intel_config_set_pull(struct intel_pinctrl *pctrl, unsigned int pin, ...@@ -714,6 +727,13 @@ static int intel_config_set_pull(struct intel_pinctrl *pctrl, unsigned int pin,
} }
value |= PADCFG1_TERM_1K << PADCFG1_TERM_SHIFT; value |= PADCFG1_TERM_1K << PADCFG1_TERM_SHIFT;
break; break;
case 833:
if (!(community->features & PINCTRL_FEATURE_1K_PD)) {
ret = -EINVAL;
break;
}
value |= PADCFG1_TERM_833 << PADCFG1_TERM_SHIFT;
break;
default: default:
ret = -EINVAL; ret = -EINVAL;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment