Skip to content

Commit

Permalink
NVT-Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
negrroo1 committed Jan 27, 2020
1 parent 1854649 commit 2b855b5
Show file tree
Hide file tree
Showing 14 changed files with 171 additions and 976 deletions.
131 changes: 131 additions & 0 deletions drivers/input/touchscreen/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,137 @@ config TOUCHSCREEN_CYTTSP4_SPI
To compile this driver as a module, choose M here: the
module will be called cyttsp4_spi.

config TOUCHSCREEN_CYPRESS_CYTTSP5
tristate "Parade TrueTouch Gen5 Touchscreen Driver"
default n
help
Core driver for Parade TrueTouch(tm) Standard Product
Geneartion5 touchscreen controllers.

Say Y here if you have a Parade Gen5 touchscreen.

If unsure, say N.

To compile this driver as a module, choose M here: the
module will be called cyttsp5.

config TOUCHSCREEN_CYPRESS_CYTTSP5_DEVICETREE_SUPPORT
bool "Enable Device Tree support"
depends on TOUCHSCREEN_CYPRESS_CYTTSP5 && OF
default n
help
Devicetree parsor for Parade TrueTouch(tm) Standard Product
Geneartion5 touchscreen controllers. Say Y here to enable
support for device tree.

If unsure, say N.

config TOUCHSCREEN_CYPRESS_CYTTSP5_I2C
tristate "Parade TrueTouch Gen5 I2C"
depends on TOUCHSCREEN_CYPRESS_CYTTSP5
select I2C
default n
help
Say Y here to enable I2C bus interface to Parade
TrueTouch(tm) Standard Product Generation5 touchscreen
controller.

If unsure, say Y.

To compile this driver as a module, choose M here: the
module will be called cyttsp5_i2c.

config TOUCHSCREEN_CYPRESS_CYTTSP5_SPI
tristate "Parade TrueTouch Gen5 SPI"
depends on TOUCHSCREEN_CYPRESS_CYTTSP5
select SPI
help
Say Y here to enable SPI bus interface to Parade
TrueTouch(tm) Standard Product Generation5 touchscreen
controller.

If unsure, say N.

To compile this driver as a module, choose M here: the
module will be called cyttsp5_spi.

config TOUCHSCREEN_CYPRESS_CYTTSP5_MT_A
bool "Parade TrueTouch Gen5 MultiTouch Protocol A"
depends on TOUCHSCREEN_CYPRESS_CYTTSP5
help
This option controls which MultiTouch protocol will be
used to report the touch events. This depends on your
usage.

Select to enable MultiTouch touch reporting using protocol A
on Parade TrueTouch(tm) Standard Product Generation4 touchscreen
controller.

If unsure, say N.

config TOUCHSCREEN_CYPRESS_CYTTSP5_MT_B
bool "Parade TrueTouch Gen5 MultiTouch Protocol B"
depends on TOUCHSCREEN_CYPRESS_CYTTSP5
default n
help
This option controls which MultiTouch protocol will be
used to report the touch events. This depends on your
usage.

Select to enable MultiTouch touch reporting using protocol B
on Parade TrueTouch(tm) Standard Product Generation4 touchscreen
controller.

If unsure, say N.

config TOUCHSCREEN_CYPRESS_CYTTSP5_BUTTON
bool "Parade TrueTouch Gen5 MultiTouch CapSense Button"
depends on TOUCHSCREEN_CYPRESS_CYTTSP5
default n
help
Say Y here to enable CapSense reporting on Parade
TrueTouch(tm) Standard Product Generation5 touchscreen
controller.

If unsure, say N.

config TOUCHSCREEN_CYPRESS_CYTTSP5_PROXIMITY
bool "Parade TrueTouch Gen5 Proximity"
depends on TOUCHSCREEN_CYPRESS_CYTTSP5
default n
help
Say Y here to enable proximity reporting on Parade
TrueTouch(tm) Standard Product Generation5 touchscreen
controller.

If unsure, say N.

