diff options
Diffstat (limited to 'sound')
-rw-r--r-- | sound/aoa/codecs/onyx.c | 76 | ||||
-rw-r--r-- | sound/aoa/codecs/tas.c | 66 | ||||
-rw-r--r-- | sound/pci/emu10k1/io.c | 2 | ||||
-rw-r--r-- | sound/pci/intel8x0.c | 12 | ||||
-rw-r--r-- | sound/ppc/keywest.c | 82 | ||||
-rw-r--r-- | sound/soc/omap/omap-mcbsp.c | 7 | ||||
-rw-r--r-- | sound/soc/omap/osk5912.c | 4 | ||||
-rw-r--r-- | sound/soc/pxa/pxa-ssp.c | 1 | ||||
-rw-r--r-- | sound/soc/s3c24xx/jive_wm8750.c | 12 | ||||
-rw-r--r-- | sound/soc/s3c24xx/s3c-i2s-v2.c | 18 | ||||
-rw-r--r-- | sound/soc/s3c24xx/s3c2412-i2s.c | 2 |
11 files changed, 168 insertions, 114 deletions
diff --git a/sound/aoa/codecs/onyx.c b/sound/aoa/codecs/onyx.c index 15500b9d2da0..84bb07d39a7f 100644 --- a/sound/aoa/codecs/onyx.c +++ b/sound/aoa/codecs/onyx.c | |||
@@ -47,7 +47,7 @@ MODULE_DESCRIPTION("pcm3052 (onyx) codec driver for snd-aoa"); | |||
47 | struct onyx { | 47 | struct onyx { |
48 | /* cache registers 65 to 80, they are write-only! */ | 48 | /* cache registers 65 to 80, they are write-only! */ |
49 | u8 cache[16]; | 49 | u8 cache[16]; |
50 | struct i2c_client i2c; | 50 | struct i2c_client *i2c; |
51 | struct aoa_codec codec; | 51 | struct aoa_codec codec; |
52 | u32 initialised:1, | 52 | u32 initialised:1, |
53 | spdif_locked:1, | 53 | spdif_locked:1, |
@@ -72,7 +72,7 @@ static int onyx_read_register(struct onyx *onyx, u8 reg, u8 *value) | |||
72 | *value = onyx->cache[reg-FIRSTREGISTER]; | 72 | *value = onyx->cache[reg-FIRSTREGISTER]; |
73 | return 0; | 73 | return 0; |
74 | } | 74 | } |
75 | v = i2c_smbus_read_byte_data(&onyx->i2c, reg); | 75 | v = i2c_smbus_read_byte_data(onyx->i2c, reg); |
76 | if (v < 0) | 76 | if (v < 0) |
77 | return -1; | 77 | return -1; |
78 | *value = (u8)v; | 78 | *value = (u8)v; |
@@ -84,7 +84,7 @@ static int onyx_write_register(struct onyx *onyx, u8 reg, u8 value) | |||
84 | { | 84 | { |
85 | int result; | 85 | int result; |
86 | 86 | ||
87 | result = i2c_smbus_write_byte_data(&onyx->i2c, reg, value); | 87 | result = i2c_smbus_write_byte_data(onyx->i2c, reg, value); |
88 | if (!result) | 88 | if (!result) |
89 | onyx->cache[reg-FIRSTREGISTER] = value; | 89 | onyx->cache[reg-FIRSTREGISTER] = value; |
90 | return result; | 90 | return result; |
@@ -996,12 +996,45 @@ static void onyx_exit_codec(struct aoa_codec *codec) | |||
996 | onyx->codec.soundbus_dev->detach_codec(onyx->codec.soundbus_dev, onyx); | 996 | onyx->codec.soundbus_dev->detach_codec(onyx->codec.soundbus_dev, onyx); |
997 | } | 997 | } |
998 | 998 | ||
999 | static struct i2c_driver onyx_driver; | ||
1000 | |||
1001 | static int onyx_create(struct i2c_adapter *adapter, | 999 | static int onyx_create(struct i2c_adapter *adapter, |
1002 | struct device_node *node, | 1000 | struct device_node *node, |
1003 | int addr) | 1001 | int addr) |
1004 | { | 1002 | { |
1003 | struct i2c_board_info info; | ||
1004 | struct i2c_client *client; | ||
1005 | |||
1006 | memset(&info, 0, sizeof(struct i2c_board_info)); | ||
1007 | strlcpy(info.type, "aoa_codec_onyx", I2C_NAME_SIZE); | ||
1008 | info.addr = addr; | ||
1009 | info.platform_data = node; | ||
1010 | client = i2c_new_device(adapter, &info); | ||
1011 | if (!client) | ||
1012 | return -ENODEV; | ||
1013 | |||
1014 | /* | ||
1015 | * We know the driver is already loaded, so the device should be | ||
1016 | * already bound. If not it means binding failed, which suggests | ||
1017 | * the device doesn't really exist and should be deleted. | ||
1018 | * Ideally this would be replaced by better checks _before_ | ||
1019 | * instantiating the device. | ||
1020 | */ | ||
1021 | if (!client->driver) { | ||
1022 | i2c_unregister_device(client); | ||
1023 | return -ENODEV; | ||
1024 | } | ||
1025 | |||
1026 | /* | ||
1027 | * Let i2c-core delete that device on driver removal. | ||
1028 | * This is safe because i2c-core holds the core_lock mutex for us. | ||
1029 | */ | ||
1030 | list_add_tail(&client->detected, &client->driver->clients); | ||
1031 | return 0; | ||
1032 | } | ||
1033 | |||
1034 | static int onyx_i2c_probe(struct i2c_client *client, | ||
1035 | const struct i2c_device_id *id) | ||
1036 | { | ||
1037 | struct device_node *node = client->dev.platform_data; | ||
1005 | struct onyx *onyx; | 1038 | struct onyx *onyx; |
1006 | u8 dummy; | 1039 | u8 dummy; |
1007 | 1040 | ||
@@ -1011,20 +1044,12 @@ static int onyx_create(struct i2c_adapter *adapter, | |||
1011 | return -ENOMEM; | 1044 | return -ENOMEM; |
1012 | 1045 | ||
1013 | mutex_init(&onyx->mutex); | 1046 | mutex_init(&onyx->mutex); |
1014 | onyx->i2c.driver = &onyx_driver; | 1047 | onyx->i2c = client; |
1015 | onyx->i2c.adapter = adapter; | 1048 | i2c_set_clientdata(client, onyx); |
1016 | onyx->i2c.addr = addr & 0x7f; | ||
1017 | strlcpy(onyx->i2c.name, "onyx audio codec", I2C_NAME_SIZE); | ||
1018 | |||
1019 | if (i2c_attach_client(&onyx->i2c)) { | ||
1020 | printk(KERN_ERR PFX "failed to attach to i2c\n"); | ||
1021 | goto fail; | ||
1022 | } | ||
1023 | 1049 | ||
1024 | /* we try to read from register ONYX_REG_CONTROL | 1050 | /* we try to read from register ONYX_REG_CONTROL |
1025 | * to check if the codec is present */ | 1051 | * to check if the codec is present */ |
1026 | if (onyx_read_register(onyx, ONYX_REG_CONTROL, &dummy) != 0) { | 1052 | if (onyx_read_register(onyx, ONYX_REG_CONTROL, &dummy) != 0) { |
1027 | i2c_detach_client(&onyx->i2c); | ||
1028 | printk(KERN_ERR PFX "failed to read control register\n"); | 1053 | printk(KERN_ERR PFX "failed to read control register\n"); |
1029 | goto fail; | 1054 | goto fail; |
1030 | } | 1055 | } |
@@ -1036,14 +1061,14 @@ static int onyx_create(struct i2c_adapter *adapter, | |||
1036 | onyx->codec.node = of_node_get(node); | 1061 | onyx->codec.node = of_node_get(node); |
1037 | 1062 | ||
1038 | if (aoa_codec_register(&onyx->codec)) { | 1063 | if (aoa_codec_register(&onyx->codec)) { |
1039 | i2c_detach_client(&onyx->i2c); | ||
1040 | goto fail; | 1064 | goto fail; |
1041 | } | 1065 | } |
1042 | printk(KERN_DEBUG PFX "created and attached onyx instance\n"); | 1066 | printk(KERN_DEBUG PFX "created and attached onyx instance\n"); |
1043 | return 0; | 1067 | return 0; |
1044 | fail: | 1068 | fail: |
1069 | i2c_set_clientdata(client, NULL); | ||
1045 | kfree(onyx); | 1070 | kfree(onyx); |
1046 | return -EINVAL; | 1071 | return -ENODEV; |
1047 | } | 1072 | } |
1048 | 1073 | ||
1049 | static int onyx_i2c_attach(struct i2c_adapter *adapter) | 1074 | static int onyx_i2c_attach(struct i2c_adapter *adapter) |
@@ -1080,28 +1105,33 @@ static int onyx_i2c_attach(struct i2c_adapter *adapter) | |||
1080 | return onyx_create(adapter, NULL, 0x47); | 1105 | return onyx_create(adapter, NULL, 0x47); |
1081 | } | 1106 | } |
1082 | 1107 | ||
1083 | static int onyx_i2c_detach(struct i2c_client *client) | 1108 | static int onyx_i2c_remove(struct i2c_client *client) |
1084 | { | 1109 | { |
1085 | struct onyx *onyx = container_of(client, struct onyx, i2c); | 1110 | struct onyx *onyx = i2c_get_clientdata(client); |
1086 | int err; | ||
1087 | 1111 | ||
1088 | if ((err = i2c_detach_client(client))) | ||
1089 | return err; | ||
1090 | aoa_codec_unregister(&onyx->codec); | 1112 | aoa_codec_unregister(&onyx->codec); |
1091 | of_node_put(onyx->codec.node); | 1113 | of_node_put(onyx->codec.node); |
1092 | if (onyx->codec_info) | 1114 | if (onyx->codec_info) |
1093 | kfree(onyx->codec_info); | 1115 | kfree(onyx->codec_info); |
1116 | i2c_set_clientdata(client, onyx); | ||
1094 | kfree(onyx); | 1117 | kfree(onyx); |
1095 | return 0; | 1118 | return 0; |
1096 | } | 1119 | } |
1097 | 1120 | ||
1121 | static const struct i2c_device_id onyx_i2c_id[] = { | ||
1122 | { "aoa_codec_onyx", 0 }, | ||
1123 | { } | ||
1124 | }; | ||
1125 | |||
1098 | static struct i2c_driver onyx_driver = { | 1126 | static struct i2c_driver onyx_driver = { |
1099 | .driver = { | 1127 | .driver = { |
1100 | .name = "aoa_codec_onyx", | 1128 | .name = "aoa_codec_onyx", |
1101 | .owner = THIS_MODULE, | 1129 | .owner = THIS_MODULE, |
1102 | }, | 1130 | }, |
1103 | .attach_adapter = onyx_i2c_attach, | 1131 | .attach_adapter = onyx_i2c_attach, |
1104 | .detach_client = onyx_i2c_detach, | 1132 | .probe = onyx_i2c_probe, |
1133 | .remove = onyx_i2c_remove, | ||
1134 | .id_table = onyx_i2c_id, | ||
1105 | }; | 1135 | }; |
1106 | 1136 | ||
1107 | static int __init onyx_init(void) | 1137 | static int __init onyx_init(void) |
diff --git a/sound/aoa/codecs/tas.c b/sound/aoa/codecs/tas.c index 008e0f85097d..f0ebc971c686 100644 --- a/sound/aoa/codecs/tas.c +++ b/sound/aoa/codecs/tas.c | |||
@@ -82,7 +82,7 @@ MODULE_DESCRIPTION("tas codec driver for snd-aoa"); | |||
82 | 82 | ||
83 | struct tas { | 83 | struct tas { |
84 | struct aoa_codec codec; | 84 | struct aoa_codec codec; |
85 | struct i2c_client i2c; | 85 | struct i2c_client *i2c; |
86 | u32 mute_l:1, mute_r:1 , | 86 | u32 mute_l:1, mute_r:1 , |
87 | controls_created:1 , | 87 | controls_created:1 , |
88 | drc_enabled:1, | 88 | drc_enabled:1, |
@@ -108,9 +108,9 @@ static struct tas *codec_to_tas(struct aoa_codec *codec) | |||
108 | static inline int tas_write_reg(struct tas *tas, u8 reg, u8 len, u8 *data) | 108 | static inline int tas_write_reg(struct tas *tas, u8 reg, u8 len, u8 *data) |
109 | { | 109 | { |
110 | if (len == 1) | 110 | if (len == 1) |
111 | return i2c_smbus_write_byte_data(&tas->i2c, reg, *data); | 111 | return i2c_smbus_write_byte_data(tas->i2c, reg, *data); |
112 | else | 112 | else |
113 | return i2c_smbus_write_i2c_block_data(&tas->i2c, reg, len, data); | 113 | return i2c_smbus_write_i2c_block_data(tas->i2c, reg, len, data); |
114 | } | 114 | } |
115 | 115 | ||
116 | static void tas3004_set_drc(struct tas *tas) | 116 | static void tas3004_set_drc(struct tas *tas) |
@@ -882,12 +882,34 @@ static void tas_exit_codec(struct aoa_codec *codec) | |||
882 | } | 882 | } |
883 | 883 | ||
884 | 884 | ||
885 | static struct i2c_driver tas_driver; | ||
886 | |||
887 | static int tas_create(struct i2c_adapter *adapter, | 885 | static int tas_create(struct i2c_adapter *adapter, |
888 | struct device_node *node, | 886 | struct device_node *node, |
889 | int addr) | 887 | int addr) |
890 | { | 888 | { |
889 | struct i2c_board_info info; | ||
890 | struct i2c_client *client; | ||
891 | |||
892 | memset(&info, 0, sizeof(struct i2c_board_info)); | ||
893 | strlcpy(info.type, "aoa_codec_tas", I2C_NAME_SIZE); | ||
894 | info.addr = addr; | ||
895 | info.platform_data = node; | ||
896 | |||
897 | client = i2c_new_device(adapter, &info); | ||
898 | if (!client) | ||
899 | return -ENODEV; | ||
900 | |||
901 | /* | ||
902 | * Let i2c-core delete that device on driver removal. | ||
903 | * This is safe because i2c-core holds the core_lock mutex for us. | ||
904 | */ | ||
905 | list_add_tail(&client->detected, &client->driver->clients); | ||
906 | return 0; | ||
907 | } | ||
908 | |||
909 | static int tas_i2c_probe(struct i2c_client *client, | ||
910 | const struct i2c_device_id *id) | ||
911 | { | ||
912 | struct device_node *node = client->dev.platform_data; | ||
891 | struct tas *tas; | 913 | struct tas *tas; |
892 | 914 | ||
893 | tas = kzalloc(sizeof(struct tas), GFP_KERNEL); | 915 | tas = kzalloc(sizeof(struct tas), GFP_KERNEL); |
@@ -896,17 +918,11 @@ static int tas_create(struct i2c_adapter *adapter, | |||
896 | return -ENOMEM; | 918 | return -ENOMEM; |
897 | 919 | ||
898 | mutex_init(&tas->mtx); | 920 | mutex_init(&tas->mtx); |
899 | tas->i2c.driver = &tas_driver; | 921 | tas->i2c = client; |
900 | tas->i2c.adapter = adapter; | 922 | i2c_set_clientdata(client, tas); |
901 | tas->i2c.addr = addr; | 923 | |
902 | /* seems that half is a saner default */ | 924 | /* seems that half is a saner default */ |
903 | tas->drc_range = TAS3004_DRC_MAX / 2; | 925 | tas->drc_range = TAS3004_DRC_MAX / 2; |
904 | strlcpy(tas->i2c.name, "tas audio codec", I2C_NAME_SIZE); | ||
905 | |||
906 | if (i2c_attach_client(&tas->i2c)) { | ||
907 | printk(KERN_ERR PFX "failed to attach to i2c\n"); | ||
908 | goto fail; | ||
909 | } | ||
910 | 926 | ||
911 | strlcpy(tas->codec.name, "tas", MAX_CODEC_NAME_LEN); | 927 | strlcpy(tas->codec.name, "tas", MAX_CODEC_NAME_LEN); |
912 | tas->codec.owner = THIS_MODULE; | 928 | tas->codec.owner = THIS_MODULE; |
@@ -915,14 +931,12 @@ static int tas_create(struct i2c_adapter *adapter, | |||
915 | tas->codec.node = of_node_get(node); | 931 | tas->codec.node = of_node_get(node); |
916 | 932 | ||
917 | if (aoa_codec_register(&tas->codec)) { | 933 | if (aoa_codec_register(&tas->codec)) { |
918 | goto detach; | 934 | goto fail; |
919 | } | 935 | } |
920 | printk(KERN_DEBUG | 936 | printk(KERN_DEBUG |
921 | "snd-aoa-codec-tas: tas found, addr 0x%02x on %s\n", | 937 | "snd-aoa-codec-tas: tas found, addr 0x%02x on %s\n", |
922 | addr, node->full_name); | 938 | (unsigned int)client->addr, node->full_name); |
923 | return 0; | 939 | return 0; |
924 | detach: | ||
925 | i2c_detach_client(&tas->i2c); | ||
926 | fail: | 940 | fail: |
927 | mutex_destroy(&tas->mtx); | 941 | mutex_destroy(&tas->mtx); |
928 | kfree(tas); | 942 | kfree(tas); |
@@ -970,14 +984,11 @@ static int tas_i2c_attach(struct i2c_adapter *adapter) | |||
970 | return -ENODEV; | 984 | return -ENODEV; |
971 | } | 985 | } |
972 | 986 | ||
973 | static int tas_i2c_detach(struct i2c_client *client) | 987 | static int tas_i2c_remove(struct i2c_client *client) |
974 | { | 988 | { |
975 | struct tas *tas = container_of(client, struct tas, i2c); | 989 | struct tas *tas = i2c_get_clientdata(client); |
976 | int err; | ||
977 | u8 tmp = TAS_ACR_ANALOG_PDOWN; | 990 | u8 tmp = TAS_ACR_ANALOG_PDOWN; |
978 | 991 | ||
979 | if ((err = i2c_detach_client(client))) | ||
980 | return err; | ||
981 | aoa_codec_unregister(&tas->codec); | 992 | aoa_codec_unregister(&tas->codec); |
982 | of_node_put(tas->codec.node); | 993 | of_node_put(tas->codec.node); |
983 | 994 | ||
@@ -989,13 +1000,20 @@ static int tas_i2c_detach(struct i2c_client *client) | |||
989 | return 0; | 1000 | return 0; |
990 | } | 1001 | } |
991 | 1002 | ||
1003 | static const struct i2c_device_id tas_i2c_id[] = { | ||
1004 | { "aoa_codec_tas", 0 }, | ||
1005 | { } | ||
1006 | }; | ||
1007 | |||
992 | static struct i2c_driver tas_driver = { | 1008 | static struct i2c_driver tas_driver = { |
993 | .driver = { | 1009 | .driver = { |
994 | .name = "aoa_codec_tas", | 1010 | .name = "aoa_codec_tas", |
995 | .owner = THIS_MODULE, | 1011 | .owner = THIS_MODULE, |
996 | }, | 1012 | }, |
997 | .attach_adapter = tas_i2c_attach, | 1013 | .attach_adapter = tas_i2c_attach, |
998 | .detach_client = tas_i2c_detach, | 1014 | .probe = tas_i2c_probe, |
1015 | .remove = tas_i2c_remove, | ||
1016 | .id_table = tas_i2c_id, | ||
999 | }; | 1017 | }; |
1000 | 1018 | ||
1001 | static int __init tas_init(void) | 1019 | static int __init tas_init(void) |
diff --git a/sound/pci/emu10k1/io.c b/sound/pci/emu10k1/io.c index 4bfc31d1b281..c1a5aa15af8f 100644 --- a/sound/pci/emu10k1/io.c +++ b/sound/pci/emu10k1/io.c | |||
@@ -490,7 +490,7 @@ void snd_emu10k1_wait(struct snd_emu10k1 *emu, unsigned int wait) | |||
490 | if (newtime != curtime) | 490 | if (newtime != curtime) |
491 | break; | 491 | break; |
492 | } | 492 | } |
493 | if (count >= 16384) | 493 | if (count > 16384) |
494 | break; | 494 | break; |
495 | curtime = newtime; | 495 | curtime = newtime; |
496 | } | 496 | } |
diff --git a/sound/pci/intel8x0.c b/sound/pci/intel8x0.c index 5dced5b79387..8042d5398892 100644 --- a/sound/pci/intel8x0.c +++ b/sound/pci/intel8x0.c | |||
@@ -1854,6 +1854,12 @@ static struct ac97_quirk ac97_quirks[] __devinitdata = { | |||
1854 | }, | 1854 | }, |
1855 | { | 1855 | { |
1856 | .subvendor = 0x1028, | 1856 | .subvendor = 0x1028, |
1857 | .subdevice = 0x016a, | ||
1858 | .name = "Dell Inspiron 8600", /* STAC9750/51 */ | ||
1859 | .type = AC97_TUNE_HP_ONLY | ||
1860 | }, | ||
1861 | { | ||
1862 | .subvendor = 0x1028, | ||
1857 | .subdevice = 0x0186, | 1863 | .subdevice = 0x0186, |
1858 | .name = "Dell Latitude D810", /* cf. Malone #41015 */ | 1864 | .name = "Dell Latitude D810", /* cf. Malone #41015 */ |
1859 | .type = AC97_TUNE_HP_MUTE_LED | 1865 | .type = AC97_TUNE_HP_MUTE_LED |
@@ -1896,12 +1902,6 @@ static struct ac97_quirk ac97_quirks[] __devinitdata = { | |||
1896 | }, | 1902 | }, |
1897 | { | 1903 | { |
1898 | .subvendor = 0x103c, | 1904 | .subvendor = 0x103c, |
1899 | .subdevice = 0x0934, | ||
1900 | .name = "HP nx8220", | ||
1901 | .type = AC97_TUNE_MUTE_LED | ||
1902 | }, | ||
1903 | { | ||
1904 | .subvendor = 0x103c, | ||
1905 | .subdevice = 0x129d, | 1905 | .subdevice = 0x129d, |
1906 | .name = "HP xw8000", | 1906 | .name = "HP xw8000", |
1907 | .type = AC97_TUNE_HP_ONLY | 1907 | .type = AC97_TUNE_HP_ONLY |
diff --git a/sound/ppc/keywest.c b/sound/ppc/keywest.c index 6ff99ed77516..a5afb2682e7f 100644 --- a/sound/ppc/keywest.c +++ b/sound/ppc/keywest.c | |||
@@ -33,26 +33,25 @@ | |||
33 | static struct pmac_keywest *keywest_ctx; | 33 | static struct pmac_keywest *keywest_ctx; |
34 | 34 | ||
35 | 35 | ||
36 | static int keywest_attach_adapter(struct i2c_adapter *adapter); | ||
37 | static int keywest_detach_client(struct i2c_client *client); | ||
38 | |||
39 | struct i2c_driver keywest_driver = { | ||
40 | .driver = { | ||
41 | .name = "PMac Keywest Audio", | ||
42 | }, | ||
43 | .attach_adapter = &keywest_attach_adapter, | ||
44 | .detach_client = &keywest_detach_client, | ||
45 | }; | ||
46 | |||
47 | |||
48 | #ifndef i2c_device_name | 36 | #ifndef i2c_device_name |
49 | #define i2c_device_name(x) ((x)->name) | 37 | #define i2c_device_name(x) ((x)->name) |
50 | #endif | 38 | #endif |
51 | 39 | ||
40 | static int keywest_probe(struct i2c_client *client, | ||
41 | const struct i2c_device_id *id) | ||
42 | { | ||
43 | i2c_set_clientdata(client, keywest_ctx); | ||
44 | return 0; | ||
45 | } | ||
46 | |||
47 | /* | ||
48 | * This is kind of a hack, best would be to turn powermac to fixed i2c | ||
49 | * bus numbers and declare the sound device as part of platform | ||
50 | * initialization | ||
51 | */ | ||
52 | static int keywest_attach_adapter(struct i2c_adapter *adapter) | 52 | static int keywest_attach_adapter(struct i2c_adapter *adapter) |
53 | { | 53 | { |
54 | int err; | 54 | struct i2c_board_info info; |
55 | struct i2c_client *new_client; | ||
56 | 55 | ||
57 | if (! keywest_ctx) | 56 | if (! keywest_ctx) |
58 | return -EINVAL; | 57 | return -EINVAL; |
@@ -60,46 +59,47 @@ static int keywest_attach_adapter(struct i2c_adapter *adapter) | |||
60 | if (strncmp(i2c_device_name(adapter), "mac-io", 6)) | 59 | if (strncmp(i2c_device_name(adapter), "mac-io", 6)) |
61 | return 0; /* ignored */ | 60 | return 0; /* ignored */ |
62 | 61 | ||
63 | new_client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL); | 62 | memset(&info, 0, sizeof(struct i2c_board_info)); |
64 | if (! new_client) | 63 | strlcpy(info.type, "keywest", I2C_NAME_SIZE); |
65 | return -ENOMEM; | 64 | info.addr = keywest_ctx->addr; |
66 | 65 | keywest_ctx->client = i2c_new_device(adapter, &info); | |
67 | new_client->addr = keywest_ctx->addr; | ||
68 | i2c_set_clientdata(new_client, keywest_ctx); | ||
69 | new_client->adapter = adapter; | ||
70 | new_client->driver = &keywest_driver; | ||
71 | new_client->flags = 0; | ||
72 | |||
73 | strcpy(i2c_device_name(new_client), keywest_ctx->name); | ||
74 | keywest_ctx->client = new_client; | ||
75 | 66 | ||
76 | /* Tell the i2c layer a new client has arrived */ | 67 | /* |
77 | if (i2c_attach_client(new_client)) { | 68 | * Let i2c-core delete that device on driver removal. |
78 | snd_printk(KERN_ERR "tumbler: cannot attach i2c client\n"); | 69 | * This is safe because i2c-core holds the core_lock mutex for us. |
79 | err = -ENODEV; | 70 | */ |
80 | goto __err; | 71 | list_add_tail(&keywest_ctx->client->detected, |
81 | } | 72 | &keywest_ctx->client->driver->clients); |
82 | |||
83 | return 0; | 73 | return 0; |
84 | |||
85 | __err: | ||
86 | kfree(new_client); | ||
87 | keywest_ctx->client = NULL; | ||
88 | return err; | ||
89 | } | 74 | } |
90 | 75 | ||
91 | static int keywest_detach_client(struct i2c_client *client) | 76 | static int keywest_remove(struct i2c_client *client) |
92 | { | 77 | { |
78 | i2c_set_clientdata(client, NULL); | ||
93 | if (! keywest_ctx) | 79 | if (! keywest_ctx) |
94 | return 0; | 80 | return 0; |
95 | if (client == keywest_ctx->client) | 81 | if (client == keywest_ctx->client) |
96 | keywest_ctx->client = NULL; | 82 | keywest_ctx->client = NULL; |
97 | 83 | ||
98 | i2c_detach_client(client); | ||
99 | kfree(client); | ||
100 | return 0; | 84 | return 0; |
101 | } | 85 | } |
102 | 86 | ||
87 | |||
88 | static const struct i2c_device_id keywest_i2c_id[] = { | ||
89 | { "keywest", 0 }, | ||
90 | { } | ||
91 | }; | ||
92 | |||
93 | struct i2c_driver keywest_driver = { | ||
94 | .driver = { | ||
95 | .name = "PMac Keywest Audio", | ||
96 | }, | ||
97 | .attach_adapter = keywest_attach_adapter, | ||
98 | .probe = keywest_probe, | ||
99 | .remove = keywest_remove, | ||
100 | .id_table = keywest_i2c_id, | ||
101 | }; | ||
102 | |||
103 | /* exported */ | 103 | /* exported */ |
104 | void snd_pmac_keywest_cleanup(struct pmac_keywest *i2c) | 104 | void snd_pmac_keywest_cleanup(struct pmac_keywest *i2c) |
105 | { | 105 | { |
diff --git a/sound/soc/omap/omap-mcbsp.c b/sound/soc/omap/omap-mcbsp.c index 9c09b94f0cf8..90f4df7fd906 100644 --- a/sound/soc/omap/omap-mcbsp.c +++ b/sound/soc/omap/omap-mcbsp.c | |||
@@ -283,7 +283,7 @@ static int omap_mcbsp_dai_hw_params(struct snd_pcm_substream *substream, | |||
283 | break; | 283 | break; |
284 | case SND_SOC_DAIFMT_DSP_B: | 284 | case SND_SOC_DAIFMT_DSP_B: |
285 | regs->srgr2 |= FPER(wlen * channels - 1); | 285 | regs->srgr2 |= FPER(wlen * channels - 1); |
286 | regs->srgr1 |= FWID(wlen * channels - 2); | 286 | regs->srgr1 |= FWID(0); |
287 | break; | 287 | break; |
288 | } | 288 | } |
289 | 289 | ||
@@ -302,6 +302,7 @@ static int omap_mcbsp_dai_set_dai_fmt(struct snd_soc_dai *cpu_dai, | |||
302 | { | 302 | { |
303 | struct omap_mcbsp_data *mcbsp_data = to_mcbsp(cpu_dai->private_data); | 303 | struct omap_mcbsp_data *mcbsp_data = to_mcbsp(cpu_dai->private_data); |
304 | struct omap_mcbsp_reg_cfg *regs = &mcbsp_data->regs; | 304 | struct omap_mcbsp_reg_cfg *regs = &mcbsp_data->regs; |
305 | unsigned int temp_fmt = fmt; | ||
305 | 306 | ||
306 | if (mcbsp_data->configured) | 307 | if (mcbsp_data->configured) |
307 | return 0; | 308 | return 0; |
@@ -328,6 +329,8 @@ static int omap_mcbsp_dai_set_dai_fmt(struct snd_soc_dai *cpu_dai, | |||
328 | /* 0-bit data delay */ | 329 | /* 0-bit data delay */ |
329 | regs->rcr2 |= RDATDLY(0); | 330 | regs->rcr2 |= RDATDLY(0); |
330 | regs->xcr2 |= XDATDLY(0); | 331 | regs->xcr2 |= XDATDLY(0); |
332 | /* Invert FS polarity configuration */ | ||
333 | temp_fmt ^= SND_SOC_DAIFMT_NB_IF; | ||
331 | break; | 334 | break; |
332 | default: | 335 | default: |
333 | /* Unsupported data format */ | 336 | /* Unsupported data format */ |
@@ -351,7 +354,7 @@ static int omap_mcbsp_dai_set_dai_fmt(struct snd_soc_dai *cpu_dai, | |||
351 | } | 354 | } |
352 | 355 | ||
353 | /* Set bit clock (CLKX/CLKR) and FS polarities */ | 356 | /* Set bit clock (CLKX/CLKR) and FS polarities */ |
354 | switch (fmt & SND_SOC_DAIFMT_INV_MASK) { | 357 | switch (temp_fmt & SND_SOC_DAIFMT_INV_MASK) { |
355 | case SND_SOC_DAIFMT_NB_NF: | 358 | case SND_SOC_DAIFMT_NB_NF: |
356 | /* | 359 | /* |
357 | * Normal BCLK + FS. | 360 | * Normal BCLK + FS. |
diff --git a/sound/soc/omap/osk5912.c b/sound/soc/omap/osk5912.c index a952a4eb3361..a4e149b7f0eb 100644 --- a/sound/soc/omap/osk5912.c +++ b/sound/soc/omap/osk5912.c | |||
@@ -62,7 +62,7 @@ static int osk_hw_params(struct snd_pcm_substream *substream, | |||
62 | /* Set codec DAI configuration */ | 62 | /* Set codec DAI configuration */ |
63 | err = snd_soc_dai_set_fmt(codec_dai, | 63 | err = snd_soc_dai_set_fmt(codec_dai, |
64 | SND_SOC_DAIFMT_DSP_B | | 64 | SND_SOC_DAIFMT_DSP_B | |
65 | SND_SOC_DAIFMT_NB_IF | | 65 | SND_SOC_DAIFMT_NB_NF | |
66 | SND_SOC_DAIFMT_CBM_CFM); | 66 | SND_SOC_DAIFMT_CBM_CFM); |
67 | if (err < 0) { | 67 | if (err < 0) { |
68 | printk(KERN_ERR "can't set codec DAI configuration\n"); | 68 | printk(KERN_ERR "can't set codec DAI configuration\n"); |
@@ -72,7 +72,7 @@ static int osk_hw_params(struct snd_pcm_substream *substream, | |||
72 | /* Set cpu DAI configuration */ | 72 | /* Set cpu DAI configuration */ |
73 | err = snd_soc_dai_set_fmt(cpu_dai, | 73 | err = snd_soc_dai_set_fmt(cpu_dai, |
74 | SND_SOC_DAIFMT_DSP_B | | 74 | SND_SOC_DAIFMT_DSP_B | |
75 | SND_SOC_DAIFMT_NB_IF | | 75 | SND_SOC_DAIFMT_NB_NF | |
76 | SND_SOC_DAIFMT_CBM_CFM); | 76 | SND_SOC_DAIFMT_CBM_CFM); |
77 | if (err < 0) { | 77 | if (err < 0) { |
78 | printk(KERN_ERR "can't set cpu DAI configuration\n"); | 78 | printk(KERN_ERR "can't set cpu DAI configuration\n"); |
diff --git a/sound/soc/pxa/pxa-ssp.c b/sound/soc/pxa/pxa-ssp.c index 308a657928d2..de2254475d52 100644 --- a/sound/soc/pxa/pxa-ssp.c +++ b/sound/soc/pxa/pxa-ssp.c | |||
@@ -806,6 +806,7 @@ static int pxa_ssp_probe(struct platform_device *pdev, | |||
806 | goto err_priv; | 806 | goto err_priv; |
807 | } | 807 | } |
808 | 808 | ||
809 | priv->dai_fmt = (unsigned int) -1; | ||
809 | dai->private_data = priv; | 810 | dai->private_data = priv; |
810 | 811 | ||
811 | return 0; | 812 | return 0; |
diff --git a/sound/soc/s3c24xx/jive_wm8750.c b/sound/soc/s3c24xx/jive_wm8750.c index 32063790d95b..93e6c87b7399 100644 --- a/sound/soc/s3c24xx/jive_wm8750.c +++ b/sound/soc/s3c24xx/jive_wm8750.c | |||
@@ -69,8 +69,8 @@ static int jive_hw_params(struct snd_pcm_substream *substream, | |||
69 | break; | 69 | break; |
70 | } | 70 | } |
71 | 71 | ||
72 | s3c_i2sv2_calc_rate(&div, NULL, params_rate(params), | 72 | s3c_i2sv2_iis_calc_rate(&div, NULL, params_rate(params), |
73 | s3c2412_get_iisclk()); | 73 | s3c2412_get_iisclk()); |
74 | 74 | ||
75 | /* set codec DAI configuration */ | 75 | /* set codec DAI configuration */ |
76 | ret = snd_soc_dai_set_fmt(codec_dai, SND_SOC_DAIFMT_I2S | | 76 | ret = snd_soc_dai_set_fmt(codec_dai, SND_SOC_DAIFMT_I2S | |
@@ -145,8 +145,9 @@ static struct snd_soc_dai_link jive_dai = { | |||
145 | }; | 145 | }; |
146 | 146 | ||
147 | /* jive audio machine driver */ | 147 | /* jive audio machine driver */ |
148 | static struct snd_soc_machine snd_soc_machine_jive = { | 148 | static struct snd_soc_card snd_soc_machine_jive = { |
149 | .name = "Jive", | 149 | .name = "Jive", |
150 | .platform = &s3c24xx_soc_platform, | ||
150 | .dai_link = &jive_dai, | 151 | .dai_link = &jive_dai, |
151 | .num_links = 1, | 152 | .num_links = 1, |
152 | }; | 153 | }; |
@@ -157,9 +158,8 @@ static struct wm8750_setup_data jive_wm8750_setup = { | |||
157 | 158 | ||
158 | /* jive audio subsystem */ | 159 | /* jive audio subsystem */ |
159 | static struct snd_soc_device jive_snd_devdata = { | 160 | static struct snd_soc_device jive_snd_devdata = { |
160 | .machine = &snd_soc_machine_jive, | 161 | .card = &snd_soc_machine_jive, |
161 | .platform = &s3c24xx_soc_platform, | 162 | .codec_dev = &soc_codec_dev_wm8750, |
162 | .codec_dev = &soc_codec_dev_wm8750_spi, | ||
163 | .codec_data = &jive_wm8750_setup, | 163 | .codec_data = &jive_wm8750_setup, |
164 | }; | 164 | }; |
165 | 165 | ||
diff --git a/sound/soc/s3c24xx/s3c-i2s-v2.c b/sound/soc/s3c24xx/s3c-i2s-v2.c index 295a4c910262..689ffcd17e1f 100644 --- a/sound/soc/s3c24xx/s3c-i2s-v2.c +++ b/sound/soc/s3c24xx/s3c-i2s-v2.c | |||
@@ -473,9 +473,9 @@ static int s3c2412_i2s_set_clkdiv(struct snd_soc_dai *cpu_dai, | |||
473 | /* default table of all avaialable root fs divisors */ | 473 | /* default table of all avaialable root fs divisors */ |
474 | static unsigned int iis_fs_tab[] = { 256, 512, 384, 768 }; | 474 | static unsigned int iis_fs_tab[] = { 256, 512, 384, 768 }; |
475 | 475 | ||
476 | int s3c2412_iis_calc_rate(struct s3c_i2sv2_rate_calc *info, | 476 | int s3c_i2sv2_iis_calc_rate(struct s3c_i2sv2_rate_calc *info, |
477 | unsigned int *fstab, | 477 | unsigned int *fstab, |
478 | unsigned int rate, struct clk *clk) | 478 | unsigned int rate, struct clk *clk) |
479 | { | 479 | { |
480 | unsigned long clkrate = clk_get_rate(clk); | 480 | unsigned long clkrate = clk_get_rate(clk); |
481 | unsigned int div; | 481 | unsigned int div; |
@@ -531,7 +531,7 @@ int s3c2412_iis_calc_rate(struct s3c_i2sv2_rate_calc *info, | |||
531 | 531 | ||
532 | return 0; | 532 | return 0; |
533 | } | 533 | } |
534 | EXPORT_SYMBOL_GPL(s3c2412_iis_calc_rate); | 534 | EXPORT_SYMBOL_GPL(s3c_i2sv2_iis_calc_rate); |
535 | 535 | ||
536 | int s3c_i2sv2_probe(struct platform_device *pdev, | 536 | int s3c_i2sv2_probe(struct platform_device *pdev, |
537 | struct snd_soc_dai *dai, | 537 | struct snd_soc_dai *dai, |
@@ -624,10 +624,12 @@ static int s3c2412_i2s_resume(struct snd_soc_dai *dai) | |||
624 | 624 | ||
625 | int s3c_i2sv2_register_dai(struct snd_soc_dai *dai) | 625 | int s3c_i2sv2_register_dai(struct snd_soc_dai *dai) |
626 | { | 626 | { |
627 | dai->ops.trigger = s3c2412_i2s_trigger; | 627 | struct snd_soc_dai_ops *ops = dai->ops; |
628 | dai->ops.hw_params = s3c2412_i2s_hw_params; | 628 | |
629 | dai->ops.set_fmt = s3c2412_i2s_set_fmt; | 629 | ops->trigger = s3c2412_i2s_trigger; |
630 | dai->ops.set_clkdiv = s3c2412_i2s_set_clkdiv; | 630 | ops->hw_params = s3c2412_i2s_hw_params; |
631 | ops->set_fmt = s3c2412_i2s_set_fmt; | ||
632 | ops->set_clkdiv = s3c2412_i2s_set_clkdiv; | ||
631 | 633 | ||
632 | dai->suspend = s3c2412_i2s_suspend; | 634 | dai->suspend = s3c2412_i2s_suspend; |
633 | dai->resume = s3c2412_i2s_resume; | 635 | dai->resume = s3c2412_i2s_resume; |
diff --git a/sound/soc/s3c24xx/s3c2412-i2s.c b/sound/soc/s3c24xx/s3c2412-i2s.c index 1ca3cdaa8213..b7e0b3f0bfc8 100644 --- a/sound/soc/s3c24xx/s3c2412-i2s.c +++ b/sound/soc/s3c24xx/s3c2412-i2s.c | |||
@@ -33,8 +33,8 @@ | |||
33 | 33 | ||
34 | #include <plat/regs-s3c2412-iis.h> | 34 | #include <plat/regs-s3c2412-iis.h> |
35 | 35 | ||
36 | #include <plat/regs-gpio.h> | ||
37 | #include <plat/audio.h> | 36 | #include <plat/audio.h> |
37 | #include <mach/regs-gpio.h> | ||
38 | #include <mach/dma.h> | 38 | #include <mach/dma.h> |
39 | 39 | ||
40 | #include "s3c24xx-pcm.h" | 40 | #include "s3c24xx-pcm.h" |