type stringclasses 5
values | content stringlengths 9 163k |
|---|---|
functions | int mms100_enter_ISC_mode(struct i2c_client *_client)
{
int ret;
unsigned char wr_buf[2];
pr_info("[TSP ISC] %s\n", __func__);
wr_buf[0] = ISC_CMD_ENTER_ISC;
wr_buf[1] = ISC_CMD_ENTER_ISC_PARA1;
ret = i2c_master_send(_client, wr_buf, 2);
if (ret < 0) {
pr_info("[TSP ISC] %s,%d: i2c write fail[%d]\n",
__... |
functions | int mms100_enter_config_update(struct i2c_client *_client)
{
int ret;
unsigned char wr_buf[10] = {0,} |
functions | int mms100_ISC_clear_page(struct i2c_client *_client,
unsigned char _page_addr)
{
int ret;
unsigned char rd_buf;
memset(&g_wr_buf[3], 0xFF, PAGE_DATA);
g_wr_buf[0] = ISC_CMD_UPDATE_MODE; /* command */
g_wr_buf[1] = ISC_SUBCMD_DATA_WRITE; /* sub_command */
g_wr_buf[2] = _page_addr;
g_wr_buf[PAGE_HEADER + PAG... |
functions | int mms100_ISC_clear_validate_markers(struct i2c_client *_client)
{
int ret_msg;
int i, j;
bool is_matched_address;
for (i = SEC_CORE; i <= SEC_PUBLIC_CONFIG; i++) {
if (section_update_flag[i]) {
if (ts_info[i].end_addr <= 30 &&
ts_info[i].end_addr > 0) {
ret_msg = mms100_ISC_clear_page(_client,
... |
functions | int mms100_update_section_data(struct i2c_client *_client)
{
int i, ret, next_ptr;
unsigned char rd_buf;
const unsigned char *ptr_fw;
char str_buf[STRING_BUF_LEN];
int page_addr;
for (i = 0; i < SECTION_NUM; i++) {
if (section_update_flag[i]) {
pr_info("[TSP ISC] section data i2c flash : [%d]", i);
next... |
functions | eISCRet_t mms100_open_mbinary(struct i2c_client *_client)
{
int i;
char file_name[64];
int ret = 0;
ret += request_firmware(&(fw_mbin[1]),\
"tsp_melfas/CORE.fw", &_client->dev);
ret += request_firmware(&(fw_mbin[2]),\
"tsp_melfas/PRIV.fw", &_client->dev);
ret += request_firmware(&(fw_mbin[3]),\
"tsp_... |
functions | eISCRet_t mms100_close_mbinary(void)
{
int i;
for (i = 0; i < SECTION_NUM; i++) {
if (fw_mbin[i] != NULL)
release_firmware(fw_mbin[i]);
} |
functions | eISCRet_t mms100_ISC_download_mbinary(struct mms_ts_info *info)
{
struct i2c_client *_client = info->client;
eISCRet_t ret_msg = ISC_NONE;
pr_info("[TSP ISC] %s\n", __func__);
mms100_reset(info);
/* ret_msg = mms100_check_operating_mode(_client, EC_BOOT_ON_SUCCEEDED);
if (ret_msg != ISC_SUCCESS)
goto ISC_ERRO... |
functions | void hw_reboot(struct mms_ts_info *info, bool bootloader)
{
info->pdata->power(false);
gpio_direction_output(info->pdata->gpio_sda, bootloader ? 0 : 1);
gpio_direction_output(info->pdata->gpio_scl, bootloader ? 0 : 1);
gpio_direction_output(info->pdata->gpio_int, 0);
msleep(30);
info->pdata->power(true);
msleep(... |
functions | void hw_reboot_bootloader(struct mms_ts_info *info)
{
hw_reboot(info, true);
} |
functions | void hw_reboot_normal(struct mms_ts_info *info)
{
hw_reboot(info, false);
} |
functions | void isp_toggle_clk(struct mms_ts_info *info, int start_lvl, int end_lvl,
int hold_us)
{
gpio_set_value(info->pdata->gpio_scl, start_lvl);
udelay(hold_us);
gpio_set_value(info->pdata->gpio_scl, end_lvl);
udelay(hold_us);
} |
functions | void isp_send_bits(struct mms_ts_info *info, u32 data, int cnt)
{
gpio_direction_output(info->pdata->gpio_int, 0);
gpio_direction_output(info->pdata->gpio_scl, 0);
gpio_direction_output(info->pdata->gpio_sda, 0);
/* clock out the bits, msb first */
while (cnt--) {
gpio_set_value(info->pdata->gpio_sda, (data >> ... |
functions | u32 isp_recv_bits(struct mms_ts_info *info, int cnt)
{
u32 data = 0;
gpio_direction_output(info->pdata->gpio_int, 0);
gpio_direction_output(info->pdata->gpio_scl, 0);
gpio_set_value(info->pdata->gpio_sda, 0);
gpio_direction_input(info->pdata->gpio_sda);
/* clock in the bits, msb first */
while (cnt--) {
isp_... |
functions | void isp_enter_mode(struct mms_ts_info *info, u32 mode)
{
int cnt;
unsigned long flags;
local_irq_save(flags);
gpio_direction_output(info->pdata->gpio_int, 0);
gpio_direction_output(info->pdata->gpio_scl, 0);
gpio_direction_output(info->pdata->gpio_sda, 1);
mode &= 0xffff;
for (cnt = 15; cnt >= 0; cnt--) {
... |
functions | void isp_exit_mode(struct mms_ts_info *info)
{
int i;
unsigned long flags;
local_irq_save(flags);
gpio_direction_output(info->pdata->gpio_int, 0);
udelay(3);
for (i = 0; i < 10; i++)
isp_toggle_clk(info, 1, 0, 3);
local_irq_restore(flags);
} |
functions | void flash_set_address(struct mms_ts_info *info, u16 addr)
{
/* Only 13 bits of addr are valid.
* The addr is in bits 13:1 of cmd */
isp_send_bits(info, (u32) (addr & 0x1fff) << 1, 18);
} |
functions | void flash_erase(struct mms_ts_info *info)
{
isp_enter_mode(info, ISP_MODE_FLASH_ERASE);
gpio_direction_output(info->pdata->gpio_int, 0);
gpio_direction_output(info->pdata->gpio_scl, 0);
gpio_direction_output(info->pdata->gpio_sda, 1);
/* 4 clock cycles with different timings for the erase to
* get processed, ... |
functions | u32 flash_readl(struct mms_ts_info *info, u16 addr)
{
int i;
u32 val;
unsigned long flags;
local_irq_save(flags);
isp_enter_mode(info, ISP_MODE_FLASH_READ);
flash_set_address(info, addr);
gpio_direction_output(info->pdata->gpio_scl, 0);
gpio_direction_output(info->pdata->gpio_sda, 0);
udelay(40);
/* data l... |
functions | void flash_writel(struct mms_ts_info *info, u16 addr, u32 val)
{
unsigned long flags;
local_irq_save(flags);
isp_enter_mode(info, ISP_MODE_FLASH_WRITE);
flash_set_address(info, addr);
isp_send_bits(info, val, 32);
gpio_direction_output(info->pdata->gpio_sda, 1);
/* 6 clock cycles with different timings for the... |
functions | bool flash_is_erased(struct mms_ts_info *info)
{
struct i2c_client *client = info->client;
u32 val;
u16 addr;
for (addr = 0; addr < (ISP_MAX_FW_SIZE / 4); addr++) {
udelay(40);
val = flash_readl(info, addr);
if (val != 0xffffffff) {
dev_dbg(&client->dev,
"addr 0x%x not erased: 0x%08x != 0xffffffff\n"... |
functions | int fw_write_image(struct mms_ts_info *info, const u8 * data, size_t len)
{
struct i2c_client *client = info->client;
u16 addr = 0;
for (addr = 0; addr < (len / 4); addr++, data += 4) {
u32 val = get_unaligned_le32(data);
u32 verify_val;
int retries = 3;
while (retries--) {
flash_writel(info, addr, val)... |
functions | int fw_download(struct mms_ts_info *info, const u8 * data, size_t len)
{
struct i2c_client *client = info->client;
u32 val;
int ret = 0;
if (len % 4) {
dev_err(&client->dev,
"fw image size (%d) must be a multiple of 4 bytes\n",
len);
return -EINVAL;
} |
functions | else if (len > ISP_MAX_FW_SIZE) {
dev_err(&client->dev,
"fw image is too big, %d > %d\n", len, ISP_MAX_FW_SIZE);
return -EINVAL;
} |
functions | u16 gen_crc(u8 data, u16 pre_crc)
{
u16 crc;
u16 cur;
u16 temp;
u16 bit_1;
u16 bit_2;
int i;
crc = pre_crc;
for (i = 7; i >= 0; i--) {
cur = ((data >> i) & 0x01) ^ (crc & 0x0001);
bit_1 = cur ^ (crc >> 11 & 0x01);
bit_2 = cur ^ (crc >> 4 & 0x01);
temp = (cur << 4) | (crc >> 12 & 0x0F);
temp = (temp <... |
functions | int isc_fw_download(struct mms_ts_info *info, const u8 * data,
size_t len)
{
u8 *buff;
u16 crc_buf;
int src_idx;
int dest_idx;
int ret;
int i, j;
buff = kzalloc(ISC_PKT_SIZE, GFP_KERNEL);
if (!buff) {
dev_err(&info->client->dev, "%s: failed to allocate memory\n",
__func__);
ret = -1;
goto err_me... |
functions | int get_fw_version(struct mms_ts_info *info)
{
int ret;
int retries = 3;
/* this seems to fail sometimes after a reset.. retry a few times */
do {
ret = i2c_smbus_read_byte_data(info->client, MMS_FW_VERSION);
} |
functions | int get_hw_version(struct mms_ts_info *info)
{
int ret;
int retries = 3;
/* this seems to fail sometimes after a reset.. retry a few times */
do {
ret = i2c_smbus_read_byte_data(info->client, MMS_HW_REVISION);
} |
functions | int mms_ts_enable(struct mms_ts_info *info, int wakeupcmd)
{
mutex_lock(&info->lock);
if (info->enabled)
goto out;
/* wake up the touch controller. */
if (wakeupcmd == 1) {
i2c_smbus_write_byte_data(info->client, 0, 0);
usleep_range(3000, 5000);
} |
functions | int mms_ts_disable(struct mms_ts_info *info, int sleepcmd)
{
mutex_lock(&info->lock);
if (!info->enabled)
goto out;
disable_irq_nosync(info->irq);
if (sleepcmd == 1) {
i2c_smbus_write_byte_data(info->client, MMS_MODE_CONTROL, 0);
usleep_range(10000, 12000);
} |
functions | int mms_ts_finish_config(struct mms_ts_info *info)
{
struct i2c_client *client = info->client;
int ret;
ret = request_threaded_irq(client->irq, NULL, mms_ts_interrupt,
IRQF_TRIGGER_LOW | IRQF_ONESHOT,
MELFAS_TS_NAME, info);
if (ret < 0) {
ret = 1;
dev_err(&client->dev, "Failed to register inter... |
functions | int mms_ts_fw_info(struct mms_ts_info *info)
{
struct i2c_client *client = info->client;
struct i2c_adapter *adapter = to_i2c_adapter(client->dev.parent);
int ret = 0;
int ver, hw_rev;
ver = get_fw_version(info);
info->fw_ic_ver = ver;
dev_info(&client->dev,
"[TSP]fw version 0x%02x !!!!\n", ver);
hw_rev ... |
functions | int mms_ts_fw_load(struct mms_ts_info *info)
{
struct i2c_client *client = info->client;
struct i2c_adapter *adapter = to_i2c_adapter(client->dev.parent);
int ret = 0;
int ver, hw_rev;
int retries = 3;
ver = get_fw_version(info);
info->fw_ic_ver = ver;
dev_info(&client->dev,
"[TSP]fw version 0x%02x !!!!\n"... |
functions | void set_cmd_result(struct mms_ts_info *info, char *buff, int len)
{
strncat(info->cmd_result, buff, len);
} |
functions | void get_raw_data_all(struct mms_ts_info *info, u8 cmd)
{
u8 w_buf[6];
u8 read_buffer[2]; /* 52 */
int gpio;
int ret;
int i, j;
u32 max_value = 0, min_value = 0;
u32 raw_data;
char buff[TSP_CMD_STR_LEN] = {0} |
functions | else if (cmd == MMS_VSC_CMD_CM_DELTA) {
info->inspection[i * TX_NUM + j] = raw_data;
dev_dbg(&info->client->dev, "[TSP] delta[%d][%d] = %d\n",
j, i, info->inspection[i * TX_NUM + j]);
} |
functions | else if (cmd == MMS_VSC_CMD_CM_ABS) {
info->raw[i * TX_NUM + j] = raw_data;
dev_dbg(&info->client->dev, "[TSP] raw[%d][%d] = %d\n",
j, i, info->raw[i * TX_NUM + j]);
} |
functions | else if (cmd == MMS_VSC_CMD_REFER) {
info->reference[i * TX_NUM + j] =
raw_data >> 3;
dev_dbg(&info->client->dev, "[TSP] reference[%d][%d] = %d\n",
j, i, info->reference[i * TX_NUM + j]);
} |
functions | u32 get_raw_data_one(struct mms_ts_info *info, u16 rx_idx, u16 tx_idx,
u8 cmd)
{
u8 w_buf[6];
u8 read_buffer[2];
int ret;
u32 raw_data;
w_buf[0] = MMS_VSC_CMD; /* vendor specific command id */
w_buf[1] = MMS_VSC_MODE; /* mode of vendor */
w_buf[2] = 0; /* tx line */
w_buf[3] = 0; /* rx line */
w_buf[... |
functions | ssize_t show_close_tsp_test(struct device *dev,
struct device_attribute *attr, char *buf)
{
struct mms_ts_info *info = dev_get_drvdata(dev);
get_raw_data_all(info, MMS_VSC_CMD_EXIT);
info->ft_flag = 0;
return snprintf(buf, TSP_BUF_SIZE, "%u\n", 0);
} |
functions | void set_default_result(struct mms_ts_info *info)
{
char delim = ':';
memset(info->cmd_result, 0x00, ARRAY_SIZE(info->cmd_result));
memcpy(info->cmd_result, info->cmd, strlen(info->cmd));
strncat(info->cmd_result, &delim, 1);
} |
functions | int check_rx_tx_num(void *device_data)
{
struct mms_ts_info *info = (struct mms_ts_info *)device_data;
char buff[TSP_CMD_STR_LEN] = {0} |
functions | void not_support_cmd(void *device_data)
{
struct mms_ts_info *info = (struct mms_ts_info *)device_data;
char buff[16] = {0} |
functions | void fw_update(void *device_data)
{
struct mms_ts_info *info = (struct mms_ts_info *)device_data;
struct i2c_client *client = info->client;
struct i2c_adapter *adapter = to_i2c_adapter(client->dev.parent);
int ret = 0;
int ver = 0, fw_bin_ver = 0;
int retries = 5;
const u8 *buff = 0;
mm_segment_t old_fs = {0} |
functions | else if (ver == fw_bin_ver) {
dev_info(&client->dev,
"fw update done. ver = 0x%02x\n", ver);
info->cmd_state = 2;
snprintf(result, sizeof(result) , "%s", "OK");
set_cmd_result(info, result,
strnlen(result, sizeof(result)));
enable_irq(info->irq);
return;
} |
functions | void get_fw_ver_bin(void *device_data)
{
struct mms_ts_info *info = (struct mms_ts_info *)device_data;
char buff[16] = {0} |
functions | void get_fw_ver_ic(void *device_data)
{
struct mms_ts_info *info = (struct mms_ts_info *)device_data;
char buff[16] = {0} |
functions | void get_config_ver(void *device_data)
{
struct mms_ts_info *info = (struct mms_ts_info *)device_data;
char buff[20] = {0} |
functions | void get_threshold(void *device_data)
{
struct mms_ts_info *info = (struct mms_ts_info *)device_data;
char buff[16] = {0} |
functions | void module_off_master(void *device_data)
{
struct mms_ts_info *info = (struct mms_ts_info *)device_data;
char buff[3] = {0} |
functions | void module_on_master(void *device_data)
{
struct mms_ts_info *info = (struct mms_ts_info *)device_data;
char buff[3] = {0} |
functions | void module_off_slave(void *device_data)
{
struct mms_ts_info *info = (struct mms_ts_info *)device_data;
not_support_cmd(info);
} |
functions | void module_on_slave(void *device_data)
{
struct mms_ts_info *info = (struct mms_ts_info *)device_data;
not_support_cmd(info);
} |
functions | void get_chip_vendor(void *device_data)
{
struct mms_ts_info *info = (struct mms_ts_info *)device_data;
char buff[16] = {0} |
functions | void get_chip_name(void *device_data)
{
struct mms_ts_info *info = (struct mms_ts_info *)device_data;
char buff[16] = {0} |
functions | void get_reference(void *device_data)
{
struct mms_ts_info *info = (struct mms_ts_info *)device_data;
char buff[16] = {0} |
functions | void get_cm_abs(void *device_data)
{
struct mms_ts_info *info = (struct mms_ts_info *)device_data;
char buff[16] = {0} |
functions | void get_cm_delta(void *device_data)
{
struct mms_ts_info *info = (struct mms_ts_info *)device_data;
char buff[16] = {0} |
functions | void get_intensity(void *device_data)
{
struct mms_ts_info *info = (struct mms_ts_info *)device_data;
char buff[16] = {0} |
functions | void get_x_num(void *device_data)
{
struct mms_ts_info *info = (struct mms_ts_info *)device_data;
char buff[16] = {0} |
functions | void get_y_num(void *device_data)
{
struct mms_ts_info *info = (struct mms_ts_info *)device_data;
char buff[16] = {0} |
functions | void run_reference_read(void *device_data)
{
struct mms_ts_info *info = (struct mms_ts_info *)device_data;
set_default_result(info);
get_raw_data_all(info, MMS_VSC_CMD_REFER);
info->cmd_state = 2;
/* dev_info(&info->client->dev, "%s: %s(%d)\n", __func__); */
} |
functions | void run_cm_abs_read(void *device_data)
{
struct mms_ts_info *info = (struct mms_ts_info *)device_data;
set_default_result(info);
get_raw_data_all(info, MMS_VSC_CMD_CM_ABS);
get_raw_data_all(info, MMS_VSC_CMD_EXIT);
info->cmd_state = 2;
/* dev_info(&info->client->dev, "%s: %s(%d)\n", __func__); */
} |
functions | void run_cm_delta_read(void *device_data)
{
struct mms_ts_info *info = (struct mms_ts_info *)device_data;
set_default_result(info);
get_raw_data_all(info, MMS_VSC_CMD_CM_DELTA);
get_raw_data_all(info, MMS_VSC_CMD_EXIT);
info->cmd_state = 2;
/* dev_info(&info->client->dev, "%s: %s(%d)\n", __func__); */
} |
functions | void run_intensity_read(void *device_data)
{
struct mms_ts_info *info = (struct mms_ts_info *)device_data;
set_default_result(info);
get_raw_data_all(info, MMS_VSC_CMD_INTENSITY);
info->cmd_state = 2;
/* dev_info(&info->client->dev, "%s: %s(%d)\n", __func__); */
} |
functions | ssize_t store_cmd(struct device *dev, struct device_attribute
*devattr, const char *buf, size_t count)
{
struct mms_ts_info *info = dev_get_drvdata(dev);
struct i2c_client *client = info->client;
char *cur, *start, *end;
char buff[TSP_CMD_STR_LEN] = {0} |
functions | ssize_t show_cmd_status(struct device *dev,
struct device_attribute *devattr, char *buf)
{
struct mms_ts_info *info = dev_get_drvdata(dev);
char buff[16] = {0} |
functions | ssize_t show_cmd_result(struct device *dev, struct device_attribute
*devattr, char *buf)
{
struct mms_ts_info *info = dev_get_drvdata(dev);
dev_info(&info->client->dev, "tsp cmd: result: %s\n", info->cmd_result);
mutex_lock(&info->cmd_lock);
info->cmd_is_running = false;
mutex_unlock(&info->cmd_lock);
... |
functions | ssize_t show_intensity_logging_on(struct device *dev,
struct device_attribute *devattr, char *buf)
{
struct mms_ts_info *info = dev_get_drvdata(dev);
struct i2c_client *client = info->client;
struct file *fp;
char log_data[160] = { 0, } |
functions | ssize_t show_intensity_logging_off(struct device *dev,
struct device_attribute *devattr, char *buf)
{
struct mms_ts_info *info = dev_get_drvdata(dev);
intensity_log_flag = 0;
usleep_range(10000);
get_raw_data_all(info, MMS_VSC_CMD_EXIT);
return 0;
} |
functions | __devinit mms_ts_probe(struct i2c_client *client,
const struct i2c_device_id *id)
{
struct i2c_adapter *adapter = to_i2c_adapter(client->dev.parent);
struct mms_ts_info *info;
struct input_dev *input_dev;
int ret = 0;
char buf[4] = { 0, } |
functions | __devexit mms_ts_remove(struct i2c_client *client)
{
struct mms_ts_info *info = i2c_get_clientdata(client);
unregister_early_suspend(&info->early_suspend);
if (info->irq >= 0)
free_irq(info->irq, info);
input_unregister_device(info->input_dev);
kfree(info);
return 0;
} |
functions | int mms_ts_suspend(struct device *dev)
{
struct i2c_client *client = to_i2c_client(dev);
struct mms_ts_info *info = i2c_get_clientdata(client);
if (!info->enabled)
return 0;
dev_notice(&info->client->dev, "%s: users=%d\n", __func__,
info->input_dev->users);
disable_irq(info->irq);
info->enabled = false;... |
functions | int mms_ts_resume(struct device *dev)
{
struct i2c_client *client = to_i2c_client(dev);
struct mms_ts_info *info = i2c_get_clientdata(client);
int ret = 0;
if (info->enabled)
return 0;
dev_notice(&info->client->dev, "%s: users=%d\n", __func__,
info->input_dev->users);
info->pdata->power(true);
msleep(12... |
functions | void mms_ts_early_suspend(struct early_suspend *h)
{
struct mms_ts_info *info;
info = container_of(h, struct mms_ts_info, early_suspend);
mms_ts_suspend(&info->client->dev);
} |
functions | void mms_ts_late_resume(struct early_suspend *h)
{
struct mms_ts_info *info;
info = container_of(h, struct mms_ts_info, early_suspend);
mms_ts_resume(&info->client->dev);
} |
functions | __init mms_ts_init(void)
{
return i2c_add_driver(&mms_ts_driver);
} |
functions | __exit mms_ts_exit(void)
{
i2c_del_driver(&mms_ts_driver);
} |
includes | #include <linux/slab.h> |
includes | #include <linux/poll.h> |
includes | #include <linux/fs.h> |
includes | #include <linux/file.h> |
includes | #include <linux/jhash.h> |
includes | #include <linux/init.h> |
includes | #include <linux/futex.h> |
includes | #include <linux/mount.h> |
includes | #include <linux/pagemap.h> |
includes | #include <linux/syscalls.h> |
includes | #include <linux/signal.h> |
includes | #include <linux/export.h> |
includes | #include <linux/magic.h> |
includes | #include <linux/pid.h> |
includes | #include <linux/nsproxy.h> |
includes | #include <linux/ptrace.h> |
includes | #include <linux/sched/rt.h> |
includes | #include <linux/freezer.h> |
includes | #include <linux/hugetlb.h> |
includes |
#include <asm/futex.h> |
defines |
#define FUTEX_HASHBITS (CONFIG_BASE_SMALL ? 4 : 8) |
defines | #define FLAGS_SHARED 0x01 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.