config TOUCHSCREEN_CYPRESS_CYTTSP5_DEVICE_ACCESS
tristate "Parade TrueTouch Gen5 MultiTouch Device Access"
depends on TOUCHSCREEN_CYPRESS_CYTTSP5
default n
help
Say Y here to enable Parade TrueTouch(tm) Standard Product
Generation5 touchscreen controller device access module.

This modules adds an interface to access touchscreen
controller using driver sysfs nodes.

If unsure, say N.

To compile this driver as a module, choose M here: the
module will be called cyttsp5_device_access.

config TOUCHSCREEN_CYPRESS_CYTTSP5_DEVICE_ACCESS_API
bool "Enable Device Access kernel API"
depends on TOUCHSCREEN_CYPRESS_CYTTSP5_DEVICE_ACCESS
help
Say Y here to enable Device access kernel API which provides
access to Parade TrueTouch(tm) Standard Product Generation5
touchscreen controller for other modules.

If unsure, say N.

config TOUCHSCREEN_DA9034
tristate "Touchscreen support for Dialog Semiconductor DA9034"
depends on PMIC_DA903X
Expand Down
1 change: 1 addition & 0 deletions drivers/input/touchscreen/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ obj-$(CONFIG_TOUCHSCREEN_CYTTSP_SPI) += cyttsp_spi.o
obj-$(CONFIG_TOUCHSCREEN_CYTTSP4_CORE) += cyttsp4_core.o
obj-$(CONFIG_TOUCHSCREEN_CYTTSP4_I2C) += cyttsp4_i2c.o cyttsp_i2c_common.o
obj-$(CONFIG_TOUCHSCREEN_CYTTSP4_SPI) += cyttsp4_spi.o
obj-$(CONFIG_TOUCHSCREEN_CYPRESS_CYTTSP5) += cyttsp5/
obj-$(CONFIG_TOUCHSCREEN_DA9034) += da9034-ts.o
obj-$(CONFIG_TOUCHSCREEN_DA9052) += da9052_tsi.o
obj-$(CONFIG_TOUCHSCREEN_DYNAPRO) += dynapro.o
Expand Down
40 changes: 0 additions & 40 deletions drivers/input/touchscreen/atmel_mxt_ts.c
Original file line number Diff line number Diff line change
Expand Up @@ -2462,50 +2462,10 @@ static int mxt_read_rev(struct mxt_data *data)

if (val == 0)
break;

case MXT_TOUCH_MULTI_T9:
data->multitouch = MXT_TOUCH_MULTI_T9;
/* Only handle messages from first T9 instance */
data->T9_reportid_min = min_id;
data->T9_reportid_max = min_id +
object->num_report_ids - 1;
data->num_touchids = object->num_report_ids;
break;
case MXT_SPT_MESSAGECOUNT_T44:
data->T44_address = object->start_address;
break;
case MXT_SPT_GPIOPWM_T19:
data->T19_reportid = min_id;
break;
case MXT_TOUCH_MULTITOUCHSCREEN_T100:
data->multitouch = MXT_TOUCH_MULTITOUCHSCREEN_T100;
data->T100_reportid_min = min_id;
data->T100_reportid_max = max_id;
/* first two report IDs reserved */
data->num_touchids = object->num_report_ids - 2;
break;
}

end_address = object->start_address
+ mxt_obj_size(object) * mxt_obj_instances(object) - 1;

if (end_address >= data->mem_size)
data->mem_size = end_address + 1;

i++;
msleep(10);
}

/* Store maximum reportid */
data->max_reportid = reportid;

/* If T44 exists, T5 position has to be directly after */
if (data->T44_address && (data->T5_address != data->T44_address + 1)) {
dev_err(&client->dev, "Invalid T44 position\n");
error = -EINVAL;
goto free_object_table;
}

