本文整理汇总了C++中i2c_touchkey_write函数的典型用法代码示例。如果您正苦于以下问题:C++ i2c_touchkey_write函数的具体用法?C++ i2c_touchkey_write怎么用?C++ i2c_touchkey_write使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了i2c_touchkey_write函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: melfas_touchkey_late_resume
static int melfas_touchkey_late_resume(struct early_suspend *h)
{
#ifdef TEST_JIG_MODE
unsigned char get_touch = 0x40;
#endif
set_touchkey_debug('R');
printk(KERN_DEBUG "[TouchKey] melfas_touchkey_late_resume\n");
/* enable ldo11 */
touchkey_ldo_on(1);
if (touchkey_enable < 0) {
printk(KERN_DEBUG "[TouchKey] ---%s---touchkey_enable: %d\n",
__func__, touchkey_enable);
return 0;
}
gpio_direction_output(_3_GPIO_TOUCH_EN, 1);
gpio_direction_output(_3_TOUCH_SDA_28V, 1);
gpio_direction_output(_3_TOUCH_SCL_28V, 1);
gpio_direction_output(_3_GPIO_TOUCH_INT, 1);
set_irq_type(IRQ_TOUCH_INT, IRQF_TRIGGER_FALLING);
s3c_gpio_cfgpin(_3_GPIO_TOUCH_INT, _3_GPIO_TOUCH_INT_AF);
s3c_gpio_setpull(_3_GPIO_TOUCH_INT, S3C_GPIO_PULL_NONE);
msleep(50);
touchkey_led_ldo_on(1);
#ifdef WHY_DO_WE_NEED_THIS
/* clear interrupt */
if (readl(gpio_pend_mask_mem) & (0x1 << 1)) {
writel(readl(gpio_pend_mask_mem) | (0x1 << 1),
gpio_pend_mask_mem);
}
#endif
enable_irq(IRQ_TOUCH_INT);
touchkey_enable = 1;
if (touchled_cmd_reversed) {
touchled_cmd_reversed = 0;
i2c_touchkey_write(&touchkey_led_status, 1);
printk("LED returned on\n");
}
#ifdef TEST_JIG_MODE
i2c_touchkey_write(&get_touch, 1);
#endif
return 0;
}
示例2: sec_touchkey_late_resume
static int sec_touchkey_late_resume(struct early_suspend *h)
{
struct touchkey_i2c *tkey_i2c =
container_of(h, struct touchkey_i2c, early_suspend);
#ifdef TEST_JIG_MODE
unsigned char get_touch = 0x40;
#endif
set_touchkey_debug('R');
printk(KERN_DEBUG "[TouchKey] sec_touchkey_late_resume\n");
#if defined(CONFIG_S2VE_TOUCHKEY_REV05)
printk(KERN_ERR"sec_touchkey_late_resume++\n");
Touchkey_PowerOnOff(1);
gpio_set_value(TOUCHKEY_SDA, 0);
gpio_set_value(TOUCHKEY_SCL, 0);
touchkey_led_on(tkey_i2c, 1);
touchkey_suspended = 0;
#else
if (touchkey_enable < 0) {
printk(KERN_DEBUG "[TouchKey] ---%s---touchkey_enable: %d\n",
__func__, touchkey_enable);
return 0;
}
msleep(50);
touchkey_enable = 1;
#if defined(TK_HAS_AUTOCAL)
touchkey_autocalibration(tkey_i2c);
#endif
if (touchled_cmd_reversed) {
touchled_cmd_reversed = 0;
i2c_touchkey_write(tkey_i2c->client,
(u8 *) &touchkey_led_status, 1);
printk(KERN_DEBUG "[Touchkey] LED returned on\n");
}
#ifdef TEST_JIG_MODE
i2c_touchkey_write(tkey_i2c->client, &get_touch, 1);
#endif
enable_irq(tkey_i2c->irq);
#endif
return 0;
}
示例3: touch_led_control
static ssize_t touch_led_control(struct device *dev, struct device_attribute *attr, const char *buf, size_t size)
{
u8 data;
u8 led_bright[2]= {LED_BRIGHT_BIT,LED_BRIGHT};
//data = 1 on, 0 off
sscanf(buf, "%hhu", &data);
led_onoff = (data == 0) ? 0 : 1;
data = (data == 0) ? 2 : 1;
if (!touchkey_enable)
return -1;
i2c_touchkey_write(led_bright, 2);
i2c_touchkey_write(&data, 1); // LED on(data=1) or off(data=2)
return size;
}
示例4: touchkey_resume_func
void touchkey_resume_func(struct work_struct *p)
{
// int err = 0;
// int rc = 0;
enable_irq(IRQ_TOUCHKEY_INT);
touchkey_enable = 1;
msleep(50);
#if defined (CONFIG_USA_MODEL_SGH_T989)||defined (CONFIG_USA_MODEL_SGH_I727) || defined (CONFIG_USA_MODEL_SGH_I717)\
|| defined (CONFIG_USA_MODEL_SGH_T769) || defined(CONFIG_USA_MODEL_SGH_I577) || defined(CONFIG_CAN_MODEL_SGH_I577R)\
|| defined(CONFIG_USA_MODEL_SGH_I757) || defined(CONFIG_CAN_MODEL_SGH_I757M)
touchkey_auto_calibration(1/*on*/);
#elif defined (CONFIG_KOR_MODEL_SHV_E110S)
if (get_hw_rev() >= 0x02)
touchkey_auto_calibration(1/*on*/);
#elif defined (CONFIG_JPN_MODEL_SC_03D)
if (get_hw_rev() >= 0x02)
touchkey_auto_calibration(1/*on*/);
#endif
#if 0
{
// temporary code for touchkey led
int int_data = 0x10;
msleep(100);
printk("[TKEY] i2c_touchkey_write : key backligh on\n");
i2c_touchkey_write((u8*)&int_data, 1);
}
#endif
}
示例5: notification_off
static void notification_off(struct work_struct *notification_off_work)
{
int status;
/* do nothing if there is no active notification */
if (led_on != 1 || touchkey_enable != 1)
return;
/* we have timed out, turn the lights off */
/* disable the regulators */
touchkey_led_ldo_on(0); /* "touch_led" regulator */
touchkey_ldo_on(0); /* "touch" regulator */
/* turn off the backlight */
#ifdef CONFIG_TARGET_CM_KERNEL
status = 2; /* light off */
#else
status = 0; /* light off */
#endif
i2c_touchkey_write((u8 *)&status, 1);
touchkey_enable = 0;
#ifdef CONFIG_TARGET_CM_KERNEL
led_on = 0;
#else
led_on = -1;
#endif
/* we were using a wakelock, unlock it */
if (wake_lock_active(&led_wake_lock)) {
wake_unlock(&led_wake_lock);
}
return;
}
示例6: set_touchkey_autocal_testmode
static ssize_t set_touchkey_autocal_testmode(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t size)
{
struct touchkey_i2c *tkey_i2c = dev_get_drvdata(dev);
int count = 0;
u8 set_data;
int on_off;
if (sscanf(buf, "%d\n", &on_off) == 1) {
printk(KERN_ERR "[TouchKey] Test Mode : %d\n", on_off);
if (on_off == 1) {
set_data = 0x40;
count = i2c_touchkey_write(tkey_i2c->client,
&set_data, 1);
} else {
// tkey_i2c->pdata->power_on(0);
touchkey_led_on(tkey_i2c, 0);
msleep(50);
// tkey_i2c->pdata->power_on(1);
touchkey_led_on(tkey_i2c, 1);
msleep(50);
#if defined(TK_HAS_AUTOCAL)
touchkey_autocalibration(tkey_i2c);
#endif
}
} else {
printk(KERN_ERR "[TouchKey] touch_led_brightness Error\n");
}
return count;
}
示例7: melfas_touchkey_early_resume
static void melfas_touchkey_early_resume(struct early_suspend *h)
{
set_touchkey_debug('R');
printk(KERN_DEBUG "[TKEY] melfas_touchkey_early_resume\n");
if (touchkey_enable < 0) {
printk("[TKEY] %s touchkey_enable: %d\n", __FUNCTION__, touchkey_enable);
return;
}
tkey_vdd_enable(1);
gpio_request(GPIO_TOUCHKEY_SCL, "TKEY_SCL");
gpio_direction_input(GPIO_TOUCHKEY_SCL);
gpio_request(GPIO_TOUCHKEY_SDA, "TKEY_SDA");
gpio_direction_input(GPIO_TOUCHKEY_SDA);
init_hw();
if(touchled_cmd_reversed) {
touchled_cmd_reversed = 0;
msleep(100);
if(!touchkey_enable )
touchkey_enable = 1;
i2c_touchkey_write(&touchkey_led_status, 1);
printk("[TKEY] LED RESERVED !! LED returned on touchkey_led_status = %d\n", touchkey_led_status);
}
if (get_hw_rev() >=0x02){
tkey_led_vdd_enable(1);
}
enable_irq(IRQ_TOUCHKEY_INT);
touchkey_enable = 1;
msleep(50);
touchkey_auto_calibration(1/*on*/);
}
示例8: touchscreen_state_report
void touchscreen_state_report(int state)
{
static const int ledCmd[] = {TK_CMD_LED_ON, TK_CMD_LED_OFF};
if (touch_led_disabled == 0) {
if (state == 1) {
if(touchkey_led_status == TK_CMD_LED_OFF) {
pr_debug("[Touchkey] %s: enable touchleds\n", __func__);
i2c_touchkey_write(tkey_i2c_local->client, (u8 *) &ledCmd[0], 1);
touchkey_led_status = TK_CMD_LED_ON;
} else {
if (timer_pending(&touch_led_timer) == 1) {
pr_debug("[Touchkey] %s: mod_timer\n", __func__);
mod_timer(&touch_led_timer, jiffies + (HZ * touch_led_timeout));
}
}
} else if (state == 0) {
if (timer_pending(&touch_led_timer) == 1) {
pr_debug("[Touchkey] %s: mod_timer\n", __func__);
mod_timer(&touch_led_timer, jiffies + (HZ * touch_led_timeout));
} else if (touchkey_led_status == TK_CMD_LED_ON){
pr_debug("[Touchkey] %s: add_timer\n", __func__);
touch_led_timer.expires = jiffies + (HZ * touch_led_timeout);
add_timer(&touch_led_timer);
}
}
}
}
开发者ID:android-armv7a-belalang-tempur,项目名称:android_kernel_samsung_smdk4210-1,代码行数:28,代码来源:cypress-touchkey.c
示例9: touchkey_init
static int __init touchkey_init(void)
{
int ret = 0;
int rc;
#ifdef TEST_JIG_MODE
unsigned char get_touch = 0x40;
#endif
printk(KERN_INFO "[TouchKey] %s\n", __func__ );
rc = gpio_request(TOUCHKEY_INT, "touchkey_int");
if (rc < 0) {
printk(KERN_ERR "unable to request GPIO pin %d\n", TOUCHKEY_INT);
}
gpio_direction_input(TOUCHKEY_INT);
gpio_direction_output( TOUCHKEY_SCL , 1 );
gpio_direction_output( TOUCHKEY_SDA , 1 );
ret = i2c_add_driver(&touchkey_i2c_driver);
if (ret)
{
printk(KERN_ERR "[TouchKey] registration failed, module not inserted.ret= %d\n", ret);
}
#ifdef TEST_JIG_MODE
i2c_touchkey_write(tkey_i2c->client, &get_touch, 1);
#endif
return ret;
}
示例10: touchkey_init
static int __init touchkey_init(void)
{
int ret = 0;
#if defined(CONFIG_MACH_M0)
if (system_rev < TOUCHKEY_FW_UPDATEABLE_HW_REV) {
printk(KERN_DEBUG "[Touchkey] Doesn't support this board rev %d\n",
system_rev);
return 0;
}
#elif defined(CONFIG_MACH_C1)
if (system_rev < TOUCHKEY_FW_UPDATEABLE_HW_REV) {
printk(KERN_DEBUG "[Touchkey] Doesn't support this board rev %d\n",
system_rev);
return 0;
}
#endif
#ifdef TEST_JIG_MODE
unsigned char get_touch = 0x40;
#endif
ret = i2c_add_driver(&touchkey_i2c_driver);
if (ret) {
printk(KERN_ERR
"[TouchKey] registration failed, module not inserted.ret= %d\n",
ret);
}
#ifdef TEST_JIG_MODE
i2c_touchkey_write(tkey_i2c->client, &get_touch, 1);
#endif
return ret;
}
示例11: touch_sensitivity_control
static ssize_t touch_sensitivity_control(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t size)
{
struct touchkey_i2c *tkey_i2c = dev_get_drvdata(dev);
unsigned char data = 0x40;
i2c_touchkey_write(tkey_i2c->client, &data, 1);
return size;
}
开发者ID:android-armv7a-belalang-tempur,项目名称:android_kernel_samsung_smdk4210-1,代码行数:9,代码来源:cypress-touchkey.c
示例12: touch_led_control
static ssize_t touch_led_control(struct device *dev,
struct device_attribute *attr, const char *buf,
size_t size)
{
struct cypress_touchkey_devdata *devdata = dev_get_drvdata(dev);
int ret;
if (devdata && !devdata->is_powering_on) {
if (strncmp(buf, "1", 1) == 0)
ret = i2c_touchkey_write(devdata, &devdata->backlight_on, 1);
else
ret = i2c_touchkey_write(devdata, &devdata->backlight_off, 1);
if (ret)
dev_err(dev, "%s: touchkey led i2c failed\n", __func__);
}
return size;
}
示例13: touch_led_control
static ssize_t touch_led_control(struct device *dev, struct device_attribute *attr, const char *buf, size_t size)
{
u8 data;
if(user_press_on)
return size;
sscanf(buf, "%hhu", &data);
i2c_touchkey_write(&data, 1); // LED on(data=1) or off(data=2)
return size;
}
示例14: sec_touchkey_late_resume
static int sec_touchkey_late_resume(struct early_suspend *h)
{
struct touchkey_i2c *tkey_i2c =
container_of(h, struct touchkey_i2c, early_suspend);
#ifdef TEST_JIG_MODE
unsigned char get_touch = 0x40;
#endif
set_touchkey_debug('R');
pr_debug("[TouchKey] sec_touchkey_late_resume\n");
/* enable ldo11 */
tkey_i2c->pdata->power_on(1);
if (touchkey_enable < 0) {
pr_debug("[TouchKey] ---%s---touchkey_enable: %d\n",
__func__, touchkey_enable);
return 0;
}
msleep(50);
tkey_i2c->pdata->led_power_on(1);
touchkey_enable = 1;
#if defined(TK_HAS_AUTOCAL)
touchkey_autocalibration(tkey_i2c);
#endif
if (touchled_cmd_reversed) {
touchled_cmd_reversed = 0;
i2c_touchkey_write(tkey_i2c->client,
(u8 *) &touchkey_led_status, 1);
pr_debug("[Touchkey] LED returned on\n");
}
#ifdef TEST_JIG_MODE
i2c_touchkey_write(tkey_i2c->client, &get_touch, 1);
#endif
enable_irq(tkey_i2c->irq);
return 0;
}
开发者ID:android-armv7a-belalang-tempur,项目名称:android_kernel_samsung_smdk4210-1,代码行数:42,代码来源:cypress-touchkey.c
示例15: touch_sensitivity_control
static ssize_t touch_sensitivity_control(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t size)
{
struct touchkey_i2c *tkey_i2c = dev_get_drvdata(dev);
unsigned char data = 0x40;
i2c_touchkey_write(tkey_i2c->client, &data, 1);
#if defined(CONFIG_MACH_SUPERIOR_KOR_SKT)
msleep(20);
#endif
return size;
}