void MHL_On(bool on) { if (on == 1) { s3c_gpio_cfgpin(GPIO_MHL_INT, GPIO_MHL_INT_AF); sii9234_cfg_power(1); sii9234_init(); } else { sii9234_cfg_power(0); s3c_gpio_setpull(GPIO_MHL_SEL, S3C_GPIO_PULL_NONE); gpio_set_value(GPIO_MHL_SEL, GPIO_LEVEL_LOW); } }
int __init p3_gpio_i2c_init(void) { platform_device_register(&tegra_gpio_i2c5_device); platform_device_register(&tegra_gpio_i2c6_device); if (system_rev < 0x2) platform_device_register(&tegra_gpio_i2c7_device); platform_device_register(&tegra_gpio_i2c8_device); platform_device_register(&tegra_gpio_i2c9_device); platform_device_register(&tegra_gpio_i2c10_device); if(system_rev > 0x0A){ platform_device_register(&tegra_gpio_i2c11_device); platform_device_register(&tegra_gpio_i2c13_device); } else{ platform_device_register(&tegra_gpio_i2c11_rev05_device); platform_device_register(&tegra_gpio_i2c13_rev05_device); } if (system_rev >= 0x2) { /* greater than Rev0.2 or same */ platform_device_register(&tegra_gpio_i2c12_device); platform_device_register(&tegra_gpio_i2c14_device); platform_device_register(&tegra_gpio_i2c15_device); } i2c_register_board_info(6, sec_gpio_i2c6_info, ARRAY_SIZE(sec_gpio_i2c6_info)); if (system_rev < 0x2) i2c_register_board_info(7, sec_gpio_i2c7_info, ARRAY_SIZE(sec_gpio_i2c7_info)); i2c_register_board_info(8, sec_gpio_i2c8_info, ARRAY_SIZE(sec_gpio_i2c8_info)); nct1008_init(); i2c_register_board_info(9, sec_gpio_i2c9_info, ARRAY_SIZE(sec_gpio_i2c9_info)); i2c_register_board_info(10, sec_gpio_i2c10_info, ARRAY_SIZE(sec_gpio_i2c10_info)); i2c_register_board_info(11, sec_gpio_i2c11_info, ARRAY_SIZE(sec_gpio_i2c11_info)); if (system_rev >= 0x2) { sii9234_init(); i2c_register_board_info(14, sec_gpio_i2c14_info, ARRAY_SIZE(sec_gpio_i2c14_info)); i2c_register_board_info(15, sec_gpio_i2c15_info, ARRAY_SIZE(sec_gpio_i2c15_info)); } return 0; }
static ssize_t change_switch_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t size) { char *after; unsigned long value = simple_strtoul(buf, &after, 10); int i; printk(KERN_ERR "[MHL_SWITCH] Change the switch: %ld\n", value); if (value == 0) { for (i = 0; i <20; i++) { printk(KERN_ERR "[MHL] try %d\n", i+1); msleep(500); } s3c_gpio_cfgpin(GPIO_MHL_INT, GPIO_MHL_INT_AF); s3c_gpio_setpull(GPIO_MHL_SEL, S3C_GPIO_PULL_UP); gpio_set_value(GPIO_MHL_SEL, GPIO_LEVEL_HIGH); sii9234_cfg_power(1); sii9234_init(); } else { sii9234_cfg_power(0); s3c_gpio_setpull(GPIO_MHL_SEL, S3C_GPIO_PULL_NONE); gpio_set_value(GPIO_MHL_SEL, GPIO_LEVEL_LOW); } return size; }