static void aat2862_early_suspend(struct early_suspend *h) { struct aat2862_device *dev; dev = container_of(h, struct aat2862_device, early_suspend); aat2862_bl_suspend(dev->client, PMSG_SUSPEND); }
ssize_t lcd_backlight_store_on_off(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { int on_off; int ret; struct i2c_client *client = to_i2c_client(dev); if (!count) return -EINVAL; //printk("%s received (prev backlight_status: %s)\n", __func__, backlight_status?"ON":"OFF"); on_off = simple_strtoul(buf, NULL, 10); sscanf(buf, "%d", &ret); printk(KERN_ERR "%d",on_off); if(ret){ early_bl_value=DEFAULT_BRIGHTNESS; aat2862_bl_resume(client); }else aat2862_bl_suspend(client, PMSG_SUSPEND); return count; }