diff options
-rwxr-xr-x | drivers/misc/fsa9480.c | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/drivers/misc/fsa9480.c b/drivers/misc/fsa9480.c index 758bf6e..caa6ded 100755 --- a/drivers/misc/fsa9480.c +++ b/drivers/misc/fsa9480.c @@ -291,11 +291,28 @@ static void fsa9480_detect_dev(struct fsa9480_usbsw *usbsw) if (pdata->deskdock_cb) pdata->deskdock_cb(FSA9480_ATTACHED); +#if defined(CONFIG_MACH_ARIES) +#if defined(CONFIG_SAMSUNG_CAPTIVATE) || defined(CONFIG_SAMSUNG_FASCINATE) + ret = i2c_smbus_write_byte_data(client, + FSA9480_REG_MANSW1, SW_AUDIO); + if (ret < 0) + dev_err(&client->dev, + "%s: err %d\n", __func__, ret); +#else + ret = i2c_smbus_write_byte_data(client, + FSA9480_REG_MANSW1, SW_VAUDIO); + if (ret < 0) + dev_err(&client->dev, + "%s: err %d\n", __func__, ret); +#endif +#else + ret = i2c_smbus_write_byte_data(client, FSA9480_REG_MANSW1, SW_DHOST); if (ret < 0) dev_err(&client->dev, "%s: err %d\n", __func__, ret); +#endif ret = i2c_smbus_read_byte_data(client, FSA9480_REG_CTRL); @@ -313,6 +330,35 @@ static void fsa9480_detect_dev(struct fsa9480_usbsw *usbsw) if (pdata->cardock_cb) pdata->cardock_cb(FSA9480_ATTACHED); dock_status = 1; + +#if defined(CONFIG_MACH_ARIES) +#if defined(CONFIG_SAMSUNG_CAPTIVATE) || defined(CONFIG_SAMSUNG_FASCINATE) + ret = i2c_smbus_write_byte_data(client, + FSA9480_REG_MANSW1, SW_AUDIO); + + if (ret < 0) + dev_err(&client->dev, + "%s: err %d\n", __func__, ret); +#else + ret = i2c_smbus_write_byte_data(client, + FSA9480_REG_MANSW1, SW_VAUDIO); + if (ret < 0) + dev_err(&client->dev, + "%s: err %d\n", __func__, ret); +#endif + ret = i2c_smbus_read_byte_data(client, + FSA9480_REG_CTRL); + if (ret < 0) + dev_err(&client->dev, + "%s: err %d\n", __func__, ret); + + ret = i2c_smbus_write_byte_data(client, + FSA9480_REG_CTRL, ret & ~CON_MANUAL_SW); + if (ret < 0) + dev_err(&client->dev, + "%s: err %d\n", __func__, ret); +#endif + } /* Detached */ } else { @@ -355,6 +401,21 @@ static void fsa9480_detect_dev(struct fsa9480_usbsw *usbsw) if (pdata->cardock_cb) pdata->cardock_cb(FSA9480_DETACHED); dock_status = 0; + +#if defined(CONFIG_MACH_ARIES) + ret = i2c_smbus_read_byte_data(client, + FSA9480_REG_CTRL); + if (ret < 0) + dev_err(&client->dev, + "%s: err %d\n", __func__, ret); + + ret = i2c_smbus_write_byte_data(client, + FSA9480_REG_CTRL, ret | CON_MANUAL_SW); + if (ret < 0) + dev_err(&client->dev, + "%s: err %d\n", __func__, ret); +#endif + } } |