Commit 846b065d authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'platform-drivers-x86-v6.4-4' of...

Merge tag 'platform-drivers-x86-v6.4-4' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86

Pull x86 platform driver fixes from Hans de Goede:

 - various Microsoft Surface support fixes

 - one fix for the INT3472 driver

* tag 'platform-drivers-x86-v6.4-4' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86:
  platform/x86: int3472: Avoid crash in unregistering regulator gpio
  platform/surface: aggregator_tabletsw: Add support for book mode in POS subsystem
  platform/surface: aggregator_tabletsw: Add support for book mode in KIP subsystem
  platform/surface: aggregator: Allow completion work-items to be executed in parallel
  platform/surface: aggregator: Make to_ssam_device_driver() respect constness
parents fa56e0e4 fb109fba
...@@ -825,7 +825,7 @@ static int ssam_cplt_init(struct ssam_cplt *cplt, struct device *dev) ...@@ -825,7 +825,7 @@ static int ssam_cplt_init(struct ssam_cplt *cplt, struct device *dev)
cplt->dev = dev; cplt->dev = dev;
cplt->wq = create_workqueue(SSAM_CPLT_WQ_NAME); cplt->wq = alloc_workqueue(SSAM_CPLT_WQ_NAME, WQ_UNBOUND | WQ_MEM_RECLAIM, 0);
if (!cplt->wq) if (!cplt->wq)
return -ENOMEM; return -ENOMEM;
......
...@@ -210,6 +210,7 @@ enum ssam_kip_cover_state { ...@@ -210,6 +210,7 @@ enum ssam_kip_cover_state {
SSAM_KIP_COVER_STATE_LAPTOP = 0x03, SSAM_KIP_COVER_STATE_LAPTOP = 0x03,
SSAM_KIP_COVER_STATE_FOLDED_CANVAS = 0x04, SSAM_KIP_COVER_STATE_FOLDED_CANVAS = 0x04,
SSAM_KIP_COVER_STATE_FOLDED_BACK = 0x05, SSAM_KIP_COVER_STATE_FOLDED_BACK = 0x05,
SSAM_KIP_COVER_STATE_BOOK = 0x06,
}; };
static const char *ssam_kip_cover_state_name(struct ssam_tablet_sw *sw, static const char *ssam_kip_cover_state_name(struct ssam_tablet_sw *sw,
...@@ -231,6 +232,9 @@ static const char *ssam_kip_cover_state_name(struct ssam_tablet_sw *sw, ...@@ -231,6 +232,9 @@ static const char *ssam_kip_cover_state_name(struct ssam_tablet_sw *sw,
case SSAM_KIP_COVER_STATE_FOLDED_BACK: case SSAM_KIP_COVER_STATE_FOLDED_BACK:
return "folded-back"; return "folded-back";
case SSAM_KIP_COVER_STATE_BOOK:
return "book";
default: default:
dev_warn(&sw->sdev->dev, "unknown KIP cover state: %u\n", state->state); dev_warn(&sw->sdev->dev, "unknown KIP cover state: %u\n", state->state);
return "<unknown>"; return "<unknown>";
...@@ -244,6 +248,7 @@ static bool ssam_kip_cover_state_is_tablet_mode(struct ssam_tablet_sw *sw, ...@@ -244,6 +248,7 @@ static bool ssam_kip_cover_state_is_tablet_mode(struct ssam_tablet_sw *sw,
case SSAM_KIP_COVER_STATE_DISCONNECTED: case SSAM_KIP_COVER_STATE_DISCONNECTED:
case SSAM_KIP_COVER_STATE_FOLDED_CANVAS: case SSAM_KIP_COVER_STATE_FOLDED_CANVAS:
case SSAM_KIP_COVER_STATE_FOLDED_BACK: case SSAM_KIP_COVER_STATE_FOLDED_BACK:
case SSAM_KIP_COVER_STATE_BOOK:
return true; return true;
case SSAM_KIP_COVER_STATE_CLOSED: case SSAM_KIP_COVER_STATE_CLOSED:
...@@ -335,6 +340,7 @@ enum ssam_pos_state_cover { ...@@ -335,6 +340,7 @@ enum ssam_pos_state_cover {
SSAM_POS_COVER_LAPTOP = 0x03, SSAM_POS_COVER_LAPTOP = 0x03,
SSAM_POS_COVER_FOLDED_CANVAS = 0x04, SSAM_POS_COVER_FOLDED_CANVAS = 0x04,
SSAM_POS_COVER_FOLDED_BACK = 0x05, SSAM_POS_COVER_FOLDED_BACK = 0x05,
SSAM_POS_COVER_BOOK = 0x06,
}; };
enum ssam_pos_state_sls { enum ssam_pos_state_sls {
...@@ -367,6 +373,9 @@ static const char *ssam_pos_state_name_cover(struct ssam_tablet_sw *sw, u32 stat ...@@ -367,6 +373,9 @@ static const char *ssam_pos_state_name_cover(struct ssam_tablet_sw *sw, u32 stat
case SSAM_POS_COVER_FOLDED_BACK: case SSAM_POS_COVER_FOLDED_BACK:
return "folded-back"; return "folded-back";
case SSAM_POS_COVER_BOOK:
return "book";
default: default:
dev_warn(&sw->sdev->dev, "unknown device posture for type-cover: %u\n", state); dev_warn(&sw->sdev->dev, "unknown device posture for type-cover: %u\n", state);
return "<unknown>"; return "<unknown>";
...@@ -416,6 +425,7 @@ static bool ssam_pos_state_is_tablet_mode_cover(struct ssam_tablet_sw *sw, u32 s ...@@ -416,6 +425,7 @@ static bool ssam_pos_state_is_tablet_mode_cover(struct ssam_tablet_sw *sw, u32 s
case SSAM_POS_COVER_DISCONNECTED: case SSAM_POS_COVER_DISCONNECTED:
case SSAM_POS_COVER_FOLDED_CANVAS: case SSAM_POS_COVER_FOLDED_CANVAS:
case SSAM_POS_COVER_FOLDED_BACK: case SSAM_POS_COVER_FOLDED_BACK:
case SSAM_POS_COVER_BOOK:
return true; return true;
case SSAM_POS_COVER_CLOSED: case SSAM_POS_COVER_CLOSED:
......
...@@ -101,9 +101,11 @@ int skl_int3472_register_clock(struct int3472_discrete_device *int3472, ...@@ -101,9 +101,11 @@ int skl_int3472_register_clock(struct int3472_discrete_device *int3472,
int3472->clock.ena_gpio = acpi_get_and_request_gpiod(path, agpio->pin_table[0], int3472->clock.ena_gpio = acpi_get_and_request_gpiod(path, agpio->pin_table[0],
"int3472,clk-enable"); "int3472,clk-enable");
if (IS_ERR(int3472->clock.ena_gpio)) if (IS_ERR(int3472->clock.ena_gpio)) {
return dev_err_probe(int3472->dev, PTR_ERR(int3472->clock.ena_gpio), ret = PTR_ERR(int3472->clock.ena_gpio);
"getting clk-enable GPIO\n"); int3472->clock.ena_gpio = NULL;
return dev_err_probe(int3472->dev, ret, "getting clk-enable GPIO\n");
}
if (polarity == GPIO_ACTIVE_LOW) if (polarity == GPIO_ACTIVE_LOW)
gpiod_toggle_active_low(int3472->clock.ena_gpio); gpiod_toggle_active_low(int3472->clock.ena_gpio);
...@@ -199,8 +201,9 @@ int skl_int3472_register_regulator(struct int3472_discrete_device *int3472, ...@@ -199,8 +201,9 @@ int skl_int3472_register_regulator(struct int3472_discrete_device *int3472,
int3472->regulator.gpio = acpi_get_and_request_gpiod(path, agpio->pin_table[0], int3472->regulator.gpio = acpi_get_and_request_gpiod(path, agpio->pin_table[0],
"int3472,regulator"); "int3472,regulator");
if (IS_ERR(int3472->regulator.gpio)) { if (IS_ERR(int3472->regulator.gpio)) {
dev_err(int3472->dev, "Failed to get regulator GPIO line\n"); ret = PTR_ERR(int3472->regulator.gpio);
return PTR_ERR(int3472->regulator.gpio); int3472->regulator.gpio = NULL;
return dev_err_probe(int3472->dev, ret, "getting regulator GPIO\n");
} }
/* Ensure the pin is in output mode and non-active state */ /* Ensure the pin is in output mode and non-active state */
......
...@@ -243,11 +243,7 @@ static inline bool is_ssam_device(struct device *d) ...@@ -243,11 +243,7 @@ static inline bool is_ssam_device(struct device *d)
* Return: Returns the pointer to the &struct ssam_device_driver wrapping the * Return: Returns the pointer to the &struct ssam_device_driver wrapping the
* given device driver @d. * given device driver @d.
*/ */
static inline #define to_ssam_device_driver(d) container_of_const(d, struct ssam_device_driver, driver)
struct ssam_device_driver *to_ssam_device_driver(struct device_driver *d)
{
return container_of(d, struct ssam_device_driver, driver);
}
const struct ssam_device_id *ssam_device_id_match(const struct ssam_device_id *table, const struct ssam_device_id *ssam_device_id_match(const struct ssam_device_id *table,
const struct ssam_device_uid uid); const struct ssam_device_uid uid);
......
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