type stringclasses 5
values | content stringlengths 9 163k |
|---|---|
functions | int cyttsp_bootload_app(struct cyttsp *ts)
{
cyttsp_debug("no-load new firmware \n");
return CYTTSP_OPERATIONAL;
} |
functions | int cyttsp_power_on(struct cyttsp *ts)
{
int retval = CYTTSP_OPERATIONAL;
u8 host_reg;
int tries;
static u8 bl_cmd[] = {
CYTTSP_BL_FILE0, CYTTSP_BL_CMD, CYTTSP_BL_EXIT,
CYTTSP_BL_KEY0, CYTTSP_BL_KEY1, CYTTSP_BL_KEY2,
CYTTSP_BL_KEY3, CYTTSP_BL_KEY4, CYTTSP_BL_KEY5,
CYTTSP_BL_KEY6, CYTTSP_BL_KEY7} |
functions | int cyttsp_initialize(struct i2c_client *client, struct cyttsp *ts)
{
struct input_dev *input_device;
int error = 0;
int retval = CYTTSP_OPERATIONAL;
u8 id;
#ifdef FEATURE_SKY_PROCESS_CMD_KEY
cyttsp_data = ts;
#endif
/* Create the input device and register it. */
input_device = input_allocate_device();
if ... |
functions | int pantech_auto_check(u8* return_byte)
{
u8 host_reg, byte_data[4], prev_data=0xff, byte_node1[MAX_NODE], byte_node2[MAX_NODE], send_byte[MAX_NODE];
int retval = CYTTSP_OPERATIONAL, retry_cnt = 100, i;
struct cyttsp *ts = ts_temp;
dbg("pantech_auto_check!! start\n");
// If phone enter a poweroff, Stop firmware ... |
functions | int pantech_selftest_check(void)
{
u8 host_reg, byte_data[2];
int retval = CYTTSP_OPERATIONAL;
struct cyttsp *ts = ts_temp;
printk("pantech_selftest_check!! start\n");
// If phone enter a poweroff, Stop firmware update
if(Touch_Status >= TOUCH_POWEROFF)
return -1;
#ifdef CYTTSP_MUTEX_LOCK
mutex_lock(&ts->lo... |
functions | void init_hw_setting(void)
{
int rc;
struct regulator *vreg_touch, *vreg_power_1_8;
gpio_tlmm_config(GPIO_CFG(GPIO_TOUCH_CHG, 0, GPIO_CFG_OUTPUT, GPIO_CFG_NO_PULL, GPIO_CFG_2MA), GPIO_CFG_ENABLE);
gpio_set_value(GPIO_TOUCH_CHG, 0);
// Power On, AVDD
vreg_touch = regulator_get(NULL, "8058_l19");
if (I... |
functions | __devinit cyttsp_probe(struct i2c_client *client, const struct i2c_device_id *id)
{
struct cyttsp *ts;
int error;
int retval = CYTTSP_OPERATIONAL;
#ifdef FEATURE_SKY_PROCESS_CMD_KEY
int rc;
#endif
cyttsp_info("Start Probe\n");
/* allocate and clear memory */
ts = kzalloc (sizeof(struct cyttsp),GFP_KERNEL);
if... |
functions | int cyttsp_resume(struct i2c_client *client)
{
struct cyttsp *ts;
int ret=0;
int retval = CYTTSP_OPERATIONAL;
dbg("Wake Up\n");
ts = (struct cyttsp *) i2c_get_clientdata(client);
if(ts == NULL)
return retval;
pantech_ctl_update(ISSP_IOCTL_POWER_ALL , 1);
pantech_ctl_update(ISSP_IOCTL_INTR, 1);
pantech_ct... |
functions | int cyttsp_suspend(struct i2c_client *client, pm_message_t message)
{
struct cyttsp *ts;
int retval = CYTTSP_OPERATIONAL, id =0;
dbg("Enter Sleep\n");
ts = (struct cyttsp *) i2c_get_clientdata(client);
if(ts == NULL)
return retval;
/* disable worker */
disable_irq_nosync(ts->client->irq);
#ifdef FEATURE... |
functions | __devexit cyttsp_remove(struct i2c_client *client)
{
struct cyttsp *ts;
int err;
cyttsp_alert("Unregister\n");
/* clientdata registered on probe */
ts = i2c_get_clientdata(client);
device_remove_file(&ts->client->dev, &dev_attr_irq_enable);
/* Start cleaning up by removing any delayed work and the timer */
i... |
functions | void cyttsp_early_suspend(struct early_suspend *handler)
{
struct cyttsp *ts;
ts = container_of(handler, struct cyttsp, early_suspend);
cyttsp_suspend(ts->client, PMSG_SUSPEND);
} |
functions | void cyttsp_late_resume(struct early_suspend *handler)
{
struct cyttsp *ts;
ts = container_of(handler, struct cyttsp, early_suspend);
cyttsp_resume(ts->client);
} |
functions | int cyttsp_init(void)
{
int ret;
cyttsp_info("Cypress TrueTouch(R) Standard Product I2C Touchscreen Driver (Built %s @ %s)\n",__DATE__,__TIME__);
ret = i2c_add_driver(&cyttsp_driver);
return ret;
} |
functions | void cyttsp_exit(void)
{
return i2c_del_driver(&cyttsp_driver);
} |
includes |
#include <acpi/acpi.h> |
defines |
#define _COMPONENT ACPI_RESOURCES |
functions | u8 acpi_rs_decode_bitmask(u16 mask, u8 * list)
{
u8 i;
u8 bit_count;
ACPI_FUNCTION_ENTRY();
/* Decode the mask bits */
for (i = 0, bit_count = 0; mask; i++) {
if (mask & 0x0001) {
list[bit_count] = i;
bit_count++;
} |
functions | u16 acpi_rs_encode_bitmask(u8 * list, u8 count)
{
u32 i;
u16 mask;
ACPI_FUNCTION_ENTRY();
/* Encode the list into a single bitmask */
for (i = 0, mask = 0; i < count; i++) {
mask |= (0x1 << list[i]);
} |
functions | void
acpi_rs_move_data(void *destination, void *source, u16 item_count, u8 move_type)
{
u32 i;
ACPI_FUNCTION_ENTRY();
/* One move per item */
for (i = 0; i < item_count; i++) {
switch (move_type) {
/*
* For the 8-bit case, we can perform the move all at once
* since there are no alignment or endian ... |
functions | void
acpi_rs_set_resource_length(acpi_rsdesc_size total_length,
union aml_resource *aml)
{
acpi_rs_length resource_length;
ACPI_FUNCTION_ENTRY();
/* Length is the total descriptor length minus the header length */
resource_length = (acpi_rs_length)
(total_length - acpi_ut_get_resource_header_length(a... |
functions | void
acpi_rs_set_resource_header(u8 descriptor_type,
acpi_rsdesc_size total_length,
union aml_resource *aml)
{
ACPI_FUNCTION_ENTRY();
/* Set the Resource Type */
aml->small_header.descriptor_type = descriptor_type;
/* Set the Resource Length */
acpi_rs_set_resource_length(total_length, aml);
} |
functions | u16 acpi_rs_strcpy(char *destination, char *source)
{
u16 i;
ACPI_FUNCTION_ENTRY();
for (i = 0; source[i]; i++) {
destination[i] = source[i];
} |
functions | acpi_rs_length
acpi_rs_get_resource_source(acpi_rs_length resource_length,
acpi_rs_length minimum_length,
struct acpi_resource_source * resource_source,
union aml_resource * aml, char *string_ptr)
{
acpi_rsdesc_size total_length;
u8 *aml_resource_source;
ACPI_FUNCTION_ENTRY();
total_length =
... |
functions | acpi_rsdesc_size
acpi_rs_set_resource_source(union aml_resource * aml,
acpi_rs_length minimum_length,
struct acpi_resource_source * resource_source)
{
u8 *aml_resource_source;
acpi_rsdesc_size descriptor_length;
ACPI_FUNCTION_ENTRY();
descriptor_length = minimum_length;
/* Non-zero string length i... |
functions | acpi_status
acpi_rs_get_prt_method_data(struct acpi_namespace_node * node,
struct acpi_buffer * ret_buffer)
{
union acpi_operand_object *obj_desc;
acpi_status status;
ACPI_FUNCTION_TRACE(rs_get_prt_method_data);
/* Parameters guaranteed valid by caller */
/* Execute the method, no parameters */
status ... |
functions | acpi_status
acpi_rs_get_crs_method_data(struct acpi_namespace_node *node,
struct acpi_buffer *ret_buffer)
{
union acpi_operand_object *obj_desc;
acpi_status status;
ACPI_FUNCTION_TRACE(rs_get_crs_method_data);
/* Parameters guaranteed valid by caller */
/* Execute the method, no parameters */
status = ... |
functions | acpi_status
acpi_rs_get_prs_method_data(struct acpi_namespace_node *node,
struct acpi_buffer *ret_buffer)
{
union acpi_operand_object *obj_desc;
acpi_status status;
ACPI_FUNCTION_TRACE(rs_get_prs_method_data);
/* Parameters guaranteed valid by caller */
/* Execute the method, no parameters */
status = ... |
functions | acpi_status
acpi_rs_get_method_data(acpi_handle handle,
char *path, struct acpi_buffer *ret_buffer)
{
union acpi_operand_object *obj_desc;
acpi_status status;
ACPI_FUNCTION_TRACE(rs_get_method_data);
/* Parameters guaranteed valid by caller */
/* Execute the method, no parameters */
status =
acpi_ut_e... |
functions | acpi_status
acpi_rs_set_srs_method_data(struct acpi_namespace_node *node,
struct acpi_buffer *in_buffer)
{
struct acpi_evaluate_info *info;
union acpi_operand_object *args[2];
acpi_status status;
struct acpi_buffer buffer;
ACPI_FUNCTION_TRACE(rs_set_srs_method_data);
/* Allocate and initialize the evalua... |
includes |
#include <linux/interrupt.h> |
includes | #include <linux/i2c.h> |
includes | #include <linux/slab.h> |
includes | #include <linux/irq.h> |
includes | #include <linux/miscdevice.h> |
includes | #include <asm/uaccess.h> |
includes | #include <linux/delay.h> |
includes | #include <linux/input.h> |
includes | #include <linux/workqueue.h> |
includes | #include <linux/kobject.h> |
includes | #include <linux/earlysuspend.h> |
includes | #include <linux/platform_device.h> |
includes | #include <asm/atomic.h> |
includes |
#include <cust_acc.h> |
includes | #include <linux/hwmsensor.h> |
includes | #include <linux/hwmsen_dev.h> |
includes | #include <linux/sensors_io.h> |
includes | #include <linux/hwmsen_helper.h> |
includes |
#include <mach/mt_devs.h> |
includes | #include <mach/mt_typedefs.h> |
includes | #include <mach/mt_gpio.h> |
includes | #include <mach/mt_pm_ldo.h> |
defines |
#define POWER_NONE_MACRO MT65XX_POWER_NONE |
defines | #define DEBUG 1 |
defines | #define CONFIG_LIS3DH_LOWPASS /*apply low pass filter on output*/ |
defines | #define LIS3DH_AXIS_X 0 |
defines | #define LIS3DH_AXIS_Y 1 |
defines | #define LIS3DH_AXIS_Z 2 |
defines | #define LIS3DH_AXES_NUM 3 |
defines | #define LIS3DH_DATA_LEN 6 |
defines | #define LIS3DH_DEV_NAME "LIS3DH" |
defines | #define C_MAX_FIR_LENGTH (32) |
defines | #define GSE_TAG "[Gsensor] " |
defines | #define GSE_FUN(f) printk(KERN_INFO GSE_TAG"%s\n", __FUNCTION__) |
defines | #define GSE_ERR(fmt, args...) printk(KERN_ERR GSE_TAG"%s %d : "fmt, __FUNCTION__, __LINE__, ##args) |
defines | #define GSE_LOG(fmt, args...) printk(KERN_INFO GSE_TAG fmt, ##args) |
structs | struct scale_factor{
u8 whole;
u8 fraction;
}; |
structs | struct data_resolution {
struct scale_factor scalefactor;
int sensitivity;
}; |
structs | struct data_filter {
s16 raw[C_MAX_FIR_LENGTH][LIS3DH_AXES_NUM];
int sum[LIS3DH_AXES_NUM];
int num;
int idx;
}; |
structs | struct lis3dh_i2c_data {
struct i2c_client *client;
struct acc_hw *hw;
struct hwmsen_convert cvt;
/*misc*/
struct data_resolution *reso;
atomic_t trace;
atomic_t suspend;
atomic_t selftest;
atomic_t filter;
s16 ... |
functions | int hwmsen_read_byte_sr(struct i2c_client *client, u8 addr, u8 *data)
{
u8 buf;
int ret = 0;
client->addr = client->addr& I2C_MASK_FLAG | I2C_WR_FLAG |I2C_RS_FLAG;
buf = addr;
ret = i2c_master_send(client, (const char*)&buf, 1<<8 | 1);
//ret = i2c_master_send(client, (const char*)&buf, 1);
if ... |
functions | void dumpReg(struct i2c_client *client)
{
int i=0;
u8 addr = 0x20;
u8 regdata=0;
for(i=0; i<3 ; i++)
{
//dump all
hwmsen_read_byte(client,addr,®data);
GSE_LOG("Reg addr=%x regdata=%x\n",addr,regdata);
addr++;
} |
functions | void LIS3DH_power(struct acc_hw *hw, unsigned int on)
{
static unsigned int power_on = 0;
if(hw->power_id != POWER_NONE_MACRO) // have externel LDO
{
GSE_LOG("power %s\n", on ? "on" : "off");
if(power_on == on) // power status not change
{
GSE_LOG("ignore power control: %d\n", on);
} |
functions | int LIS3DH_SetDataResolution(struct lis3dh_i2c_data *obj)
{
int err = 0;
u8 dat, reso;
err = hwmsen_read_byte(obj->client, LIS3DH_REG_CTL_REG4, &dat);
if(err)
{
GSE_ERR("write data format fail!!\n");
return err;
} |
functions | int LIS3DH_ReadData(struct i2c_client *client, s16 data[LIS3DH_AXES_NUM])
{
struct lis3dh_i2c_data *priv = i2c_get_clientdata(client);
// u8 addr = LIS3DH_REG_DATAX0;
u8 buf[LIS3DH_DATA_LEN] = {0} |
functions | int LIS3DH_ReadOffset(struct i2c_client *client, s8 ofs[LIS3DH_AXES_NUM])
{
int err;
return err;
} |
functions | int LIS3DH_ResetCalibration(struct i2c_client *client)
{
struct lis3dh_i2c_data *obj = i2c_get_clientdata(client);
memset(obj->cali_sw, 0x00, sizeof(obj->cali_sw));
return 0;
} |
functions | int LIS3DH_ReadCalibration(struct i2c_client *client, int dat[LIS3DH_AXES_NUM])
{
struct lis3dh_i2c_data *obj = i2c_get_clientdata(client);
dat[obj->cvt.map[LIS3DH_AXIS_X]] = obj->cvt.sign[LIS3DH_AXIS_X]*obj->cali_sw[LIS3DH_AXIS_X];
dat[obj->cvt.map[LIS3DH_AXIS_Y]] = obj->cvt.sign[LIS3DH_AXIS_Y]*obj->cali_... |
functions | int LIS3DH_ReadCalibrationEx(struct i2c_client *client, int act[LIS3DH_AXES_NUM], int raw[LIS3DH_AXES_NUM])
{
struct lis3dh_i2c_data *obj = i2c_get_clientdata(client);
int err;
int mul;
if(err = LIS3DH_ReadOffset(client, obj->offset))
{
GSE_ERR("read offset fail, %d\n", err);
return err;
} |
functions | int LIS3DH_WriteCalibration(struct i2c_client *client, int dat[LIS3DH_AXES_NUM])
{
struct lis3dh_i2c_data *obj = i2c_get_clientdata(client);
int err = 0;
// int cali[LIS3DH_AXES_NUM];
GSE_FUN();
if(!obj || ! dat)
{
GSE_ERR("null ptr!!\n");
return -EINVAL;
} |
functions | int LIS3DH_CheckDeviceID(struct i2c_client *client)
{
u8 databuf[10];
int res = 0;
/*
memset(databuf, 0, sizeof(u8)*10);
databuf[0] = LIS3DH_REG_DEVID;
res = i2c_master_send(client, databuf, 0x1);
if(res <= 0)
{
goto exit_LIS3DH_CheckDeviceID;
} |
functions | int LIS3DH_SetPowerMode(struct i2c_client *client, bool enable)
{
u8 databuf[2];
int res = 0;
u8 addr = LIS3DH_REG_CTL_REG1;
struct lis3dh_i2c_data *obj = i2c_get_clientdata(client);
if(enable == sensor_power)
{
GSE_LOG("Sensor power status is newest!\n");
return LIS3DH_SUCCESS;
} |
functions | int LIS3DH_SetDataFormat(struct i2c_client *client, u8 dataformat)
{
struct lis3dh_i2c_data *obj = i2c_get_clientdata(client);
u8 databuf[10];
u8 addr = LIS3DH_REG_CTL_REG4;
int res = 0;
memset(databuf, 0, sizeof(u8)*10);
if(hwmsen_read_byte(client, addr, &databuf[0]))
{
GSE_ERR("read reg_ctl_reg1 register e... |
functions | int LIS3DH_SetBWRate(struct i2c_client *client, u8 bwrate)
{
u8 databuf[10];
u8 addr = LIS3DH_REG_CTL_REG1;
int res = 0;
memset(databuf, 0, sizeof(u8)*10);
if(hwmsen_read_byte(client, addr, &databuf[0]))
{
GSE_ERR("read reg_ctl_reg1 register err!\n");
return LIS3DH_ERR_I2C;
} |
functions | int LIS3DH_SetIntEnable(struct i2c_client *client, u8 intenable)
{
u8 databuf[10];
u8 addr = LIS3DH_REG_CTL_REG3;
int res = 0;
memset(databuf, 0, sizeof(u8)*10);
if(hwmsen_read_byte(client, addr, &databuf[0]))
{
GSE_ERR("read reg_ctl_reg1 register err!\n");
return LIS3DH_ERR_I2C;
} |
functions | int LIS3DH_Init(struct i2c_client *client, int reset_cali)
{
struct lis3dh_i2c_data *obj = i2c_get_clientdata(client);
int res = 0;
/*
res = LIS3DH_CheckDeviceID(client);
if(res != LIS3DH_SUCCESS)
{
return res;
} |
functions | choice
if(res != LIS3DH_SUCCESS )
{
return res;
} |
functions | choise
if(res != LIS3DH_SUCCESS)
{
return res;
} |
functions | int LIS3DH_ReadChipInfo(struct i2c_client *client, char *buf, int bufsize)
{
u8 databuf[10];
memset(databuf, 0, sizeof(u8)*10);
if((NULL == buf)||(bufsize<=30))
{
return -1;
} |
functions | int LIS3DH_ReadSensorData(struct i2c_client *client, char *buf, int bufsize)
{
struct lis3dh_i2c_data *obj = (struct lis3dh_i2c_data*)i2c_get_clientdata(client);
u8 databuf[20];
int acc[LIS3DH_AXES_NUM];
int res = 0;
memset(databuf, 0, sizeof(u8)*10);
if(NULL == buf)
{
return -1;
} |
functions | int LIS3DH_ReadRawData(struct i2c_client *client, char *buf)
{
struct lis3dh_i2c_data *obj = (struct lis3dh_i2c_data*)i2c_get_clientdata(client);
int res = 0;
if (!buf || !client)
{
return EINVAL;
} |
functions | ssize_t show_chipinfo_value(struct device_driver *ddri, char *buf)
{
struct i2c_client *client = lis3dh_i2c_client;
char strbuf[LIS3DH_BUFSIZE];
if(NULL == client)
{
GSE_ERR("i2c client is null!!\n");
return 0;
} |
functions | ssize_t show_sensordata_value(struct device_driver *ddri, char *buf)
{
struct i2c_client *client = lis3dh_i2c_client;
char strbuf[LIS3DH_BUFSIZE];
if(NULL == client)
{
GSE_ERR("i2c client is null!!\n");
return 0;
} |
functions | ssize_t show_cali_value(struct device_driver *ddri, char *buf)
{
struct i2c_client *client = lis3dh_i2c_client;
struct lis3dh_i2c_data *obj;
int err, len = 0, mul;
int tmp[LIS3DH_AXES_NUM];
if(NULL == client)
{
GSE_ERR("i2c client is null!!\n");
return 0;
} |
functions | ssize_t store_cali_value(struct device_driver *ddri, const char *buf, size_t count)
{
struct i2c_client *client = lis3dh_i2c_client;
int err, x, y, z;
int dat[LIS3DH_AXES_NUM];
if(!strncmp(buf, "rst", 3))
{
if((err = LIS3DH_ResetCalibration(client)))
{
GSE_ERR("reset offset err = %d\n", err);
} |
functions | ssize_t show_power_status(struct device_driver *ddri, char *buf)
{
struct i2c_client *client = lis3dh_i2c_client;
struct lis3dh_i2c_data *obj;
u8 data;
if(NULL == client)
{
GSE_ERR("i2c client is null!!\n");
return 0;
} |
functions | ssize_t show_firlen_value(struct device_driver *ddri, char *buf)
{
#ifdef CONFIG_LIS3DH_LOWPASS
struct i2c_client *client = lis3dh_i2c_client;
struct lis3dh_i2c_data *obj = i2c_get_clientdata(client);
if(atomic_read(&obj->firlen))
{
int idx, len = atomic_read(&obj->firlen);
GSE_LOG("len = %2d, idx = %2d\n", obj... |
functions | ssize_t store_firlen_value(struct device_driver *ddri, const char *buf, size_t count)
{
#ifdef CONFIG_LIS3DH_LOWPASS
struct i2c_client *client = lis3dh_i2c_client;
struct lis3dh_i2c_data *obj = i2c_get_clientdata(client);
int firlen;
if(1 != sscanf(buf, "%d", &firlen))
{
GSE_ERR("invallid format\n");
} |
functions | else if(firlen > C_MAX_FIR_LENGTH)
{
GSE_ERR("exceeds maximum filter length\n");
} |
functions | ssize_t show_trace_value(struct device_driver *ddri, char *buf)
{
ssize_t res;
struct lis3dh_i2c_data *obj = obj_i2c_data;
if (obj == NULL)
{
GSE_ERR("i2c_data obj is null!!\n");
return 0;
} |
functions | ssize_t store_trace_value(struct device_driver *ddri, const char *buf, size_t count)
{
struct lis3dh_i2c_data *obj = obj_i2c_data;
int trace;
if (obj == NULL)
{
GSE_ERR("i2c_data obj is null!!\n");
return 0;
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.