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

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
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -825,7 +825,7 @@ static int ssam_cplt_init(struct ssam_cplt *cplt, struct device *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)
		return -ENOMEM;

+10 −0
Original line number Diff line number Diff line
@@ -210,6 +210,7 @@ enum ssam_kip_cover_state {
	SSAM_KIP_COVER_STATE_LAPTOP        = 0x03,
	SSAM_KIP_COVER_STATE_FOLDED_CANVAS = 0x04,
	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,
@@ -231,6 +232,9 @@ static const char *ssam_kip_cover_state_name(struct ssam_tablet_sw *sw,
	case SSAM_KIP_COVER_STATE_FOLDED_BACK:
		return "folded-back";

	case SSAM_KIP_COVER_STATE_BOOK:
		return "book";

	default:
		dev_warn(&sw->sdev->dev, "unknown KIP cover state: %u\n", state->state);
		return "<unknown>";
@@ -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_FOLDED_CANVAS:
	case SSAM_KIP_COVER_STATE_FOLDED_BACK:
	case SSAM_KIP_COVER_STATE_BOOK:
		return true;

	case SSAM_KIP_COVER_STATE_CLOSED:
@@ -335,6 +340,7 @@ enum ssam_pos_state_cover {
	SSAM_POS_COVER_LAPTOP        = 0x03,
	SSAM_POS_COVER_FOLDED_CANVAS = 0x04,
	SSAM_POS_COVER_FOLDED_BACK   = 0x05,
	SSAM_POS_COVER_BOOK          = 0x06,
};

enum ssam_pos_state_sls {
@@ -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:
		return "folded-back";

	case SSAM_POS_COVER_BOOK:
		return "book";

	default:
		dev_warn(&sw->sdev->dev, "unknown device posture for type-cover: %u\n", state);
		return "<unknown>";
@@ -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_FOLDED_CANVAS:
	case SSAM_POS_COVER_FOLDED_BACK:
	case SSAM_POS_COVER_BOOK:
		return true;

	case SSAM_POS_COVER_CLOSED:
+8 −5
Original line number Diff line number Diff line
@@ -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,clk-enable");
	if (IS_ERR(int3472->clock.ena_gpio))
		return dev_err_probe(int3472->dev, PTR_ERR(int3472->clock.ena_gpio),
				     "getting clk-enable GPIO\n");
	if (IS_ERR(int3472->clock.ena_gpio)) {
		ret = PTR_ERR(int3472->clock.ena_gpio);
		int3472->clock.ena_gpio = NULL;
		return dev_err_probe(int3472->dev, ret, "getting clk-enable GPIO\n");
	}

	if (polarity == GPIO_ACTIVE_LOW)
		gpiod_toggle_active_low(int3472->clock.ena_gpio);
@@ -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");
	if (IS_ERR(int3472->regulator.gpio)) {
		dev_err(int3472->dev, "Failed to get regulator GPIO line\n");
		return PTR_ERR(int3472->regulator.gpio);
		ret = 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 */
+1 −5
Original line number Diff line number Diff line
@@ -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
 * given device driver @d.
 */
static inline
struct ssam_device_driver *to_ssam_device_driver(struct device_driver *d)
{
	return container_of(d, struct ssam_device_driver, driver);
}
#define to_ssam_device_driver(d)	container_of_const(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_uid uid);