mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-11 23:24:22 -04:00
Chipone: Compatible with android R with 5.4.0
- Change rt_mutex api. - Change input_get_new_minor. NO_PROP_NEEDED: needn't for shm2018 Change-Id: I07ee65f0d340d475936f6a81a7ced6c72753881f Signed-off-by: wengjun1 <wengjun1@motorola.com> Reviewed-on: https://gerrit.mot.com/1795715 SLTApproved: Slta Waiver SME-Granted: SME Approvals Granted Tested-by: Jira Key Reviewed-by: Jianqiu Huang <huangjq9@motorola.com> Reviewed-by: Huosheng Liao <liaohs@motorola.com> Submit-Approved: Jira Key
This commit is contained in:
parent
75c2e82f9c
commit
d3a9845391
4 changed files with 17 additions and 22 deletions
|
|
@ -9,6 +9,8 @@
|
|||
#include "cts_firmware.h"
|
||||
#include "cts_charger_detect.h"
|
||||
|
||||
static DEFINE_RT_MUTEX(dev_lock);
|
||||
|
||||
#ifdef CONFIG_CTS_I2C_HOST
|
||||
static int cts_i2c_writeb(const struct cts_device *cts_dev,
|
||||
u32 addr, u8 b, int retry, int delay)
|
||||
|
|
@ -1197,14 +1199,14 @@ void cts_lock_device(const struct cts_device *cts_dev)
|
|||
{
|
||||
cts_dbg("*** Lock ***");
|
||||
|
||||
rt_mutex_lock(&cts_dev->pdata->dev_lock);
|
||||
rt_mutex_lock(&dev_lock);
|
||||
}
|
||||
|
||||
void cts_unlock_device(const struct cts_device *cts_dev)
|
||||
{
|
||||
cts_dbg("### Un-Lock ###");
|
||||
|
||||
rt_mutex_unlock(&cts_dev->pdata->dev_lock);
|
||||
rt_mutex_unlock(&dev_lock);
|
||||
}
|
||||
|
||||
int cts_set_work_mode(const struct cts_device *cts_dev, u8 mode)
|
||||
|
|
|
|||
|
|
@ -609,7 +609,6 @@ int cts_init_platform_data(struct cts_platform_data *pdata,
|
|||
pdata->spi_client = spi;
|
||||
pdata->spi_client->irq = pdata->irq;
|
||||
#endif /* CONFIG_CTS_I2C_HOST */
|
||||
rt_mutex_init(&pdata->dev_lock);
|
||||
spin_lock_init(&pdata->irq_lock);
|
||||
|
||||
input_dev = input_allocate_device();
|
||||
|
|
|
|||
|
|
@ -98,7 +98,6 @@ struct cts_platform_data {
|
|||
struct work_struct ts_irq_work;
|
||||
#endif /* CONFIG_GENERIC_HARDIRQS */
|
||||
|
||||
struct rt_mutex dev_lock;
|
||||
struct spinlock irq_lock;
|
||||
bool irq_is_disable;
|
||||
|
||||
|
|
|
|||
|
|
@ -2053,7 +2053,7 @@ static ssize_t jitter_store(struct device *dev,
|
|||
|
||||
ret = kstrtou16(argv[0], 0, &cnt);
|
||||
if (ret == 0) {
|
||||
if (cnt > 2 || cnt < 10000) {
|
||||
if (cnt > 2 && cnt < 10000) {
|
||||
jitter_test_frame = cnt;
|
||||
}
|
||||
}
|
||||
|
|
@ -2598,26 +2598,21 @@ static int cts_fw_class_init(void *_data, bool create)
|
|||
int i, error = 0;
|
||||
static struct class *touchscreen_class;
|
||||
static struct device *ts_class_dev;
|
||||
static int minor;
|
||||
dev_t devno;
|
||||
|
||||
cts_info("%s touchscreen class files", create ? "Add" : "Remove");
|
||||
|
||||
if (create) {
|
||||
#ifdef CONFIG_CTS_I2C_HOST
|
||||
minor = input_get_new_minor(data->i2c_client->addr, 1, false);
|
||||
#else
|
||||
minor = input_get_new_minor(data->spi_client->chip_select,
|
||||
1, false);
|
||||
#endif
|
||||
if (minor < 0) {
|
||||
cts_info
|
||||
("Alloc input minor num failed %d, use dynamic mode",
|
||||
minor);
|
||||
minor =
|
||||
input_get_new_minor(TSDEV_MINOR_BASE,
|
||||
TSDEV_MINOR_MAX, true);
|
||||
if(NULL != data->cts_dev.hwdata->name) {
|
||||
error = alloc_chrdev_region(&devno, 0, 1, data->cts_dev.hwdata->name);
|
||||
} else {
|
||||
error = alloc_chrdev_region(&devno, 0, 1, CFG_CTS_CHIP_NAME);
|
||||
}
|
||||
if (error) {
|
||||
cts_info
|
||||
("Alloc input devno failed %d", error);
|
||||
return error;
|
||||
}
|
||||
cts_info("Assigned input device minor %d", minor);
|
||||
|
||||
cts_info("Create class 'touchscreen'");
|
||||
touchscreen_class = class_create(THIS_MODULE, "touchscreen");
|
||||
|
|
@ -2631,12 +2626,12 @@ static int cts_fw_class_init(void *_data, bool create)
|
|||
|
||||
if(NULL != data->cts_dev.hwdata->name) {
|
||||
ts_class_dev = device_create(touchscreen_class, NULL,
|
||||
MKDEV(INPUT_MAJOR, minor),
|
||||
devno,
|
||||
data, "%s", data->cts_dev.hwdata->name);
|
||||
cts_info("Create device for IC: %s", data->cts_dev.hwdata->name);
|
||||
} else {
|
||||
ts_class_dev = device_create(touchscreen_class, NULL,
|
||||
MKDEV(INPUT_MAJOR, minor),
|
||||
devno,
|
||||
data, "%s", CFG_CTS_CHIP_NAME);
|
||||
cts_info("Create device '" CFG_CTS_CHIP_NAME "'");
|
||||
}
|
||||
|
|
@ -2681,7 +2676,7 @@ static int cts_fw_class_init(void *_data, bool create)
|
|||
device_destroy:
|
||||
for (--i; i >= 0; --i)
|
||||
device_remove_file(ts_class_dev, &attrs[i]);
|
||||
device_destroy(touchscreen_class, MKDEV(INPUT_MAJOR, minor));
|
||||
device_destroy(touchscreen_class, devno);
|
||||
ts_class_dev = NULL;
|
||||
class_unregister(touchscreen_class);
|
||||
cts_err("Creating touchscreen class failed %d", error);
|
||||
|
|
|
|||
Loading…
Reference in a new issue