Changeset 464 for GPL/trunk/alsa-kernel/include/sound/soc.h
- Timestamp:
- Oct 8, 2009, 10:35:00 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GPL/trunk/alsa-kernel/include/sound/soc.h
r426 r464 119 119 .get = xhandler_get, .put = xhandler_put, \ 120 120 .private_value = SOC_SINGLE_VALUE(xreg, xshift, xmax, xinvert) } 121 #define SOC_DOUBLE_EXT(xname, xreg, shift_left, shift_right, xmax, xinvert,\ 122 xhandler_get, xhandler_put) \ 123 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\ 124 .info = snd_soc_info_volsw, \ 125 .get = xhandler_get, .put = xhandler_put, \ 126 .private_value = (unsigned long)&(struct soc_mixer_control) \ 127 {.reg = xreg, .shift = shift_left, .rshift = shift_right, \ 128 .max = xmax, .invert = xinvert} } 121 129 #define SOC_SINGLE_EXT_TLV(xname, xreg, xshift, xmax, xinvert,\ 122 130 xhandler_get, xhandler_put, tlv_array) \ … … 128 136 .get = xhandler_get, .put = xhandler_put, \ 129 137 .private_value = SOC_SINGLE_VALUE(xreg, xshift, xmax, xinvert) } 138 #define SOC_DOUBLE_EXT_TLV(xname, xreg, shift_left, shift_right, xmax, xinvert,\ 139 xhandler_get, xhandler_put, tlv_array) \ 140 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \ 141 .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ | \ 142 SNDRV_CTL_ELEM_ACCESS_READWRITE, \ 143 .tlv.p = (tlv_array), \ 144 .info = snd_soc_info_volsw, \ 145 .get = xhandler_get, .put = xhandler_put, \ 146 .private_value = (unsigned long)&(struct soc_mixer_control) \ 147 {.reg = xreg, .shift = shift_left, .rshift = shift_right, \ 148 .max = xmax, .invert = xinvert} } 149 #define SOC_DOUBLE_R_EXT_TLV(xname, reg_left, reg_right, xshift, xmax, xinvert,\ 150 xhandler_get, xhandler_put, tlv_array) \ 151 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \ 152 .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ | \ 153 SNDRV_CTL_ELEM_ACCESS_READWRITE, \ 154 .tlv.p = (tlv_array), \ 155 .info = snd_soc_info_volsw_2r, \ 156 .get = xhandler_get, .put = xhandler_put, \ 157 .private_value = (unsigned long)&(struct soc_mixer_control) \ 158 {.reg = reg_left, .rreg = reg_right, .shift = xshift, \ 159 .max = xmax, .invert = xinvert} } 130 160 #define SOC_SINGLE_BOOL_EXT(xname, xdata, xhandler_get, xhandler_put) \ 131 161 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ … … 180 210 extern struct snd_ac97_bus_ops soc_ac97_ops; 181 211 212 enum snd_soc_control_type { 213 SND_SOC_CUSTOM, 214 SND_SOC_I2C, 215 SND_SOC_SPI, 216 }; 217 182 218 int snd_soc_register_platform(struct snd_soc_platform *platform); 183 219 void snd_soc_unregister_platform(struct snd_soc_platform *platform); 184 220 int snd_soc_register_codec(struct snd_soc_codec *codec); 185 221 void snd_soc_unregister_codec(struct snd_soc_codec *codec); 222 int snd_soc_codec_volatile_register(struct snd_soc_codec *codec, int reg); 223 int snd_soc_codec_set_cache_io(struct snd_soc_codec *codec, 224 int addr_bits, int data_bits, 225 enum snd_soc_control_type control); 226 227 #ifdef CONFIG_PM 228 int snd_soc_suspend_device(struct device *dev); 229 int snd_soc_resume_device(struct device *dev); 230 #endif 186 231 187 232 /* pcm <-> DAI connect */ … … 207 252 #endif 208 253 209 /* codec IO */210 #define snd_soc_read(codec, reg) codec->read(codec, reg)211 #define snd_soc_write(codec, reg, value) codec->write(codec, reg, value)212 213 254 /* codec register bit access */ 214 255 int snd_soc_update_bits(struct snd_soc_codec *codec, unsigned short reg, 215 unsigned short mask, unsigned short value);256 unsigned int mask, unsigned int value); 216 257 int snd_soc_test_bits(struct snd_soc_codec *codec, unsigned short reg, 217 unsigned short mask, unsigned short value);258 unsigned int mask, unsigned int value); 218 259 219 260 int snd_soc_new_ac97_codec(struct snd_soc_codec *codec, … … 332 373 struct mutex mutex; 333 374 struct device *dev; 375 struct snd_soc_device *socdev; 334 376 335 377 struct list_head list; … … 352 394 int (*display_register)(struct snd_soc_codec *, char *, 353 395 size_t, unsigned int); 396 int (*volatile_register)(unsigned int); 397 int (*readable_register)(unsigned int); 354 398 hw_write_t hw_write; 355 hw_read_t hw_read;399 unsigned int (*hw_read)(struct snd_soc_codec *, unsigned int); 356 400 void *reg_cache; 357 401 short reg_cache_size; … … 373 417 struct dentry *debugfs_reg; 374 418 struct dentry *debugfs_pop_time; 419 struct dentry *debugfs_dapm; 375 420 #endif 376 421 }; … … 417 462 /* codec/machine specific init - e.g. add machine controls */ 418 463 int (*init)(struct snd_soc_codec *codec); 464 465 /* Symmetry requirements */ 466 unsigned int symmetric_rates:1; 467 468 /* Symmetry data - only valid if symmetry is being enforced */ 469 unsigned int rate; 419 470 420 471 /* DAI pcm */ … … 491 542 }; 492 543 544 /* codec IO */ 545 static inline unsigned int snd_soc_read(struct snd_soc_codec *codec, 546 unsigned int reg) 547 { 548 return codec->read(codec, reg); 549 } 550 551 static inline unsigned int snd_soc_write(struct snd_soc_codec *codec, 552 unsigned int reg, unsigned int val) 553 { 554 return codec->write(codec, reg, val); 555 } 556 493 557 #include <sound/soc-dai.h> 494 558
Note:
See TracChangeset
for help on using the changeset viewer.