diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-09-11 12:19:35 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-09-11 12:19:35 -0400 |
| commit | a9c86d42599519f3d83b5f46bdab25046fe47b84 (patch) | |
| tree | 9b269e3162e5cc0c1a8dfc3349303c902718a9a9 /include | |
| parent | a12e4d304ce701844c639541d90df86e165d03f9 (diff) | |
| parent | 1110afbe728838ac7ce973c37af9e11385dbaef9 (diff) | |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6: (377 commits)
ASoC: au1x: PSC-AC97 bugfixes
ALSA: dummy - Increase MAX_PCM_SUBSTREAMS to 128
ALSA: dummy - Add debug proc file
ALSA: Add const prefix to proc helper functions
ALSA: Re-export snd_pcm_format_name() function
ALSA: hda - Use auto model for HP laptops with ALC268 codec
ALSA: cs46xx - Fix minimum period size
ASoC: Fix WM835x Out4 capture enumeration
ALSA: Remove unneeded ifdef from sound/core.h
ALSA: Remove struct snd_monitor_file from public sound/core.h
ASoC: Remove unuused hw_read_t
sound: oxygen: work around MCE when changing volume
ALSA: dummy - Fake buffer allocations
ALSA: hda/realtek: Added support for CLEVO M540R subsystem, 6 channel + digital
ASoC: fix pxa2xx-ac97.c breakage
ALSA: dummy - Fix the timer calculation in systimer mode
ALSA: dummy - Add more description
ALSA: dummy - Better jiffies handling
ALSA: dummy - Support high-res timer mode
ALSA: Release v1.0.21
...
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/fs.h | 19 | ||||
| -rw-r--r-- | include/linux/tty.h | 4 | ||||
| -rw-r--r-- | include/sound/ac97_codec.h | 9 | ||||
| -rw-r--r-- | include/sound/asound.h | 2 | ||||
| -rw-r--r-- | include/sound/core.h | 51 | ||||
| -rw-r--r-- | include/sound/info.h | 4 | ||||
| -rw-r--r-- | include/sound/memalloc.h | 6 | ||||
| -rw-r--r-- | include/sound/pcm.h | 25 | ||||
| -rw-r--r-- | include/sound/sh_fsi.h | 83 | ||||
| -rw-r--r-- | include/sound/soc-dai.h | 40 | ||||
| -rw-r--r-- | include/sound/soc-dapm.h | 10 | ||||
| -rw-r--r-- | include/sound/soc.h | 49 | ||||
| -rw-r--r-- | include/sound/tlv.h | 14 | ||||
| -rw-r--r-- | include/sound/uda1380.h | 22 | ||||
| -rw-r--r-- | include/sound/version.h | 2 | ||||
| -rw-r--r-- | include/sound/wm8993.h | 44 | ||||
| -rw-r--r-- | include/sound/ymfpci.h | 1 |
17 files changed, 318 insertions, 67 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h index 26da98f61116..a79f48373e7e 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
| @@ -1997,12 +1997,25 @@ extern void bd_release_from_disk(struct block_device *, struct gendisk *); | |||
| 1997 | #define CHRDEV_MAJOR_HASH_SIZE 255 | 1997 | #define CHRDEV_MAJOR_HASH_SIZE 255 |
| 1998 | extern int alloc_chrdev_region(dev_t *, unsigned, unsigned, const char *); | 1998 | extern int alloc_chrdev_region(dev_t *, unsigned, unsigned, const char *); |
| 1999 | extern int register_chrdev_region(dev_t, unsigned, const char *); | 1999 | extern int register_chrdev_region(dev_t, unsigned, const char *); |
| 2000 | extern int register_chrdev(unsigned int, const char *, | 2000 | extern int __register_chrdev(unsigned int major, unsigned int baseminor, |
| 2001 | const struct file_operations *); | 2001 | unsigned int count, const char *name, |
| 2002 | extern void unregister_chrdev(unsigned int, const char *); | 2002 | const struct file_operations *fops); |
| 2003 | extern void __unregister_chrdev(unsigned int major, unsigned int baseminor, | ||
| 2004 | unsigned int count, const char *name); | ||
| 2003 | extern void unregister_chrdev_region(dev_t, unsigned); | 2005 | extern void unregister_chrdev_region(dev_t, unsigned); |
| 2004 | extern void chrdev_show(struct seq_file *,off_t); | 2006 | extern void chrdev_show(struct seq_file *,off_t); |
| 2005 | 2007 | ||
| 2008 | static inline int register_chrdev(unsigned int major, const char *name, | ||
| 2009 | const struct file_operations *fops) | ||
| 2010 | { | ||
| 2011 | return __register_chrdev(major, 0, 256, name, fops); | ||
| 2012 | } | ||
| 2013 | |||
| 2014 | static inline void unregister_chrdev(unsigned int major, const char *name) | ||
| 2015 | { | ||
| 2016 | __unregister_chrdev(major, 0, 256, name); | ||
| 2017 | } | ||
| 2018 | |||
| 2006 | /* fs/block_dev.c */ | 2019 | /* fs/block_dev.c */ |
| 2007 | #define BDEVNAME_SIZE 32 /* Largest string for a blockdev identifier */ | 2020 | #define BDEVNAME_SIZE 32 /* Largest string for a blockdev identifier */ |
| 2008 | #define BDEVT_SIZE 10 /* Largest string for MAJ:MIN for blkdev */ | 2021 | #define BDEVT_SIZE 10 /* Largest string for MAJ:MIN for blkdev */ |
diff --git a/include/linux/tty.h b/include/linux/tty.h index e8c6c9136c97..0d3974f59c53 100644 --- a/include/linux/tty.h +++ b/include/linux/tty.h | |||
| @@ -23,7 +23,7 @@ | |||
| 23 | */ | 23 | */ |
| 24 | #define NR_UNIX98_PTY_DEFAULT 4096 /* Default maximum for Unix98 ptys */ | 24 | #define NR_UNIX98_PTY_DEFAULT 4096 /* Default maximum for Unix98 ptys */ |
| 25 | #define NR_UNIX98_PTY_MAX (1 << MINORBITS) /* Absolute limit */ | 25 | #define NR_UNIX98_PTY_MAX (1 << MINORBITS) /* Absolute limit */ |
| 26 | #define NR_LDISCS 19 | 26 | #define NR_LDISCS 20 |
| 27 | 27 | ||
| 28 | /* line disciplines */ | 28 | /* line disciplines */ |
| 29 | #define N_TTY 0 | 29 | #define N_TTY 0 |
| @@ -47,6 +47,8 @@ | |||
| 47 | #define N_SLCAN 17 /* Serial / USB serial CAN Adaptors */ | 47 | #define N_SLCAN 17 /* Serial / USB serial CAN Adaptors */ |
| 48 | #define N_PPS 18 /* Pulse per Second */ | 48 | #define N_PPS 18 /* Pulse per Second */ |
| 49 | 49 | ||
| 50 | #define N_V253 19 /* Codec control over voice modem */ | ||
| 51 | |||
| 50 | /* | 52 | /* |
| 51 | * This character is the same as _POSIX_VDISABLE: it cannot be used as | 53 | * This character is the same as _POSIX_VDISABLE: it cannot be used as |
| 52 | * a c_cc[] character, but indicates that a particular special character | 54 | * a c_cc[] character, but indicates that a particular special character |
diff --git a/include/sound/ac97_codec.h b/include/sound/ac97_codec.h index 251fc1cd5002..3dae3f799b9b 100644 --- a/include/sound/ac97_codec.h +++ b/include/sound/ac97_codec.h | |||
| @@ -32,6 +32,9 @@ | |||
| 32 | #include "control.h" | 32 | #include "control.h" |
| 33 | #include "info.h" | 33 | #include "info.h" |
| 34 | 34 | ||
| 35 | /* maximum number of devices on the AC97 bus */ | ||
| 36 | #define AC97_BUS_MAX_DEVICES 4 | ||
| 37 | |||
| 35 | /* | 38 | /* |
| 36 | * AC'97 codec registers | 39 | * AC'97 codec registers |
| 37 | */ | 40 | */ |
| @@ -642,4 +645,10 @@ int snd_ac97_pcm_double_rate_rules(struct snd_pcm_runtime *runtime); | |||
| 642 | /* ad hoc AC97 device driver access */ | 645 | /* ad hoc AC97 device driver access */ |
| 643 | extern struct bus_type ac97_bus_type; | 646 | extern struct bus_type ac97_bus_type; |
| 644 | 647 | ||
| 648 | /* AC97 platform_data adding function */ | ||
| 649 | static inline void snd_ac97_dev_add_pdata(struct snd_ac97 *ac97, void *data) | ||
| 650 | { | ||
| 651 | ac97->dev.platform_data = data; | ||
| 652 | } | ||
| 653 | |||
| 645 | #endif /* __SOUND_AC97_CODEC_H */ | 654 | #endif /* __SOUND_AC97_CODEC_H */ |
diff --git a/include/sound/asound.h b/include/sound/asound.h index 82aed3f47534..1f57bb92eb5a 100644 --- a/include/sound/asound.h +++ b/include/sound/asound.h | |||
| @@ -138,7 +138,7 @@ struct snd_hwdep_dsp_image { | |||
| 138 | * * | 138 | * * |
| 139 | *****************************************************************************/ | 139 | *****************************************************************************/ |
| 140 | 140 | ||
| 141 | #define SNDRV_PCM_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 9) | 141 | #define SNDRV_PCM_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 10) |
| 142 | 142 | ||
| 143 | typedef unsigned long snd_pcm_uframes_t; | 143 | typedef unsigned long snd_pcm_uframes_t; |
| 144 | typedef signed long snd_pcm_sframes_t; | 144 | typedef signed long snd_pcm_sframes_t; |
diff --git a/include/sound/core.h b/include/sound/core.h index 309cb9659a05..a61499c22b0b 100644 --- a/include/sound/core.h +++ b/include/sound/core.h | |||
| @@ -93,15 +93,6 @@ struct snd_device { | |||
| 93 | 93 | ||
| 94 | #define snd_device(n) list_entry(n, struct snd_device, list) | 94 | #define snd_device(n) list_entry(n, struct snd_device, list) |
| 95 | 95 | ||
| 96 | /* monitor files for graceful shutdown (hotplug) */ | ||
| 97 | |||
| 98 | struct snd_monitor_file { | ||
| 99 | struct file *file; | ||
| 100 | const struct file_operations *disconnected_f_op; | ||
| 101 | struct list_head shutdown_list; /* still need to shutdown */ | ||
| 102 | struct list_head list; /* link of monitor files */ | ||
| 103 | }; | ||
| 104 | |||
| 105 | /* main structure for soundcard */ | 96 | /* main structure for soundcard */ |
| 106 | 97 | ||
| 107 | struct snd_card { | 98 | struct snd_card { |
| @@ -311,9 +302,7 @@ int snd_component_add(struct snd_card *card, const char *component); | |||
| 311 | int snd_card_file_add(struct snd_card *card, struct file *file); | 302 | int snd_card_file_add(struct snd_card *card, struct file *file); |
| 312 | int snd_card_file_remove(struct snd_card *card, struct file *file); | 303 | int snd_card_file_remove(struct snd_card *card, struct file *file); |
| 313 | 304 | ||
| 314 | #ifndef snd_card_set_dev | ||
| 315 | #define snd_card_set_dev(card, devptr) ((card)->dev = (devptr)) | 305 | #define snd_card_set_dev(card, devptr) ((card)->dev = (devptr)) |
| 316 | #endif | ||
| 317 | 306 | ||
| 318 | /* device.c */ | 307 | /* device.c */ |
| 319 | 308 | ||
| @@ -340,18 +329,17 @@ unsigned int snd_dma_pointer(unsigned long dma, unsigned int size); | |||
| 340 | struct resource; | 329 | struct resource; |
| 341 | void release_and_free_resource(struct resource *res); | 330 | void release_and_free_resource(struct resource *res); |
| 342 | 331 | ||
| 343 | #ifdef CONFIG_SND_VERBOSE_PRINTK | ||
| 344 | void snd_verbose_printk(const char *file, int line, const char *format, ...) | ||
| 345 | __attribute__ ((format (printf, 3, 4))); | ||
| 346 | #endif | ||
| 347 | #if defined(CONFIG_SND_DEBUG) && defined(CONFIG_SND_VERBOSE_PRINTK) | ||
| 348 | void snd_verbose_printd(const char *file, int line, const char *format, ...) | ||
| 349 | __attribute__ ((format (printf, 3, 4))); | ||
| 350 | #endif | ||
| 351 | |||
| 352 | /* --- */ | 332 | /* --- */ |
| 353 | 333 | ||
| 354 | #ifdef CONFIG_SND_VERBOSE_PRINTK | 334 | #if defined(CONFIG_SND_DEBUG) || defined(CONFIG_SND_VERBOSE_PRINTK) |
| 335 | void __snd_printk(unsigned int level, const char *file, int line, | ||
| 336 | const char *format, ...) | ||
| 337 | __attribute__ ((format (printf, 4, 5))); | ||
| 338 | #else | ||
| 339 | #define __snd_printk(level, file, line, format, args...) \ | ||
| 340 | printk(format, ##args) | ||
| 341 | #endif | ||
| 342 | |||
| 355 | /** | 343 | /** |
| 356 | * snd_printk - printk wrapper | 344 | * snd_printk - printk wrapper |
| 357 | * @fmt: format string | 345 | * @fmt: format string |
| @@ -360,15 +348,9 @@ void snd_verbose_printd(const char *file, int line, const char *format, ...) | |||
| 360 | * when configured with CONFIG_SND_VERBOSE_PRINTK. | 348 | * when configured with CONFIG_SND_VERBOSE_PRINTK. |
| 361 | */ | 349 | */ |
| 362 | #define snd_printk(fmt, args...) \ | 350 | #define snd_printk(fmt, args...) \ |
| 363 | snd_verbose_printk(__FILE__, __LINE__, fmt ,##args) | 351 | __snd_printk(0, __FILE__, __LINE__, fmt, ##args) |
| 364 | #else | ||
| 365 | #define snd_printk(fmt, args...) \ | ||
| 366 | printk(fmt ,##args) | ||
| 367 | #endif | ||
| 368 | 352 | ||
| 369 | #ifdef CONFIG_SND_DEBUG | 353 | #ifdef CONFIG_SND_DEBUG |
| 370 | |||
| 371 | #ifdef CONFIG_SND_VERBOSE_PRINTK | ||
| 372 | /** | 354 | /** |
| 373 | * snd_printd - debug printk | 355 | * snd_printd - debug printk |
| 374 | * @fmt: format string | 356 | * @fmt: format string |
| @@ -377,11 +359,7 @@ void snd_verbose_printd(const char *file, int line, const char *format, ...) | |||
| 377 | * Ignored when CONFIG_SND_DEBUG is not set. | 359 | * Ignored when CONFIG_SND_DEBUG is not set. |
| 378 | */ | 360 | */ |
| 379 | #define snd_printd(fmt, args...) \ | 361 | #define snd_printd(fmt, args...) \ |
| 380 | snd_verbose_printd(__FILE__, __LINE__, fmt ,##args) | 362 | __snd_printk(1, __FILE__, __LINE__, fmt, ##args) |
| 381 | #else | ||
| 382 | #define snd_printd(fmt, args...) \ | ||
| 383 | printk(fmt ,##args) | ||
| 384 | #endif | ||
| 385 | 363 | ||
| 386 | /** | 364 | /** |
| 387 | * snd_BUG - give a BUG warning message and stack trace | 365 | * snd_BUG - give a BUG warning message and stack trace |
| @@ -428,9 +406,10 @@ static inline int __snd_bug_on(int cond) | |||
| 428 | * Works like snd_printk() for debugging purposes. | 406 | * Works like snd_printk() for debugging purposes. |
| 429 | * Ignored when CONFIG_SND_DEBUG_VERBOSE is not set. | 407 | * Ignored when CONFIG_SND_DEBUG_VERBOSE is not set. |
| 430 | */ | 408 | */ |
| 431 | #define snd_printdd(format, args...) snd_printk(format, ##args) | 409 | #define snd_printdd(format, args...) \ |
| 410 | __snd_printk(2, __FILE__, __LINE__, format, ##args) | ||
| 432 | #else | 411 | #else |
| 433 | #define snd_printdd(format, args...) /* nothing */ | 412 | #define snd_printdd(format, args...) do { } while (0) |
| 434 | #endif | 413 | #endif |
| 435 | 414 | ||
| 436 | 415 | ||
| @@ -438,12 +417,10 @@ static inline int __snd_bug_on(int cond) | |||
| 438 | 417 | ||
| 439 | /* for easier backward-porting */ | 418 | /* for easier backward-porting */ |
| 440 | #if defined(CONFIG_GAMEPORT) || defined(CONFIG_GAMEPORT_MODULE) | 419 | #if defined(CONFIG_GAMEPORT) || defined(CONFIG_GAMEPORT_MODULE) |
| 441 | #ifndef gameport_set_dev_parent | ||
| 442 | #define gameport_set_dev_parent(gp,xdev) ((gp)->dev.parent = (xdev)) | 420 | #define gameport_set_dev_parent(gp,xdev) ((gp)->dev.parent = (xdev)) |
| 443 | #define gameport_set_port_data(gp,r) ((gp)->port_data = (r)) | 421 | #define gameport_set_port_data(gp,r) ((gp)->port_data = (r)) |
| 444 | #define gameport_get_port_data(gp) (gp)->port_data | 422 | #define gameport_get_port_data(gp) (gp)->port_data |
| 445 | #endif | 423 | #endif |
| 446 | #endif | ||
| 447 | 424 | ||
| 448 | /* PCI quirk list helper */ | 425 | /* PCI quirk list helper */ |
| 449 | struct snd_pci_quirk { | 426 | struct snd_pci_quirk { |
diff --git a/include/sound/info.h b/include/sound/info.h index 7c2ee1a21b00..112e8949e1a7 100644 --- a/include/sound/info.h +++ b/include/sound/info.h | |||
| @@ -110,13 +110,13 @@ void snd_card_info_read_oss(struct snd_info_buffer *buffer); | |||
| 110 | static inline void snd_card_info_read_oss(struct snd_info_buffer *buffer) {} | 110 | static inline void snd_card_info_read_oss(struct snd_info_buffer *buffer) {} |
| 111 | #endif | 111 | #endif |
| 112 | 112 | ||
| 113 | int snd_iprintf(struct snd_info_buffer *buffer, char *fmt, ...) \ | 113 | int snd_iprintf(struct snd_info_buffer *buffer, const char *fmt, ...) \ |
| 114 | __attribute__ ((format (printf, 2, 3))); | 114 | __attribute__ ((format (printf, 2, 3))); |
| 115 | int snd_info_init(void); | 115 | int snd_info_init(void); |
| 116 | int snd_info_done(void); | 116 | int snd_info_done(void); |
| 117 | 117 | ||
| 118 | int snd_info_get_line(struct snd_info_buffer *buffer, char *line, int len); | 118 | int snd_info_get_line(struct snd_info_buffer *buffer, char *line, int len); |
| 119 | char *snd_info_get_str(char *dest, char *src, int len); | 119 | const char *snd_info_get_str(char *dest, const char *src, int len); |
| 120 | struct snd_info_entry *snd_info_create_module_entry(struct module *module, | 120 | struct snd_info_entry *snd_info_create_module_entry(struct module *module, |
| 121 | const char *name, | 121 | const char *name, |
| 122 | struct snd_info_entry *parent); | 122 | struct snd_info_entry *parent); |
diff --git a/include/sound/memalloc.h b/include/sound/memalloc.h index 7ccce94a5255..c42506212649 100644 --- a/include/sound/memalloc.h +++ b/include/sound/memalloc.h | |||
| @@ -47,7 +47,11 @@ struct snd_dma_device { | |||
| 47 | #define SNDRV_DMA_TYPE_UNKNOWN 0 /* not defined */ | 47 | #define SNDRV_DMA_TYPE_UNKNOWN 0 /* not defined */ |
| 48 | #define SNDRV_DMA_TYPE_CONTINUOUS 1 /* continuous no-DMA memory */ | 48 | #define SNDRV_DMA_TYPE_CONTINUOUS 1 /* continuous no-DMA memory */ |
| 49 | #define SNDRV_DMA_TYPE_DEV 2 /* generic device continuous */ | 49 | #define SNDRV_DMA_TYPE_DEV 2 /* generic device continuous */ |
| 50 | #ifdef CONFIG_SND_DMA_SGBUF | ||
| 50 | #define SNDRV_DMA_TYPE_DEV_SG 3 /* generic device SG-buffer */ | 51 | #define SNDRV_DMA_TYPE_DEV_SG 3 /* generic device SG-buffer */ |
| 52 | #else | ||
| 53 | #define SNDRV_DMA_TYPE_DEV_SG SNDRV_DMA_TYPE_DEV /* no SG-buf support */ | ||
| 54 | #endif | ||
| 51 | 55 | ||
| 52 | /* | 56 | /* |
| 53 | * info for buffer allocation | 57 | * info for buffer allocation |
| @@ -60,6 +64,7 @@ struct snd_dma_buffer { | |||
| 60 | void *private_data; /* private for allocator; don't touch */ | 64 | void *private_data; /* private for allocator; don't touch */ |
| 61 | }; | 65 | }; |
| 62 | 66 | ||
| 67 | #ifdef CONFIG_SND_DMA_SGBUF | ||
| 63 | /* | 68 | /* |
| 64 | * Scatter-Gather generic device pages | 69 | * Scatter-Gather generic device pages |
| 65 | */ | 70 | */ |
| @@ -107,6 +112,7 @@ static inline void *snd_sgbuf_get_ptr(struct snd_sg_buf *sgbuf, size_t offset) | |||
| 107 | { | 112 | { |
| 108 | return sgbuf->table[offset >> PAGE_SHIFT].buf + offset % PAGE_SIZE; | 113 | return sgbuf->table[offset >> PAGE_SHIFT].buf + offset % PAGE_SIZE; |
| 109 | } | 114 | } |
| 115 | #endif /* CONFIG_SND_DMA_SGBUF */ | ||
| 110 | 116 | ||
| 111 | /* allocate/release a buffer */ | 117 | /* allocate/release a buffer */ |
| 112 | int snd_dma_alloc_pages(int type, struct device *dev, size_t size, | 118 | int snd_dma_alloc_pages(int type, struct device *dev, size_t size, |
diff --git a/include/sound/pcm.h b/include/sound/pcm.h index 23893523dc8c..de6d981de5d6 100644 --- a/include/sound/pcm.h +++ b/include/sound/pcm.h | |||
| @@ -902,6 +902,7 @@ int snd_pcm_lib_preallocate_pages_for_all(struct snd_pcm *pcm, | |||
| 902 | int snd_pcm_lib_malloc_pages(struct snd_pcm_substream *substream, size_t size); | 902 | int snd_pcm_lib_malloc_pages(struct snd_pcm_substream *substream, size_t size); |
| 903 | int snd_pcm_lib_free_pages(struct snd_pcm_substream *substream); | 903 | int snd_pcm_lib_free_pages(struct snd_pcm_substream *substream); |
| 904 | 904 | ||
| 905 | #ifdef CONFIG_SND_DMA_SGBUF | ||
| 905 | /* | 906 | /* |
| 906 | * SG-buffer handling | 907 | * SG-buffer handling |
| 907 | */ | 908 | */ |
| @@ -927,6 +928,28 @@ struct page *snd_pcm_sgbuf_ops_page(struct snd_pcm_substream *substream, | |||
| 927 | unsigned int snd_pcm_sgbuf_get_chunk_size(struct snd_pcm_substream *substream, | 928 | unsigned int snd_pcm_sgbuf_get_chunk_size(struct snd_pcm_substream *substream, |
| 928 | unsigned int ofs, unsigned int size); | 929 | unsigned int ofs, unsigned int size); |
| 929 | 930 | ||
| 931 | #else /* !SND_DMA_SGBUF */ | ||
| 932 | /* | ||
| 933 | * fake using a continuous buffer | ||
| 934 | */ | ||
| 935 | static inline dma_addr_t | ||
| 936 | snd_pcm_sgbuf_get_addr(struct snd_pcm_substream *substream, unsigned int ofs) | ||
| 937 | { | ||
| 938 | return substream->runtime->dma_addr + ofs; | ||
| 939 | } | ||
| 940 | |||
| 941 | static inline void * | ||
| 942 | snd_pcm_sgbuf_get_ptr(struct snd_pcm_substream *substream, unsigned int ofs) | ||
| 943 | { | ||
| 944 | return substream->runtime->dma_area + ofs; | ||
| 945 | } | ||
| 946 | |||
| 947 | #define snd_pcm_sgbuf_ops_page NULL | ||
| 948 | |||
| 949 | #define snd_pcm_sgbuf_get_chunk_size(subs, ofs, size) (size) | ||
| 950 | |||
| 951 | #endif /* SND_DMA_SGBUF */ | ||
| 952 | |||
| 930 | /* handle mmap counter - PCM mmap callback should handle this counter properly */ | 953 | /* handle mmap counter - PCM mmap callback should handle this counter properly */ |
| 931 | static inline void snd_pcm_mmap_data_open(struct vm_area_struct *area) | 954 | static inline void snd_pcm_mmap_data_open(struct vm_area_struct *area) |
| 932 | { | 955 | { |
| @@ -965,4 +988,6 @@ static inline void snd_pcm_limit_isa_dma_size(int dma, size_t *max) | |||
| 965 | 988 | ||
| 966 | #define PCM_RUNTIME_CHECK(sub) snd_BUG_ON(!(sub) || !(sub)->runtime) | 989 | #define PCM_RUNTIME_CHECK(sub) snd_BUG_ON(!(sub) || !(sub)->runtime) |
| 967 | 990 | ||
| 991 | const char *snd_pcm_format_name(snd_pcm_format_t format); | ||
| 992 | |||
| 968 | #endif /* __SOUND_PCM_H */ | 993 | #endif /* __SOUND_PCM_H */ |
diff --git a/include/sound/sh_fsi.h b/include/sound/sh_fsi.h new file mode 100644 index 000000000000..c0227361a876 --- /dev/null +++ b/include/sound/sh_fsi.h | |||
| @@ -0,0 +1,83 @@ | |||
| 1 | #ifndef __SOUND_FSI_H | ||
| 2 | #define __SOUND_FSI_H | ||
| 3 | |||
| 4 | /* | ||
| 5 | * Fifo-attached Serial Interface (FSI) support for SH7724 | ||
| 6 | * | ||
| 7 | * Copyright (C) 2009 Renesas Solutions Corp. | ||
| 8 | * Kuninori Morimoto <morimoto.kuninori@renesas.com> | ||
| 9 | * | ||
| 10 | * This program is free software; you can redistribute it and/or modify | ||
| 11 | * it under the terms of the GNU General Public License version 2 as | ||
| 12 | * published by the Free Software Foundation. | ||
| 13 | */ | ||
| 14 | |||
| 15 | /* flags format | ||
| 16 | |||
| 17 | * 0xABCDEEFF | ||
| 18 | * | ||
| 19 | * A: channel size for TDM (input) | ||
| 20 | * B: channel size for TDM (ooutput) | ||
| 21 | * C: inversion | ||
| 22 | * D: mode | ||
| 23 | * E: input format | ||
| 24 | * F: output format | ||
| 25 | */ | ||
| 26 | |||
| 27 | #include <linux/clk.h> | ||
| 28 | #include <sound/soc.h> | ||
| 29 | |||
| 30 | /* TDM channel */ | ||
| 31 | #define SH_FSI_SET_CH_I(x) ((x & 0xF) << 28) | ||
| 32 | #define SH_FSI_SET_CH_O(x) ((x & 0xF) << 24) | ||
| 33 | |||
| 34 | #define SH_FSI_CH_IMASK 0xF0000000 | ||
| 35 | #define SH_FSI_CH_OMASK 0x0F000000 | ||
| 36 | #define SH_FSI_GET_CH_I(x) ((x & SH_FSI_CH_IMASK) >> 28) | ||
| 37 | #define SH_FSI_GET_CH_O(x) ((x & SH_FSI_CH_OMASK) >> 24) | ||
| 38 | |||
| 39 | /* clock inversion */ | ||
| 40 | #define SH_FSI_INVERSION_MASK 0x00F00000 | ||
| 41 | #define SH_FSI_LRM_INV (1 << 20) | ||
| 42 | #define SH_FSI_BRM_INV (1 << 21) | ||
| 43 | #define SH_FSI_LRS_INV (1 << 22) | ||
| 44 | #define SH_FSI_BRS_INV (1 << 23) | ||
| 45 | |||
| 46 | /* mode */ | ||
| 47 | #define SH_FSI_MODE_MASK 0x000F0000 | ||
| 48 | #define SH_FSI_IN_SLAVE_MODE (1 << 16) /* default master mode */ | ||
| 49 | #define SH_FSI_OUT_SLAVE_MODE (1 << 17) /* default master mode */ | ||
| 50 | |||
| 51 | /* DI format */ | ||
| 52 | #define SH_FSI_FMT_MASK 0x000000FF | ||
| 53 | #define SH_FSI_IFMT(x) (((SH_FSI_FMT_ ## x) & SH_FSI_FMT_MASK) << 8) | ||
| 54 | #define SH_FSI_OFMT(x) (((SH_FSI_FMT_ ## x) & SH_FSI_FMT_MASK) << 0) | ||
| 55 | #define SH_FSI_GET_IFMT(x) ((x >> 8) & SH_FSI_FMT_MASK) | ||
| 56 | #define SH_FSI_GET_OFMT(x) ((x >> 0) & SH_FSI_FMT_MASK) | ||
| 57 | |||
| 58 | #define SH_FSI_FMT_MONO (1 << 0) | ||
| 59 | #define SH_FSI_FMT_MONO_DELAY (1 << 1) | ||
| 60 | #define SH_FSI_FMT_PCM (1 << 2) | ||
| 61 | #define SH_FSI_FMT_I2S (1 << 3) | ||
| 62 | #define SH_FSI_FMT_TDM (1 << 4) | ||
| 63 | #define SH_FSI_FMT_TDM_DELAY (1 << 5) | ||
| 64 | |||
| 65 | #define SH_FSI_IFMT_TDM_CH(x) \ | ||
| 66 | (SH_FSI_IFMT(TDM) | SH_FSI_SET_CH_I(x)) | ||
| 67 | #define SH_FSI_IFMT_TDM_DELAY_CH(x) \ | ||
| 68 | (SH_FSI_IFMT(TDM_DELAY) | SH_FSI_SET_CH_I(x)) | ||
| 69 | |||
| 70 | #define SH_FSI_OFMT_TDM_CH(x) \ | ||
| 71 | (SH_FSI_OFMT(TDM) | SH_FSI_SET_CH_O(x)) | ||
| 72 | #define SH_FSI_OFMT_TDM_DELAY_CH(x) \ | ||
| 73 | (SH_FSI_OFMT(TDM_DELAY) | SH_FSI_SET_CH_O(x)) | ||
| 74 | |||
| 75 | struct sh_fsi_platform_info { | ||
| 76 | unsigned long porta_flags; | ||
| 77 | unsigned long portb_flags; | ||
| 78 | }; | ||
| 79 | |||
| 80 | extern struct snd_soc_dai fsi_soc_dai[2]; | ||
| 81 | extern struct snd_soc_platform fsi_soc_platform; | ||
| 82 | |||
| 83 | #endif /* __SOUND_FSI_H */ | ||
diff --git a/include/sound/soc-dai.h b/include/sound/soc-dai.h index 352d7eee9b6d..97ca9af414dc 100644 --- a/include/sound/soc-dai.h +++ b/include/sound/soc-dai.h | |||
| @@ -27,8 +27,8 @@ struct snd_pcm_substream; | |||
| 27 | #define SND_SOC_DAIFMT_I2S 0 /* I2S mode */ | 27 | #define SND_SOC_DAIFMT_I2S 0 /* I2S mode */ |
| 28 | #define SND_SOC_DAIFMT_RIGHT_J 1 /* Right Justified mode */ | 28 | #define SND_SOC_DAIFMT_RIGHT_J 1 /* Right Justified mode */ |
| 29 | #define SND_SOC_DAIFMT_LEFT_J 2 /* Left Justified mode */ | 29 | #define SND_SOC_DAIFMT_LEFT_J 2 /* Left Justified mode */ |
| 30 | #define SND_SOC_DAIFMT_DSP_A 3 /* L data msb after FRM LRC */ | 30 | #define SND_SOC_DAIFMT_DSP_A 3 /* L data MSB after FRM LRC */ |
| 31 | #define SND_SOC_DAIFMT_DSP_B 4 /* L data msb during FRM LRC */ | 31 | #define SND_SOC_DAIFMT_DSP_B 4 /* L data MSB during FRM LRC */ |
| 32 | #define SND_SOC_DAIFMT_AC97 5 /* AC97 */ | 32 | #define SND_SOC_DAIFMT_AC97 5 /* AC97 */ |
| 33 | 33 | ||
| 34 | /* left and right justified also known as MSB and LSB respectively */ | 34 | /* left and right justified also known as MSB and LSB respectively */ |
| @@ -38,7 +38,7 @@ struct snd_pcm_substream; | |||
| 38 | /* | 38 | /* |
| 39 | * DAI Clock gating. | 39 | * DAI Clock gating. |
| 40 | * | 40 | * |
| 41 | * DAI bit clocks can be be gated (disabled) when not the DAI is not | 41 | * DAI bit clocks can be be gated (disabled) when the DAI is not |
| 42 | * sending or receiving PCM data in a frame. This can be used to save power. | 42 | * sending or receiving PCM data in a frame. This can be used to save power. |
| 43 | */ | 43 | */ |
| 44 | #define SND_SOC_DAIFMT_CONT (0 << 4) /* continuous clock */ | 44 | #define SND_SOC_DAIFMT_CONT (0 << 4) /* continuous clock */ |
| @@ -51,21 +51,21 @@ struct snd_pcm_substream; | |||
| 51 | * format. | 51 | * format. |
| 52 | */ | 52 | */ |
| 53 | #define SND_SOC_DAIFMT_NB_NF (0 << 8) /* normal bit clock + frame */ | 53 | #define SND_SOC_DAIFMT_NB_NF (0 << 8) /* normal bit clock + frame */ |
| 54 | #define SND_SOC_DAIFMT_NB_IF (1 << 8) /* normal bclk + inv frm */ | 54 | #define SND_SOC_DAIFMT_NB_IF (1 << 8) /* normal BCLK + inv FRM */ |
| 55 | #define SND_SOC_DAIFMT_IB_NF (2 << 8) /* invert bclk + nor frm */ | 55 | #define SND_SOC_DAIFMT_IB_NF (2 << 8) /* invert BCLK + nor FRM */ |
| 56 | #define SND_SOC_DAIFMT_IB_IF (3 << 8) /* invert bclk + frm */ | 56 | #define SND_SOC_DAIFMT_IB_IF (3 << 8) /* invert BCLK + FRM */ |
| 57 | 57 | ||
| 58 | /* | 58 | /* |
| 59 | * DAI hardware clock masters. | 59 | * DAI hardware clock masters. |
| 60 | * | 60 | * |
| 61 | * This is wrt the codec, the inverse is true for the interface | 61 | * This is wrt the codec, the inverse is true for the interface |
| 62 | * i.e. if the codec is clk and frm master then the interface is | 62 | * i.e. if the codec is clk and FRM master then the interface is |
| 63 | * clk and frame slave. | 63 | * clk and frame slave. |
| 64 | */ | 64 | */ |
| 65 | #define SND_SOC_DAIFMT_CBM_CFM (0 << 12) /* codec clk & frm master */ | 65 | #define SND_SOC_DAIFMT_CBM_CFM (0 << 12) /* codec clk & FRM master */ |
| 66 | #define SND_SOC_DAIFMT_CBS_CFM (1 << 12) /* codec clk slave & frm master */ | 66 | #define SND_SOC_DAIFMT_CBS_CFM (1 << 12) /* codec clk slave & FRM master */ |
| 67 | #define SND_SOC_DAIFMT_CBM_CFS (2 << 12) /* codec clk master & frame slave */ | 67 | #define SND_SOC_DAIFMT_CBM_CFS (2 << 12) /* codec clk master & frame slave */ |
| 68 | #define SND_SOC_DAIFMT_CBS_CFS (3 << 12) /* codec clk & frm slave */ | 68 | #define SND_SOC_DAIFMT_CBS_CFS (3 << 12) /* codec clk & FRM slave */ |
| 69 | 69 | ||
| 70 | #define SND_SOC_DAIFMT_FORMAT_MASK 0x000f | 70 | #define SND_SOC_DAIFMT_FORMAT_MASK 0x000f |
| 71 | #define SND_SOC_DAIFMT_CLOCK_MASK 0x00f0 | 71 | #define SND_SOC_DAIFMT_CLOCK_MASK 0x00f0 |
| @@ -78,7 +78,13 @@ struct snd_pcm_substream; | |||
| 78 | #define SND_SOC_CLOCK_IN 0 | 78 | #define SND_SOC_CLOCK_IN 0 |
| 79 | #define SND_SOC_CLOCK_OUT 1 | 79 | #define SND_SOC_CLOCK_OUT 1 |
| 80 | 80 | ||
| 81 | #define SND_SOC_STD_AC97_FMTS (SNDRV_PCM_FMTBIT_S16_LE |\ | 81 | #define SND_SOC_STD_AC97_FMTS (SNDRV_PCM_FMTBIT_S8 |\ |
| 82 | SNDRV_PCM_FMTBIT_S16_LE |\ | ||
| 83 | SNDRV_PCM_FMTBIT_S16_BE |\ | ||
| 84 | SNDRV_PCM_FMTBIT_S20_3LE |\ | ||
| 85 | SNDRV_PCM_FMTBIT_S20_3BE |\ | ||
| 86 | SNDRV_PCM_FMTBIT_S24_3LE |\ | ||
| 87 | SNDRV_PCM_FMTBIT_S24_3BE |\ | ||
| 82 | SNDRV_PCM_FMTBIT_S32_LE |\ | 88 | SNDRV_PCM_FMTBIT_S32_LE |\ |
| 83 | SNDRV_PCM_FMTBIT_S32_BE) | 89 | SNDRV_PCM_FMTBIT_S32_BE) |
| 84 | 90 | ||
| @@ -106,7 +112,7 @@ int snd_soc_dai_set_pll(struct snd_soc_dai *dai, | |||
| 106 | int snd_soc_dai_set_fmt(struct snd_soc_dai *dai, unsigned int fmt); | 112 | int snd_soc_dai_set_fmt(struct snd_soc_dai *dai, unsigned int fmt); |
| 107 | 113 | ||
| 108 | int snd_soc_dai_set_tdm_slot(struct snd_soc_dai *dai, | 114 | int snd_soc_dai_set_tdm_slot(struct snd_soc_dai *dai, |
| 109 | unsigned int mask, int slots); | 115 | unsigned int tx_mask, unsigned int rx_mask, int slots, int slot_width); |
| 110 | 116 | ||
| 111 | int snd_soc_dai_set_tristate(struct snd_soc_dai *dai, int tristate); | 117 | int snd_soc_dai_set_tristate(struct snd_soc_dai *dai, int tristate); |
| 112 | 118 | ||
| @@ -116,12 +122,12 @@ int snd_soc_dai_digital_mute(struct snd_soc_dai *dai, int mute); | |||
| 116 | /* | 122 | /* |
| 117 | * Digital Audio Interface. | 123 | * Digital Audio Interface. |
| 118 | * | 124 | * |
| 119 | * Describes the Digital Audio Interface in terms of it's ALSA, DAI and AC97 | 125 | * Describes the Digital Audio Interface in terms of its ALSA, DAI and AC97 |
| 120 | * operations an capabilities. Codec and platfom drivers will register a this | 126 | * operations and capabilities. Codec and platform drivers will register this |
| 121 | * structure for every DAI they have. | 127 | * structure for every DAI they have. |
| 122 | * | 128 | * |
| 123 | * This structure covers the clocking, formating and ALSA operations for each | 129 | * This structure covers the clocking, formating and ALSA operations for each |
| 124 | * interface a | 130 | * interface. |
| 125 | */ | 131 | */ |
| 126 | struct snd_soc_dai_ops { | 132 | struct snd_soc_dai_ops { |
| 127 | /* | 133 | /* |
| @@ -140,7 +146,8 @@ struct snd_soc_dai_ops { | |||
| 140 | */ | 146 | */ |
| 141 | int (*set_fmt)(struct snd_soc_dai *dai, unsigned int fmt); | 147 | int (*set_fmt)(struct snd_soc_dai *dai, unsigned int fmt); |
| 142 | int (*set_tdm_slot)(struct snd_soc_dai *dai, | 148 | int (*set_tdm_slot)(struct snd_soc_dai *dai, |
| 143 | unsigned int mask, int slots); | 149 | unsigned int tx_mask, unsigned int rx_mask, |
| 150 | int slots, int slot_width); | ||
| 144 | int (*set_tristate)(struct snd_soc_dai *dai, int tristate); | 151 | int (*set_tristate)(struct snd_soc_dai *dai, int tristate); |
| 145 | 152 | ||
| 146 | /* | 153 | /* |
| @@ -179,6 +186,7 @@ struct snd_soc_dai { | |||
| 179 | int ac97_control; | 186 | int ac97_control; |
| 180 | 187 | ||
| 181 | struct device *dev; | 188 | struct device *dev; |
| 189 | void *ac97_pdata; /* platform_data for the ac97 codec */ | ||
| 182 | 190 | ||
| 183 | /* DAI callbacks */ | 191 | /* DAI callbacks */ |
| 184 | int (*probe)(struct platform_device *pdev, | 192 | int (*probe)(struct platform_device *pdev, |
diff --git a/include/sound/soc-dapm.h b/include/sound/soc-dapm.h index ec8a45f9a069..c1410e3191e3 100644 --- a/include/sound/soc-dapm.h +++ b/include/sound/soc-dapm.h | |||
| @@ -137,6 +137,12 @@ | |||
| 137 | .event_flags = SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_POST_PMD} | 137 | .event_flags = SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_POST_PMD} |
| 138 | 138 | ||
| 139 | /* stream domain */ | 139 | /* stream domain */ |
| 140 | #define SND_SOC_DAPM_AIF_IN(wname, stname, wslot, wreg, wshift, winvert) \ | ||
| 141 | { .id = snd_soc_dapm_aif_in, .name = wname, .sname = stname, \ | ||
| 142 | .reg = wreg, .shift = wshift, .invert = winvert } | ||
| 143 | #define SND_SOC_DAPM_AIF_OUT(wname, stname, wslot, wreg, wshift, winvert) \ | ||
| 144 | { .id = snd_soc_dapm_aif_out, .name = wname, .sname = stname, \ | ||
| 145 | .reg = wreg, .shift = wshift, .invert = winvert } | ||
| 140 | #define SND_SOC_DAPM_DAC(wname, stname, wreg, wshift, winvert) \ | 146 | #define SND_SOC_DAPM_DAC(wname, stname, wreg, wshift, winvert) \ |
| 141 | { .id = snd_soc_dapm_dac, .name = wname, .sname = stname, .reg = wreg, \ | 147 | { .id = snd_soc_dapm_dac, .name = wname, .sname = stname, .reg = wreg, \ |
| 142 | .shift = wshift, .invert = winvert} | 148 | .shift = wshift, .invert = winvert} |
| @@ -279,9 +285,11 @@ int snd_soc_dapm_add_routes(struct snd_soc_codec *codec, | |||
| 279 | /* dapm events */ | 285 | /* dapm events */ |
| 280 | int snd_soc_dapm_stream_event(struct snd_soc_codec *codec, char *stream, | 286 | int snd_soc_dapm_stream_event(struct snd_soc_codec *codec, char *stream, |
| 281 | int event); | 287 | int event); |
| 288 | void snd_soc_dapm_shutdown(struct snd_soc_device *socdev); | ||
| 282 | 289 | ||
| 283 | /* dapm sys fs - used by the core */ | 290 | /* dapm sys fs - used by the core */ |
| 284 | int snd_soc_dapm_sys_add(struct device *dev); | 291 | int snd_soc_dapm_sys_add(struct device *dev); |
| 292 | void snd_soc_dapm_debugfs_init(struct snd_soc_codec *codec); | ||
| 285 | 293 | ||
| 286 | /* dapm audio pin control and status */ | 294 | /* dapm audio pin control and status */ |
| 287 | int snd_soc_dapm_enable_pin(struct snd_soc_codec *codec, const char *pin); | 295 | int snd_soc_dapm_enable_pin(struct snd_soc_codec *codec, const char *pin); |
| @@ -311,6 +319,8 @@ enum snd_soc_dapm_type { | |||
| 311 | snd_soc_dapm_pre, /* machine specific pre widget - exec first */ | 319 | snd_soc_dapm_pre, /* machine specific pre widget - exec first */ |
| 312 | snd_soc_dapm_post, /* machine specific post widget - exec last */ | 320 | snd_soc_dapm_post, /* machine specific post widget - exec last */ |
| 313 | snd_soc_dapm_supply, /* power/clock supply */ | 321 | snd_soc_dapm_supply, /* power/clock supply */ |
| 322 | snd_soc_dapm_aif_in, /* audio interface input */ | ||
| 323 | snd_soc_dapm_aif_out, /* audio interface output */ | ||
| 314 | }; | 324 | }; |
| 315 | 325 | ||
| 316 | /* | 326 | /* |
diff --git a/include/sound/soc.h b/include/sound/soc.h index cf6111d72b17..475cb7ed6bec 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h | |||
| @@ -135,6 +135,28 @@ | |||
| 135 | .info = snd_soc_info_volsw, \ | 135 | .info = snd_soc_info_volsw, \ |
| 136 | .get = xhandler_get, .put = xhandler_put, \ | 136 | .get = xhandler_get, .put = xhandler_put, \ |
| 137 | .private_value = SOC_SINGLE_VALUE(xreg, xshift, xmax, xinvert) } | 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} } | ||
| 138 | #define SOC_SINGLE_BOOL_EXT(xname, xdata, xhandler_get, xhandler_put) \ | 160 | #define SOC_SINGLE_BOOL_EXT(xname, xdata, xhandler_get, xhandler_put) \ |
| 139 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ | 161 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ |
| 140 | .info = snd_soc_info_bool_ext, \ | 162 | .info = snd_soc_info_bool_ext, \ |
| @@ -183,14 +205,28 @@ struct snd_soc_jack_gpio; | |||
| 183 | #endif | 205 | #endif |
| 184 | 206 | ||
| 185 | typedef int (*hw_write_t)(void *,const char* ,int); | 207 | typedef int (*hw_write_t)(void *,const char* ,int); |
| 186 | typedef int (*hw_read_t)(void *,char* ,int); | ||
| 187 | 208 | ||
| 188 | extern struct snd_ac97_bus_ops soc_ac97_ops; | 209 | extern struct snd_ac97_bus_ops soc_ac97_ops; |
| 189 | 210 | ||
| 211 | enum snd_soc_control_type { | ||
| 212 | SND_SOC_CUSTOM, | ||
| 213 | SND_SOC_I2C, | ||
| 214 | SND_SOC_SPI, | ||
| 215 | }; | ||
| 216 | |||
| 190 | int snd_soc_register_platform(struct snd_soc_platform *platform); | 217 | int snd_soc_register_platform(struct snd_soc_platform *platform); |
| 191 | void snd_soc_unregister_platform(struct snd_soc_platform *platform); | 218 | void snd_soc_unregister_platform(struct snd_soc_platform *platform); |
| 192 | int snd_soc_register_codec(struct snd_soc_codec *codec); | 219 | int snd_soc_register_codec(struct snd_soc_codec *codec); |
| 193 | void snd_soc_unregister_codec(struct snd_soc_codec *codec); | 220 | void snd_soc_unregister_codec(struct snd_soc_codec *codec); |
| 221 | int snd_soc_codec_volatile_register(struct snd_soc_codec *codec, int reg); | ||
| 222 | int snd_soc_codec_set_cache_io(struct snd_soc_codec *codec, | ||
| 223 | int addr_bits, int data_bits, | ||
| 224 | enum snd_soc_control_type control); | ||
| 225 | |||
| 226 | #ifdef CONFIG_PM | ||
| 227 | int snd_soc_suspend_device(struct device *dev); | ||
| 228 | int snd_soc_resume_device(struct device *dev); | ||
| 229 | #endif | ||
| 194 | 230 | ||
| 195 | /* pcm <-> DAI connect */ | 231 | /* pcm <-> DAI connect */ |
| 196 | void snd_soc_free_pcms(struct snd_soc_device *socdev); | 232 | void snd_soc_free_pcms(struct snd_soc_device *socdev); |
| @@ -216,9 +252,9 @@ void snd_soc_jack_free_gpios(struct snd_soc_jack *jack, int count, | |||
| 216 | 252 | ||
| 217 | /* codec register bit access */ | 253 | /* codec register bit access */ |
| 218 | int snd_soc_update_bits(struct snd_soc_codec *codec, unsigned short reg, | 254 | int snd_soc_update_bits(struct snd_soc_codec *codec, unsigned short reg, |
| 219 | unsigned short mask, unsigned short value); | 255 | unsigned int mask, unsigned int value); |
| 220 | int snd_soc_test_bits(struct snd_soc_codec *codec, unsigned short reg, | 256 | int snd_soc_test_bits(struct snd_soc_codec *codec, unsigned short reg, |
| 221 | unsigned short mask, unsigned short value); | 257 | unsigned int mask, unsigned int value); |
| 222 | 258 | ||
| 223 | int snd_soc_new_ac97_codec(struct snd_soc_codec *codec, | 259 | int snd_soc_new_ac97_codec(struct snd_soc_codec *codec, |
| 224 | struct snd_ac97_bus_ops *ops, int num); | 260 | struct snd_ac97_bus_ops *ops, int num); |
| @@ -356,8 +392,10 @@ struct snd_soc_codec { | |||
| 356 | int (*write)(struct snd_soc_codec *, unsigned int, unsigned int); | 392 | int (*write)(struct snd_soc_codec *, unsigned int, unsigned int); |
| 357 | int (*display_register)(struct snd_soc_codec *, char *, | 393 | int (*display_register)(struct snd_soc_codec *, char *, |
| 358 | size_t, unsigned int); | 394 | size_t, unsigned int); |
| 395 | int (*volatile_register)(unsigned int); | ||
| 396 | int (*readable_register)(unsigned int); | ||
| 359 | hw_write_t hw_write; | 397 | hw_write_t hw_write; |
| 360 | hw_read_t hw_read; | 398 | unsigned int (*hw_read)(struct snd_soc_codec *, unsigned int); |
| 361 | void *reg_cache; | 399 | void *reg_cache; |
| 362 | short reg_cache_size; | 400 | short reg_cache_size; |
| 363 | short reg_cache_step; | 401 | short reg_cache_step; |
| @@ -369,8 +407,6 @@ struct snd_soc_codec { | |||
| 369 | enum snd_soc_bias_level bias_level; | 407 | enum snd_soc_bias_level bias_level; |
| 370 | enum snd_soc_bias_level suspend_bias_level; | 408 | enum snd_soc_bias_level suspend_bias_level; |
| 371 | struct delayed_work delayed_work; | 409 | struct delayed_work delayed_work; |
| 372 | struct list_head up_list; | ||
| 373 | struct list_head down_list; | ||
| 374 | 410 | ||
| 375 | /* codec DAI's */ | 411 | /* codec DAI's */ |
| 376 | struct snd_soc_dai *dai; | 412 | struct snd_soc_dai *dai; |
| @@ -379,6 +415,7 @@ struct snd_soc_codec { | |||
| 379 | #ifdef CONFIG_DEBUG_FS | 415 | #ifdef CONFIG_DEBUG_FS |
| 380 | struct dentry *debugfs_reg; | 416 | struct dentry *debugfs_reg; |
| 381 | struct dentry *debugfs_pop_time; | 417 | struct dentry *debugfs_pop_time; |
| 418 | struct dentry *debugfs_dapm; | ||
| 382 | #endif | 419 | #endif |
| 383 | }; | 420 | }; |
| 384 | 421 | ||
diff --git a/include/sound/tlv.h b/include/sound/tlv.h index d136ea2181ed..9fd5b19ccf5c 100644 --- a/include/sound/tlv.h +++ b/include/sound/tlv.h | |||
| @@ -35,6 +35,8 @@ | |||
| 35 | #define SNDRV_CTL_TLVT_DB_SCALE 1 /* dB scale */ | 35 | #define SNDRV_CTL_TLVT_DB_SCALE 1 /* dB scale */ |
| 36 | #define SNDRV_CTL_TLVT_DB_LINEAR 2 /* linear volume */ | 36 | #define SNDRV_CTL_TLVT_DB_LINEAR 2 /* linear volume */ |
| 37 | #define SNDRV_CTL_TLVT_DB_RANGE 3 /* dB range container */ | 37 | #define SNDRV_CTL_TLVT_DB_RANGE 3 /* dB range container */ |
| 38 | #define SNDRV_CTL_TLVT_DB_MINMAX 4 /* dB scale with min/max */ | ||
| 39 | #define SNDRV_CTL_TLVT_DB_MINMAX_MUTE 5 /* dB scale with min/max with mute */ | ||
| 38 | 40 | ||
| 39 | #define TLV_DB_SCALE_ITEM(min, step, mute) \ | 41 | #define TLV_DB_SCALE_ITEM(min, step, mute) \ |
| 40 | SNDRV_CTL_TLVT_DB_SCALE, 2 * sizeof(unsigned int), \ | 42 | SNDRV_CTL_TLVT_DB_SCALE, 2 * sizeof(unsigned int), \ |
| @@ -42,6 +44,18 @@ | |||
| 42 | #define DECLARE_TLV_DB_SCALE(name, min, step, mute) \ | 44 | #define DECLARE_TLV_DB_SCALE(name, min, step, mute) \ |
| 43 | unsigned int name[] = { TLV_DB_SCALE_ITEM(min, step, mute) } | 45 | unsigned int name[] = { TLV_DB_SCALE_ITEM(min, step, mute) } |
| 44 | 46 | ||
| 47 | /* dB scale specified with min/max values instead of step */ | ||
| 48 | #define TLV_DB_MINMAX_ITEM(min_dB, max_dB) \ | ||
| 49 | SNDRV_CTL_TLVT_DB_MINMAX, 2 * sizeof(unsigned int), \ | ||
| 50 | (min_dB), (max_dB) | ||
| 51 | #define TLV_DB_MINMAX_MUTE_ITEM(min_dB, max_dB) \ | ||
| 52 | SNDRV_CTL_TLVT_DB_MINMAX_MUTE, 2 * sizeof(unsigned int), \ | ||
| 53 | (min_dB), (max_dB) | ||
| 54 | #define DECLARE_TLV_DB_MINMAX(name, min_dB, max_dB) \ | ||
| 55 | unsigned int name[] = { TLV_DB_MINMAX_ITEM(min_dB, max_dB) } | ||
| 56 | #define DECLARE_TLV_DB_MINMAX_MUTE(name, min_dB, max_dB) \ | ||
| 57 | unsigned int name[] = { TLV_DB_MINMAX_MUTE_ITEM(min_dB, max_dB) } | ||
| 58 | |||
| 45 | /* linear volume between min_dB and max_dB (.01dB unit) */ | 59 | /* linear volume between min_dB and max_dB (.01dB unit) */ |
| 46 | #define TLV_DB_LINEAR_ITEM(min_dB, max_dB) \ | 60 | #define TLV_DB_LINEAR_ITEM(min_dB, max_dB) \ |
| 47 | SNDRV_CTL_TLVT_DB_LINEAR, 2 * sizeof(unsigned int), \ | 61 | SNDRV_CTL_TLVT_DB_LINEAR, 2 * sizeof(unsigned int), \ |
diff --git a/include/sound/uda1380.h b/include/sound/uda1380.h new file mode 100644 index 000000000000..381319c7000c --- /dev/null +++ b/include/sound/uda1380.h | |||
| @@ -0,0 +1,22 @@ | |||
| 1 | /* | ||
| 2 | * UDA1380 ALSA SoC Codec driver | ||
| 3 | * | ||
| 4 | * Copyright 2009 Philipp Zabel | ||
| 5 | * | ||
| 6 | * This program is free software; you can redistribute it and/or modify | ||
| 7 | * it under the terms of the GNU General Public License version 2 as | ||
| 8 | * published by the Free Software Foundation. | ||
| 9 | */ | ||
| 10 | |||
| 11 | #ifndef __UDA1380_H | ||
| 12 | #define __UDA1380_H | ||
| 13 | |||
| 14 | struct uda1380_platform_data { | ||
| 15 | int gpio_power; | ||
| 16 | int gpio_reset; | ||
| 17 | int dac_clk; | ||
| 18 | #define UDA1380_DAC_CLK_SYSCLK 0 | ||
| 19 | #define UDA1380_DAC_CLK_WSPLL 1 | ||
| 20 | }; | ||
| 21 | |||
| 22 | #endif /* __UDA1380_H */ | ||
diff --git a/include/sound/version.h b/include/sound/version.h index 456f1359e1c0..22939142dd23 100644 --- a/include/sound/version.h +++ b/include/sound/version.h | |||
| @@ -1,3 +1,3 @@ | |||
| 1 | /* include/version.h */ | 1 | /* include/version.h */ |
| 2 | #define CONFIG_SND_VERSION "1.0.20" | 2 | #define CONFIG_SND_VERSION "1.0.21" |
| 3 | #define CONFIG_SND_DATE "" | 3 | #define CONFIG_SND_DATE "" |
diff --git a/include/sound/wm8993.h b/include/sound/wm8993.h new file mode 100644 index 000000000000..9c661f2f8cda --- /dev/null +++ b/include/sound/wm8993.h | |||
| @@ -0,0 +1,44 @@ | |||
| 1 | /* | ||
| 2 | * linux/sound/wm8993.h -- Platform data for WM8993 | ||
| 3 | * | ||
| 4 | * Copyright 2009 Wolfson Microelectronics. PLC. | ||
| 5 | * | ||
| 6 | * This program is free software; you can redistribute it and/or modify | ||
| 7 | * it under the terms of the GNU General Public License version 2 as | ||
| 8 | * published by the Free Software Foundation. | ||
| 9 | */ | ||
| 10 | |||
| 11 | #ifndef __LINUX_SND_WM8993_H | ||
| 12 | #define __LINUX_SND_WM8993_H | ||
| 13 | |||
| 14 | /* Note that EQ1 only contains the enable/disable bit so will be | ||
| 15 | ignored but is included for simplicity. | ||
| 16 | */ | ||
| 17 | struct wm8993_retune_mobile_setting { | ||
| 18 | const char *name; | ||
| 19 | unsigned int rate; | ||
| 20 | u16 config[24]; | ||
| 21 | }; | ||
| 22 | |||
| 23 | struct wm8993_platform_data { | ||
| 24 | struct wm8993_retune_mobile_setting *retune_configs; | ||
| 25 | int num_retune_configs; | ||
| 26 | |||
| 27 | /* LINEOUT can be differential or single ended */ | ||
| 28 | unsigned int lineout1_diff:1; | ||
| 29 | unsigned int lineout2_diff:1; | ||
| 30 | |||
| 31 | /* Common mode feedback */ | ||
| 32 | unsigned int lineout1fb:1; | ||
| 33 | unsigned int lineout2fb:1; | ||
| 34 | |||
| 35 | /* Microphone biases: 0=0.9*AVDD1 1=0.65*AVVD1 */ | ||
| 36 | unsigned int micbias1_lvl:1; | ||
| 37 | unsigned int micbias2_lvl:1; | ||
| 38 | |||
| 39 | /* Jack detect threashold levels, see datasheet for values */ | ||
| 40 | unsigned int jd_scthr:2; | ||
| 41 | unsigned int jd_thr:2; | ||
| 42 | }; | ||
| 43 | |||
| 44 | #endif | ||
diff --git a/include/sound/ymfpci.h b/include/sound/ymfpci.h index 05ead6698434..444cd6ba0ba7 100644 --- a/include/sound/ymfpci.h +++ b/include/sound/ymfpci.h | |||
| @@ -331,6 +331,7 @@ struct snd_ymfpci { | |||
| 331 | struct snd_ac97 *ac97; | 331 | struct snd_ac97 *ac97; |
| 332 | struct snd_rawmidi *rawmidi; | 332 | struct snd_rawmidi *rawmidi; |
| 333 | struct snd_timer *timer; | 333 | struct snd_timer *timer; |
| 334 | unsigned int timer_ticks; | ||
| 334 | 335 | ||
| 335 | struct pci_dev *pci; | 336 | struct pci_dev *pci; |
| 336 | struct snd_card *card; | 337 | struct snd_card *card; |
