Merge branch 'master' of git://gitorious.org/linux-on-wince-htc/linux_on_wince_htc
This commit is contained in:
		| @@ -1650,20 +1650,16 @@ CONFIG_MISC_FILESYSTEMS=y | ||||
| # CONFIG_BEFS_FS is not set | ||||
| # CONFIG_BFS_FS is not set | ||||
| # CONFIG_EFS_FS is not set | ||||
| CONFIG_YAFFS_FS=m | ||||
| CONFIG_YAFFS_FS=y | ||||
| CONFIG_YAFFS_YAFFS1=y | ||||
| # CONFIG_YAFFS_9BYTE_TAGS is not set | ||||
| # CONFIG_YAFFS_DOES_ECC is not set | ||||
| CONFIG_YAFFS_YAFFS2=y | ||||
| CONFIG_YAFFS_AUTO_YAFFS2=y | ||||
| CONFIG_YAFFS_DISABLE_TAGS_ECC=y | ||||
| # CONFIG_YAFFS_DISABLE_LAZY_LOAD is not set | ||||
| # CONFIG_YAFFS_DISABLE_WIDE_TNODES is not set | ||||
| # CONFIG_YAFFS_ALWAYS_CHECK_CHUNK_ERASED is not set | ||||
| CONFIG_YAFFS_SHORT_NAMES_IN_RAM=y | ||||
| # CONFIG_YAFFS_EMPTY_LOST_AND_FOUND is not set | ||||
| CONFIG_YAFFS_DISABLE_BLOCK_REFRESHING=y | ||||
| # CONFIG_YAFFS_DISABLE_BACKGROUND is not set | ||||
| CONFIG_YAFFS_XATTR=y | ||||
| # CONFIG_JFFS2_FS is not set | ||||
| # CONFIG_CRAMFS is not set | ||||
| CONFIG_SQUASHFS=y | ||||
|   | ||||
| @@ -38,6 +38,49 @@ | ||||
| #endif | ||||
|  | ||||
| static struct led_trigger *htcleo_lcd_backlight; | ||||
| static int auto_bl_state=0; | ||||
|  | ||||
| int htcleo_brightness_autobacklight(uint8_t value) | ||||
| { | ||||
| 	int ret; | ||||
| 	uint8_t data[2]; | ||||
|  | ||||
| 	LCMDBG("%s:(%d)\n", __func__, value); | ||||
| 	if(value!=0 && value!=1) return -1; | ||||
|  | ||||
| 	data[0] = 1; | ||||
| 	data[1] = value; | ||||
| 	ret = microp_i2c_write(MICROP_I2C_WCMD_AUTO_BL_CTL, data, 2); | ||||
| 	if (ret != 0) { | ||||
| 		pr_err("%s: set auto light sensor fail\n", __func__); | ||||
| 		return ret; | ||||
| 	} | ||||
| 	auto_bl_state=value; | ||||
| 	return 0; | ||||
| } | ||||
| EXPORT_SYMBOL(htcleo_brightness_autobacklight); | ||||
|  | ||||
| static ssize_t htcleo_auto_bl_get(struct device *dev, | ||||
| 				  struct device_attribute *attr, char *buf) | ||||
| { | ||||
| 	int ret; | ||||
| 	ret = sprintf(buf, "%d", auto_bl_state); | ||||
| 	return ret; | ||||
| } | ||||
|  | ||||
| static ssize_t htcleo_auto_bl_set(struct device *dev, | ||||
| 				   struct device_attribute *attr, | ||||
| 				   const char *buf, size_t count) | ||||
| { | ||||
| 	int set_state; | ||||
| 	sscanf(buf, "%d", &set_state); | ||||
| 	if(set_state!=0 && set_state!=1) return -EINVAL; | ||||
| 	htcleo_brightness_autobacklight(set_state); | ||||
| 	return count; | ||||
| } | ||||
|  | ||||
|  | ||||
| static DEVICE_ATTR(auto_bl, 0644,  htcleo_auto_bl_get, htcleo_auto_bl_set); | ||||
|  | ||||
| int htcleo_brightness_onoff_bkl(int enable) | ||||
| { | ||||
| @@ -54,26 +97,17 @@ int htcleo_brightness_onoff_bkl(int enable) | ||||
| int htcleo_brightness_set_bkl(uint8_t value) | ||||
| { | ||||
| 	int ret; | ||||
| 	uint8_t cmd[2], data[2]; | ||||
| 	uint8_t cmd[2]; | ||||
|  | ||||
| 	LCMDBG("microp_set_bkl(%d)\n", value); | ||||
| 	LCMDBG("%s:(%d)\n", __func__, value); | ||||
|  | ||||
| 	if (value > 9) | ||||
| 	{ | ||||
| 		value = 9; | ||||
| 	} | ||||
| 	// disable autobrigtness | ||||
| // CotullaTEST: Lsensor test, add 0x100 | ||||
| //	data[0] = 0; | ||||
| 	data[0] = 1; | ||||
| 	data[1] = 0; | ||||
| 	ret = microp_i2c_write(MICROP_I2C_WCMD_AUTO_BL_CTL, data, 2); // 23 | ||||
| 	if (ret != 0) | ||||
| 		pr_err("%s: set auto light sensor fail\n", __func__); | ||||
|  | ||||
| 	// setvalue | ||||
| 	cmd[0] = value << 4; | ||||
| //	printk("22LEVEL %02X\n", cmd[0]); | ||||
| 	ret = microp_i2c_write(MICROP_I2C_WCMD_LCM_BL_MANU_CTL, cmd, 1); // 22 | ||||
| 	if (ret < 0) | ||||
| 	{ | ||||
| @@ -112,6 +146,7 @@ static struct led_classdev htcleo_backlight_led = | ||||
| static int  htcleo_backlight_probe(struct platform_device *pdev) | ||||
| { | ||||
| 	int rc; | ||||
| 	rc = device_create_file(&pdev->dev, &dev_attr_auto_bl); | ||||
| 	printk(KERN_INFO "%s: HTCLeo Backlight connect with microP: " | ||||
| 			"Probe\n", __func__); | ||||
| 	 | ||||
| @@ -119,12 +154,14 @@ static int  htcleo_backlight_probe(struct platform_device *pdev) | ||||
| 	rc = led_classdev_register(&pdev->dev, &htcleo_backlight_led); | ||||
| 	if (rc) | ||||
| 	      LCMDBG("HTCLeo Backlight: failure on register led_classdev\n"); | ||||
| 	return 0; | ||||
| 	htcleo_brightness_autobacklight(0); | ||||
| 	return rc; | ||||
|  | ||||
| } | ||||
|  | ||||
| static int htcleo_backlight_remove(struct platform_device *pdev) | ||||
| { | ||||
| 	device_remove_file(&pdev->dev, &dev_attr_auto_bl); | ||||
| 	return 0; | ||||
| } | ||||
|  | ||||
|   | ||||
| @@ -41,6 +41,24 @@ | ||||
|  | ||||
| #define HTCLEO_MAX_BRIGHTNESS 255 | ||||
|  | ||||
| int htcleo_brightness_autobacklight(uint8_t value) | ||||
| { | ||||
| 	int ret; | ||||
| 	uint8_t data[2]; | ||||
|  | ||||
| 	LCMDBG("%s:(%d)\n", __func__, value); | ||||
|  | ||||
| 	data[0] = 1; | ||||
| 	data[1] = value; | ||||
| 	ret = microp_i2c_write(MICROP_I2C_WCMD_AUTO_BL_CTL, data, 2); | ||||
| 	if (ret != 0) | ||||
| 		pr_err("%s: set auto light sensor fail\n", __func__); | ||||
|  | ||||
|  | ||||
| 	return ret; | ||||
| } | ||||
| EXPORT_SYMBOL(htcleo_brightness_autobacklight); | ||||
|  | ||||
| int htcleo_brightness_onoff_bkl(int enable) | ||||
| { | ||||
| 	int ret; | ||||
| @@ -56,7 +74,7 @@ int htcleo_brightness_onoff_bkl(int enable) | ||||
| int htcleo_brightness_set_bkl(uint8_t value) | ||||
| { | ||||
| 	int ret; | ||||
| 	uint8_t cmd[2], data[2]; | ||||
| 	uint8_t cmd[2]; | ||||
|  | ||||
| 	LCMDBG("microp_set_bkl(%d)\n", value); | ||||
|  | ||||
| @@ -64,18 +82,9 @@ int htcleo_brightness_set_bkl(uint8_t value) | ||||
| 	{ | ||||
| 		value = 9; | ||||
| 	} | ||||
| 	// disable autobrigtness | ||||
| // CotullaTEST: Lsensor test, add 0x100 | ||||
| //	data[0] = 0; | ||||
| 	data[0] = 1; | ||||
| 	data[1] = 0; | ||||
| 	ret = microp_i2c_write(MICROP_I2C_WCMD_AUTO_BL_CTL, data, 2); // 23 | ||||
| 	if (ret != 0) | ||||
| 		pr_err("%s: set auto light sensor fail\n", __func__); | ||||
|  | ||||
| 	// setvalue | ||||
| 	cmd[0] = value << 4; | ||||
| //	printk("22LEVEL %02X\n", cmd[0]); | ||||
| 	ret = microp_i2c_write(MICROP_I2C_WCMD_LCM_BL_MANU_CTL, cmd, 1); // 22 | ||||
| 	if (ret < 0) | ||||
| 	{ | ||||
| @@ -127,6 +136,8 @@ static struct backlight_ops htcleo_backlight_ops = | ||||
| static int htcleo_backlight_probe(struct platform_device *pdev) | ||||
| { | ||||
|     struct backlight_device *bd; | ||||
|     ret = device_create_file(&client->dev, &dev_attr_reset); | ||||
|      | ||||
|     bd = backlight_device_register("htcleo-backlight", &pdev->dev, NULL, &htcleo_backlight_ops); | ||||
|     bd->props.max_brightness = HTCLEO_MAX_BRIGHTNESS; | ||||
|     bd->props.brightness = HTCLEO_MAX_BRIGHTNESS; | ||||
|   | ||||
| @@ -56,7 +56,7 @@ user may be able to adjust time in future | ||||
| static uint16_t lsensor_adc_table[10] =  | ||||
| { | ||||
|  | ||||
| 	0, 10, 30, 60, 100, 160, 250, 355, 465, 598 | ||||
| 	0, 5, 20, 70, 150, 240, 330, 425, 515, 590 | ||||
|  | ||||
| }; | ||||
|  | ||||
|   | ||||
| @@ -143,19 +143,15 @@ static int rpcrouter_send_control_msg(union rr_control_msg *msg) | ||||
|  | ||||
| 	RR("send control message cmd=%d srv.cmd=%d prog=%08x:%x id=%d:%08x\n", msg->cmd, msg->srv.cmd, msg->srv.prog, msg->srv.vers,  msg->srv.pid, msg->srv.cid); | ||||
|  | ||||
| 	if (!(msg->cmd == RPCROUTER_CTRL_CMD_HELLO) && !initialized) { | ||||
| 		printk(KERN_ERR "rpcrouter_send_control_msg(): Warning, " | ||||
| 		       "router not initialized\n"); | ||||
| 		return -EINVAL; | ||||
| 	} | ||||
| 	if (!(msg->cmd == RPCROUTER_CTRL_CMD_HELLO) && !initialized | ||||
| #if defined(CONFIG_MACH_HTCLEO) | ||||
| 	if ((msg->cmd == RPCROUTER_CTRL_CMD_BYE) && !initialized && !htcleo_is_nand_boot())  | ||||
| 	{ | ||||
| 	  && (!(msg->cmd == RPCROUTER_CTRL_CMD_BYE) && !htcleo_is_nand_boot()) | ||||
| #endif | ||||
| 	  ) { | ||||
| 		printk(KERN_ERR "rpcrouter_send_control_msg(): Warning, " | ||||
| 		       "router not initialized\n"); | ||||
| 		return -EINVAL; | ||||
| 	} | ||||
| #endif	 | ||||
|  | ||||
| 	hdr.version = RPCROUTER_VERSION; | ||||
| 	hdr.type = msg->cmd; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user