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

Commit fc79252e authored by GG Hou's avatar GG Hou
Browse files

drm/bridge: LT9611UXC: Change LT9611UXC fw version auto-upgrade rule



Change LT9611UXC fw version auto-upgrade rule.
If fw version is 0, means no fw in this chip, need to flash a fw.
Or that do not need to auto-upgrade.

Change-Id: I116495061c5a2d8e1e498f37ab58b5e355219ef8
Signed-off-by: default avatarGG Hou <renjhou@codeaurora.org>
parent ad6d422c
Loading
Loading
Loading
Loading
+8 −9
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (c) 2019, The Linux Foundation. All rights reserved.
 * Copyright (c) 2020, The Linux Foundation. All rights reserved.
 */

#define pr_fmt(fmt) "%s: " fmt, __func__
@@ -40,7 +40,6 @@
#define READ_BUF_MAX_SIZE 64
#define WRITE_BUF_MAX_SIZE 64
#define HPD_UEVENT_BUFFER_SIZE 30
#define VERSION_NUM	0x32

struct lt9611_reg_cfg {
	u8 reg;
@@ -1657,7 +1656,13 @@ static int lt9611_probe(struct i2c_client *client,
	i2c_set_clientdata(client, pdata);
	dev_set_drvdata(&client->dev, pdata);

	if (lt9611_get_version(pdata) == VERSION_NUM) {
	ret = lt9611_sysfs_init(&client->dev);
	if (ret) {
		pr_err("sysfs init failed\n");
		goto err_sysfs_init;
	}

	if (lt9611_get_version(pdata)) {
		pr_info("LT9611 works, no need to upgrade FW\n");
	} else {
		ret = request_firmware_nowait(THIS_MODULE, true,
@@ -1671,12 +1676,6 @@ static int lt9611_probe(struct i2c_client *client,
			return 0;
	}

	ret = lt9611_sysfs_init(&client->dev);
	if (ret) {
		pr_err("sysfs init failed\n");
		goto err_sysfs_init;
	}

#if IS_ENABLED(CONFIG_OF)
	pdata->bridge.of_node = client->dev.of_node;
#endif