diff options
author | jt1134 <jt1134@gmail.com> | 2011-12-27 01:18:29 -0600 |
---|---|---|
committer | jt1134 <jt1134@gmail.com> | 2011-12-27 01:18:29 -0600 |
commit | f9095fd3980a2b7647e3a6ccfa3099add5f92500 (patch) | |
tree | db401e90ab10cd0a9ea1a87e4588c3ff6babf69e | |
parent | 937e1b2f296fe36e6fc1c5bbc907d3a221ba07f4 (diff) | |
download | kernel_samsung_aries-f9095fd3980a2b7647e3a6ccfa3099add5f92500.zip kernel_samsung_aries-f9095fd3980a2b7647e3a6ccfa3099add5f92500.tar.gz kernel_samsung_aries-f9095fd3980a2b7647e3a6ccfa3099add5f92500.tar.bz2 |
readd support for dock audio
-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 + } } |