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

Commit 4b26d423 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "input: synaptics_dsx_2.6: Add support for automatic FW upgrade"

parents 7994913f 282ee352
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -28,6 +28,7 @@ Optional property:
 - synaptics,reset-delay-ms	   : reset delay for controller (ms), default 100.
 - synaptics,max-y-for-2d	   : maximal y value of the panel.
 - synaptics,bus-lpm-cur-uA	   : I2C bus idle mode current setting.
 - synaptics,fw-name		   : name of firmware .img file in /lib/firmware
 - clock-names			: Clock names used for secure touch. They are: "iface_clk", "core_clk"
 - clocks			: Defined if 'clock-names' DT property is defined. These clocks
				  are associated with the underlying I2C bus.
+11 −6
Original line number Diff line number Diff line
@@ -43,10 +43,9 @@
#include "synaptics_dsx_core.h"

#define FW_IMAGE_NAME "synaptics/startup_fw_update.img"
/*

#define DO_STARTUP_FW_UPDATE
*/
/*

#ifdef DO_STARTUP_FW_UPDATE
#ifdef CONFIG_FB
#define WAIT_FOR_FB_READY
@@ -54,7 +53,7 @@
#define FB_READY_TIMEOUT_S 30
#endif
#endif
*/

#define FORCE_UPDATE false
#define DO_LOCKDOWN false

@@ -3418,6 +3417,7 @@ static int fwu_start_reflash(void)
	enum flash_area flash_area;
	const struct firmware *fw_entry = NULL;
	struct synaptics_rmi4_data *rmi4_data = fwu->rmi4_data;
	const unsigned char *image_name;

	if (rmi4_data->sensor_sleep) {
		dev_err(rmi4_data->pdev->dev.parent,
@@ -3433,9 +3433,14 @@ static int fwu_start_reflash(void)
	pr_notice("%s: Start of reflash process\n", __func__);

	if (fwu->image == NULL) {
		if (rmi4_data->hw_if->board_data->fw_name)
			image_name = rmi4_data->hw_if->board_data->fw_name;
		else
			image_name = FW_IMAGE_NAME;

		retval = secure_memcpy(fwu->image_name, MAX_IMAGE_NAME_LEN,
				FW_IMAGE_NAME, sizeof(FW_IMAGE_NAME),
				sizeof(FW_IMAGE_NAME));
				image_name, strlen(image_name),
				strlen(image_name));
		if (retval < 0) {
			dev_err(rmi4_data->pdev->dev.parent,
					"%s: Failed to copy image file name\n",
+8 −1
Original line number Diff line number Diff line
@@ -5,7 +5,8 @@
 *
 * Copyright (C) 2012 Alexandra Chin <alexandra.chin@tw.synaptics.com>
 * Copyright (C) 2012 Scott Lin <scott.lin@tw.synaptics.com>
 * Copyright (C) 2016, The Linux Foundation.  All rights reserved.
 * Copyright (C) 2016, 2018 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 as published by
 * the Free Software Foundation; either version 2 of the License, or
@@ -215,6 +216,12 @@ static int parse_dt(struct device *dev, struct synaptics_dsx_board_data *bdata)
		bdata->ub_i2c_addr = -1;
	}

	retval = of_property_read_string(np, "synaptics,fw-name", &name);
	if (retval < 0)
		bdata->fw_name = NULL;
	else
		bdata->fw_name = name;

	prop = of_find_property(np, "synaptics,cap-button-codes", NULL);
	if (prop && prop->length) {
		bdata->cap_button_map->map = devm_kzalloc(dev,
+2 −1
Original line number Diff line number Diff line
@@ -5,7 +5,7 @@
 *
 * Copyright (C) 2012 Alexandra Chin <alexandra.chin@tw.synaptics.com>
 * Copyright (C) 2012 Scott Lin <scott.lin@tw.synaptics.com>
 * Copyright (C) 2016, The Linux Foundation. All rights reserved.
 * Copyright (C) 2016, 2018 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 as published by
@@ -115,6 +115,7 @@ struct synaptics_dsx_board_data {
	const char *bus_reg_name;
	struct synaptics_dsx_button_map *cap_button_map;
	struct synaptics_dsx_button_map *vir_button_map;
	const char *fw_name;
};

#endif