Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9af27a36 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "input: qcom-hv-haptics: Don't initialize swr regulator for HAP_CFG V3"

parents 0ce006ce 112211dd
Loading
Loading
Loading
Loading
+17 −5
Original line number Diff line number Diff line
@@ -28,6 +28,7 @@
#define HAP_CFG_REVISION2_REG			0x01
#define HAP_CFG_V1				0x1
#define HAP_CFG_V2				0x2
#define HAP_CFG_V3				0x3

#define HAP_CFG_STATUS_DATA_MSB_REG		0x09
/* STATUS_DATA_MSB definitions while MOD_STATUS_SEL is 0 */
@@ -4365,6 +4366,15 @@ static struct attribute *hap_class_attrs[] = {
};
ATTRIBUTE_GROUPS(hap_class);

static bool is_swr_supported(struct haptics_chip *chip)
{
	/* Haptics config version 3 does not support soundwire */
	if (chip->cfg_revision == HAP_CFG_V3)
		return false;

	return true;
}

static int haptics_probe(struct platform_device *pdev)
{
	struct haptics_chip *chip;
@@ -4405,12 +4415,14 @@ static int haptics_probe(struct platform_device *pdev)
		return rc;
	}

	if (is_swr_supported(chip)) {
		rc = haptics_init_swr_slave_regulator(chip);
		if (rc < 0) {
			dev_err(chip->dev, "Initialize swr slave regulator failed, rc = %d\n",
					rc);
			return rc;
		}
	}

	rc = devm_request_threaded_irq(chip->dev, chip->fifo_empty_irq,
			NULL, fifo_empty_irq_handler,