ret = mxt_read_object(data, MXT_DEBUG_DIAGNOSTIC_T37,
MXT_DIAG_REV_ID, &data->rev_id);
if (ret) {
Expand Down
4 changes: 2 additions & 2 deletions drivers/input/touchscreen/cyttsp5/cyttsp5_device_access.c
Original file line number Diff line number Diff line change
Expand Up @@ -1666,11 +1666,11 @@ static ssize_t cyttsp5_cmcp_test_show(struct device *dev,
if (no_builtin_file)
goto no_builtin;

if (test_item & CM_ENABLED)
if (test_item && CM_ENABLED)
validate_cm_test_results(dev, configuration, cmcp_info,
result, &final_pass, test_item);

if (test_item & CP_ENABLED)
if (test_item && CP_ENABLED)
validate_cp_test_results(dev, configuration, cmcp_info,
result, &final_pass, test_item);
no_builtin:
Expand Down
38 changes: 17 additions & 21 deletions drivers/input/touchscreen/cyttsp5/cyttsp5_loader.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,19 +42,13 @@
#define CYTTSP5_AUTO_LOAD_FOR_CORRUPTED_FW 1
#define CYTTSP5_LOADER_FW_UPGRADE_RETRY_COUNT 3

#if defined(CONFIG_TOUCHSCREEN_CYPRESS_CYTTSP5_PLATFORM_FW_UPGRADE) || \
defined(CONFIG_TOUCHSCREEN_CYPRESS_CYTTSP5_BINARY_FW_UPGRADE)
#define CYTTSP5_FW_UPGRADE 1
#else
#define CYTTSP5_FW_UPGRADE 0
#endif
#define CYTTSP5_FW_UPGRADE \
(defined(CONFIG_TOUCHSCREEN_CYPRESS_CYTTSP5_PLATFORM_FW_UPGRADE) \
|| defined(CONFIG_TOUCHSCREEN_CYPRESS_CYTTSP5_BINARY_FW_UPGRADE))

#if defined(CONFIG_TOUCHSCREEN_CYPRESS_CYTTSP5_PLATFORM_TTCONFIG_UPGRADE) || \
defined(CONFIG_TOUCHSCREEN_CYPRESS_CYTTSP5_MANUAL_TTCONFIG_UPGRADE)
#define CYTTSP5_TTCONFIG_UPGRADE 1
#else
#define CYTTSP5_TTCONFIG_UPGRADE 0
#endif
#define CYTTSP5_TTCONFIG_UPGRADE \
(defined(CONFIG_TOUCHSCREEN_CYPRESS_CYTTSP5_PLATFORM_TTCONFIG_UPGRADE) \
|| defined(CONFIG_TOUCHSCREEN_CYPRESS_CYTTSP5_MANUAL_TTCONFIG_UPGRADE))

static const u8 cyttsp5_security_key[] = {
0xA5, 0x01, 0x02, 0x03, 0xFF, 0xFE, 0xFD, 0x5A
Expand Down Expand Up @@ -121,7 +115,7 @@ static inline struct cyttsp5_loader_data *cyttsp5_get_loader_data(
return cyttsp5_get_module_data(dev, &loader_module);
}

#if defined(CYTTSP5_FW_UPGRADE) \
#if CYTTSP5_FW_UPGRADE \
|| defined(CONFIG_TOUCHSCREEN_CYPRESS_CYTTSP5_PLATFORM_TTCONFIG_UPGRADE)
static u8 cyttsp5_get_panel_id(struct device *dev)
{
Expand All @@ -131,7 +125,7 @@ static u8 cyttsp5_get_panel_id(struct device *dev)
}
#endif

#if defined(CYTTSP5_FW_UPGRADE) || defined(CYTTSP5_TTCONFIG_UPGRADE)
#if CYTTSP5_FW_UPGRADE || CYTTSP5_TTCONFIG_UPGRADE
/*
* return code:
* -1: Do not upgrade firmware
Expand Down Expand Up @@ -236,7 +230,7 @@ static int cyttsp5_calibration_attention(struct device *dev)

#endif /* CYTTSP5_FW_UPGRADE || CYTTSP5_TTCONFIG_UPGRADE */

#ifdef CYTTSP5_FW_UPGRADE
#if CYTTSP5_FW_UPGRADE
static u8 *cyttsp5_get_row_(struct device *dev, u8 *row_buf,
u8 *image_buf, int size)
{
Expand Down Expand Up @@ -832,7 +826,7 @@ static int upgrade_firmware_from_builtin(struct device *dev)
}
#endif /* CONFIG_TOUCHSCREEN_CYPRESS_CYTTSP5_BINARY_FW_UPGRADE */

#ifdef CONFIG_TOUCHSCREEN_CYPRESS_CYTTSP5_MANUAL_TTCONFIG_UPGRADE
#if CYTTSP5_TTCONFIG_UPGRADE
static int cyttsp5_write_config_row_(struct device *dev, u8 ebid,
u16 row_number, u16 row_size, u8 *data)
{
Expand Down Expand Up @@ -973,7 +967,9 @@ static int cyttsp5_upgrade_ttconfig(struct device *dev,

return rc;
}
#endif /* CYTTSP5_TTCONFIG_UPGRADE */

#ifdef CONFIG_TOUCHSCREEN_CYPRESS_CYTTSP5_PLATFORM_TTCONFIG_UPGRADE
static int cyttsp5_get_ttconfig_crc(struct device *dev,
const u8 *ttconfig_data, int ttconfig_size, u16 *crc)
{
Expand Down Expand Up @@ -1362,7 +1358,7 @@ static void cyttsp5_fw_and_config_upgrade(
if (!ld->si)
dev_err(dev, "%s: Fail get sysinfo pointer from core\n",
__func__);
#if !defined(CYTTSP5_FW_UPGRADE)
#if !CYTTSP5_FW_UPGRADE
dev_info(dev, "%s: No FW upgrade method selected!\n", __func__);
#endif

Expand All @@ -1382,7 +1378,7 @@ static void cyttsp5_fw_and_config_upgrade(
#endif
}

#ifdef CYTTSP5_FW_UPGRADE
#if CYTTSP5_FW_UPGRADE
static int cyttsp5_fw_upgrade_cb(struct device *dev)
{
#ifdef CONFIG_TOUCHSCREEN_CYPRESS_CYTTSP5_PLATFORM_FW_UPGRADE
Expand Down Expand Up @@ -1493,7 +1489,7 @@ static int cyttsp5_loader_probe(struct device *dev, void **data)
ld->dev = dev;
*data = ld;

#ifdef CYTTSP5_FW_UPGRADE
#if CYTTSP5_FW_UPGRADE
init_completion(&ld->int_running);
#ifdef CONFIG_TOUCHSCREEN_CYPRESS_CYTTSP5_BINARY_FW_UPGRADE
init_completion(&ld->builtin_bin_fw_complete);
Expand All @@ -1504,7 +1500,7 @@ static int cyttsp5_loader_probe(struct device *dev, void **data)
cmd->subscribe_attention(dev, CY_ATTEN_LOADER, CYTTSP5_LOADER_NAME,
cyttsp5_fw_upgrade_cb, CY_MODE_UNKNOWN);
#endif
#if defined(CYTTSP5_FW_UPGRADE) || defined(CYTTSP5_TTCONFIG_UPGRADE)
#if CYTTSP5_FW_UPGRADE || CYTTSP5_TTCONFIG_UPGRADE
init_completion(&ld->calibration_complete);
INIT_WORK(&ld->calibration_work, cyttsp5_calibrate_idacs);
#endif
Expand Down Expand Up @@ -1547,7 +1543,7 @@ static void cyttsp5_loader_release(struct device *dev, void *data)
{
struct cyttsp5_loader_data *ld = (struct cyttsp5_loader_data *)data;

#ifdef CYTTSP5_FW_UPGRADE
#if CYTTSP5_FW_UPGRADE
cmd->unsubscribe_attention(dev, CY_ATTEN_IRQ, CYTTSP5_LOADER_NAME,
cyttsp5_loader_attention, CY_MODE_BOOTLOADER);

Expand Down
Loading

0 comments on commit 2b855b5

Please sign in to comment.