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

Commit 2a06e6e9 authored by Sandeep Panda's avatar Sandeep Panda
Browse files

msm: mdss: adv: fail ADV7533 probe if check revision fails



In current implementation we are ignoring check revision
failure for ADV7533 probe which might be because the chip
itself is not connected to platform. Due to this we are not
disabling the power supply even though chip is not connected
and going ahead causing power leakage. This change fixes the
same.

Change-Id: I2181aba5978a4364d741a96f659771204fe5a2ee
Signed-off-by: default avatarSandeep Panda <spanda@codeaurora.org>
parent d8a56111
Loading
Loading
Loading
Loading
+11 −8
Original line number Diff line number Diff line
/* Copyright (c) 2015, The Linux Foundation. All rights reserved.
/* Copyright (c) 2015-2016, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -399,7 +399,7 @@ w_regs_fail:
	return ret;
}

static void adv7533_read_device_rev(struct adv7533 *pdata)
static int adv7533_read_device_rev(struct adv7533 *pdata)
{
	u8 rev = 0;
	int ret;
@@ -407,10 +407,7 @@ static void adv7533_read_device_rev(struct adv7533 *pdata)
	ret = adv7533_read(pdata, I2C_ADDR_MAIN, ADV7533_REG_CHIP_REVISION,
							&rev, 1);

	if (!ret)
		pr_debug("%s: adv7533 revision 0x%X\n", __func__, rev);
	else
		pr_err("%s: adv7533 rev error\n", __func__);
	return ret;
}

static int adv7533_program_i2c_addr(struct adv7533 *pdata)
@@ -1901,12 +1898,16 @@ static int adv7533_probe(struct i2c_client *client,

	mutex_init(&pdata->ops_mutex);

	adv7533_read_device_rev(pdata);
	ret = adv7533_read_device_rev(pdata);
	if (ret) {
		pr_err("%s: Failed to read chip rev\n", __func__);
		goto err_i2c_prog;
	}

	ret = adv7533_program_i2c_addr(pdata);
	if (ret != 0) {
		pr_err("%s: Failed to program i2c addr\n", __func__);
		goto err_dt_parse;
		goto err_i2c_prog;
	}

	ret = adv7533_register_dba(pdata);
@@ -1980,6 +1981,8 @@ err_irq:
err_gpio_cfg:
	adv7533_unregister_dba(pdata);
err_dba_reg:
err_i2c_prog:
	adv7533_config_vreg(pdata, 0);
err_dt_parse:
	devm_kfree(&client->dev, pdata);
	return ret;