Ignore:
Timestamp:
Oct 8, 2009, 10:35:00 AM (16 years ago)
Author:
Paul Smedley
Message:

Update ALSA kernel to 1.0.21 level

Location:
GPL/trunk/alsa-kernel/include/sound
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • GPL/trunk/alsa-kernel/include/sound/ac97_codec.h

    r402 r464  
    3232#include "control.h"
    3333#include "info.h"
     34
     35/* maximum number of devices on the AC97 bus */
     36#define AC97_BUS_MAX_DEVICES    4
    3437
    3538/*
     
    650653extern struct bus_type ac97_bus_type;
    651654
     655/* AC97 platform_data adding function */
     656static inline void snd_ac97_dev_add_pdata(struct snd_ac97 *ac97, void *data)
     657{
     658        ac97->dev.platform_data = data;
     659}
     660
    652661#endif /* __SOUND_AC97_CODEC_H */
  • GPL/trunk/alsa-kernel/include/sound/asound.h

    r426 r464  
    162162 *****************************************************************************/
    163163
    164 #define SNDRV_PCM_VERSION               SNDRV_PROTOCOL_VERSION(2, 0, 9)
     164#define SNDRV_PCM_VERSION               SNDRV_PROTOCOL_VERSION(2, 0, 10)
    165165
    166166typedef unsigned long snd_pcm_uframes_t;
     
    279279#define SNDRV_PCM_INFO_JOINT_DUPLEX     0x00200000      /* playback and capture stream are somewhat correlated */
    280280#define SNDRV_PCM_INFO_SYNC_START       0x00400000      /* pcm support some kind of sync go */
     281#define SNDRV_PCM_INFO_FIFO_IN_FRAMES   0x80000000      /* internal kernel flag - FIFO size is in frames */
    281282
    282283typedef int __bitwise snd_pcm_state_t;
  • GPL/trunk/alsa-kernel/include/sound/config.h

    r455 r464  
    8585#define CONFIG_SND_DEBUG_DETECT
    8686#define CONFIG_SND_DEBUG_VERBOSE
     87#define CONFIG_SND_DMA_SGBUF
    8788#define CONFIG_SND_HDA_CODEC_ANALOG
    8889#define CONFIG_SND_HDA_CODEC_ATIHDMI
  • GPL/trunk/alsa-kernel/include/sound/core.h

    r426 r464  
    324324                    struct snd_card **card_ret);
    325325
    326 static inline __deprecated
    327 struct snd_card *snd_card_new(int idx, const char *id,
    328                               struct module *module, int extra_size)
    329 {
    330         struct snd_card *card;
    331         if (snd_card_create(idx, id, module, extra_size, &card) < 0)
    332                 return NULL;
    333         return card;
    334 }
    335 
    336326int snd_card_disconnect(struct snd_card *card);
    337327int snd_card_free(struct snd_card *card);
    338328int snd_card_free_when_closed(struct snd_card *card);
     329void snd_card_set_id(struct snd_card *card, const char *id);
    339330int snd_card_register(struct snd_card *card);
    340331int snd_card_info_init(void);
     
    373364void release_and_free_resource(struct resource *res);
    374365
    375 #ifdef CONFIG_SND_VERBOSE_PRINTK
    376 void snd_verbose_printk(const char *file, int line, const char *format, ...)
    377      __attribute__ ((format (printf, 3, 4)));
    378 #endif
    379 #if defined(CONFIG_SND_DEBUG) && defined(CONFIG_SND_VERBOSE_PRINTK)
    380 void snd_verbose_printd(const char *file, int line, const char *format, ...)
    381      __attribute__ ((format (printf, 3, 4)));
    382 #endif
    383 
    384366/* --- */
    385367
    386 #ifdef CONFIG_SND_VERBOSE_PRINTK
     368#if defined(CONFIG_SND_DEBUG) || defined(CONFIG_SND_VERBOSE_PRINTK)
     369void __snd_printk(unsigned int level, const char *file, int line,
     370                  const char *format, ...)
     371     __attribute__ ((format (printf, 4, 5)));
     372#else
     373#ifndef TARGET_OS2
     374#define __snd_printk(level, file, line, format, args...) \
     375        printk(format, ##args)
     376#else
     377#define __snd_printk printk
     378#endif /* nothing */
     379#endif
     380
    387381/**
    388382 * snd_printk - printk wrapper
     
    392386 * when configured with CONFIG_SND_VERBOSE_PRINTK.
    393387 */
     388#ifndef TARGET_OS2
    394389#define snd_printk(fmt, args...) \
    395         snd_verbose_printk(__FILE__, __LINE__, fmt ,##args)
    396 #else
    397 #ifndef TARGET_OS2
    398 #define snd_printk(fmt, args...) \
    399         printk(fmt ,##args)
     390        __snd_printk(0, __FILE__, __LINE__, fmt, ##args)
    400391#else
    401392#define snd_printk printk
    402393#endif
    403 #endif
    404394
    405395#ifdef CONFIG_SND_DEBUG
    406 
    407 #ifdef CONFIG_SND_VERBOSE_PRINTK
    408396/**
    409397 * snd_printd - debug printk
     
    414402 */
    415403#define snd_printd(fmt, args...) \
    416         snd_verbose_printd(__FILE__, __LINE__, fmt ,##args)
    417 #else
    418 #define snd_printd(fmt, args...) \
    419         printk(fmt ,##args)
    420 #endif
     404        __snd_printk(1, __FILE__, __LINE__, fmt, ##args)
    421405
    422406/**
     
    478462 */
    479463#ifndef TARGET_OS2
    480 #define snd_printdd(format, args...) snd_printk(format, ##args)
     464#define snd_printdd(format, args...) \
     465        __snd_printk(2, __FILE__, __LINE__, format, ##args)
    481466#else
    482467#define snd_printdd snd_printk
     
    484469#else
    485470#ifndef TARGET_OS2
    486 #define snd_printdd(format, args...) /* nothing */
     471#define snd_printdd(format, args...)    do { } while (0)
    487472#else
    488473#define snd_printdd 1 ? (void)0 : (void)((int (*)(char *, ...)) NULL)
  • GPL/trunk/alsa-kernel/include/sound/memalloc.h

    r410 r464  
    4848#define SNDRV_DMA_TYPE_CONTINUOUS       1       /* continuous no-DMA memory */
    4949#define SNDRV_DMA_TYPE_DEV              2       /* generic device continuous */
     50#ifdef CONFIG_SND_DMA_SGBUF
    5051#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
    5155
    5256/*
     
    6165};
    6266
     67#ifdef CONFIG_SND_DMA_SGBUF
    6368/*
    6469 * Scatter-Gather generic device pages
     
    108113        return sgbuf->table[offset >> PAGE_SHIFT].buf + offset % PAGE_SIZE;
    109114}
     115#endif /* CONFIG_SND_DMA_SGBUF */
    110116
    111117/* allocate/release a buffer */
  • GPL/trunk/alsa-kernel/include/sound/pcm.h

    r426 r464  
    9999#define SNDRV_PCM_IOCTL1_CHANNEL_INFO   2
    100100#define SNDRV_PCM_IOCTL1_GSTATE         3
     101#define SNDRV_PCM_IOCTL1_FIFO_SIZE      4
    101102
    102103#define SNDRV_PCM_TRIGGER_STOP          0
     
    271272        snd_pcm_uframes_t hw_ptr_interrupt; /* Position at interrupt time */
    272273        unsigned long hw_ptr_jiffies;   /* Time when hw_ptr is updated */
     274        snd_pcm_sframes_t delay;        /* extra delay; typically FIFO size */
    273275
    274276        /* -- HW params -- */
     
    490492void snd_pcm_vma_notify_data(void *client, void *data);
    491493int snd_pcm_mmap_data(struct snd_pcm_substream *substream, struct file *file, struct vm_area_struct *area);
    492 
    493 #if BITS_PER_LONG >= 64
    494 
    495 static inline void div64_32(u_int64_t *n, u_int32_t div, u_int32_t *rem)
    496 {
    497         *rem = *n % div;
    498         *n /= div;
    499 }
    500 
    501 #elif defined(i386)
    502 
    503 static inline void div64_32(u_int64_t *n, u_int32_t div, u_int32_t *rem)
    504 {
    505         u_int32_t low, high;
    506         low = *n & 0xffffffff;
    507         high = *n >> 32;
    508         if (high) {
    509                 u_int32_t high1 = high % div;
    510                 high /= div;
    511                 asm("divl %2":"=a" (low), "=d" (*rem):"rm" (div), "a" (low), "d" (high1));
    512                 *n = (u_int64_t)high << 32 | low;
    513         } else {
    514                 *n = low / div;
    515                 *rem = low % div;
    516         }
    517 }
    518 #else
    519 
    520 static inline void divl(u_int32_t high, u_int32_t low,
    521                         u_int32_t div,
    522                         u_int32_t *q, u_int32_t *r)
    523 {
    524         u_int64_t n = (u_int64_t)high << 32 | low;
    525         u_int64_t d = (u_int64_t)div << 31;
    526         u_int32_t q1 = 0;
    527         int c = 32;
    528         while (n > 0xffffffffU) {
    529                 q1 <<= 1;
    530                 if (n >= d) {
    531                         n -= d;
    532                         q1 |= 1;
    533                 }
    534                 d >>= 1;
    535                 c--;
    536         }
    537         q1 <<= c;
    538         if (n) {
    539                 low = n;
    540                 *q = q1 | (low / div);
    541                 *r = low % div;
    542         } else {
    543                 *r = 0;
    544                 *q = q1;
    545         }
    546         return;
    547 }
    548 
    549 static inline void div64_32(u_int64_t *n, u_int32_t div, u_int32_t *rem)
    550 {
    551         u_int32_t low, high;
    552         low = *n & 0xffffffff;
    553         high = *n >> 32;
    554         if (high) {
    555                 u_int32_t high1 = high % div;
    556                 u_int32_t low1 = low;
    557                 high /= div;
    558                 divl(high1, low1, div, &low, rem);
    559                 *n = (u_int64_t)high << 32 | low;
    560         } else {
    561                 *n = low / div;
    562                 *rem = low % div;
    563         }
    564 }
    565 #endif
    566494
    567495/*
     
    992920int snd_pcm_lib_free_pages(struct snd_pcm_substream *substream);
    993921
     922#ifdef CONFIG_SND_DMA_SGBUF
    994923/*
    995924 * SG-buffer handling
     
    1016945unsigned int snd_pcm_sgbuf_get_chunk_size(struct snd_pcm_substream *substream,
    1017946                                          unsigned int ofs, unsigned int size);
     947
     948#else /* !SND_DMA_SGBUF */
     949/*
     950 * fake using a continuous buffer
     951 */
     952static inline dma_addr_t
     953snd_pcm_sgbuf_get_addr(struct snd_pcm_substream *substream, unsigned int ofs)
     954{
     955        return substream->runtime->dma_addr + ofs;
     956}
     957
     958static inline void *
     959snd_pcm_sgbuf_get_ptr(struct snd_pcm_substream *substream, unsigned int ofs)
     960{
     961        return substream->runtime->dma_area + ofs;
     962}
     963
     964#define snd_pcm_sgbuf_ops_page  NULL
     965
     966#define snd_pcm_sgbuf_get_chunk_size(subs, ofs, size)   (size)
     967
     968#endif /* SND_DMA_SGBUF */
    1018969
    1019970/* handle mmap counter - PCM mmap callback should handle this counter properly */
  • GPL/trunk/alsa-kernel/include/sound/soc-dapm.h

    r426 r464  
    138138
    139139/* 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 }
    140146#define SND_SOC_DAPM_DAC(wname, stname, wreg, wshift, winvert) \
    141147{       .id = snd_soc_dapm_dac, .name = wname, .sname = stname, .reg = wreg, \
    142148        .shift = wshift, .invert = winvert}
     149#define SND_SOC_DAPM_DAC_E(wname, stname, wreg, wshift, winvert, \
     150                           wevent, wflags)                              \
     151{       .id = snd_soc_dapm_dac, .name = wname, .sname = stname, .reg = wreg, \
     152        .shift = wshift, .invert = winvert, \
     153        .event = wevent, .event_flags = wflags}
    143154#define SND_SOC_DAPM_ADC(wname, stname, wreg, wshift, winvert) \
    144155{       .id = snd_soc_dapm_adc, .name = wname, .sname = stname, .reg = wreg, \
    145156        .shift = wshift, .invert = winvert}
    146 
    147 /* generic register modifier widget */
     157#define SND_SOC_DAPM_ADC_E(wname, stname, wreg, wshift, winvert, \
     158                           wevent, wflags)                              \
     159{       .id = snd_soc_dapm_adc, .name = wname, .sname = stname, .reg = wreg, \
     160        .shift = wshift, .invert = winvert, \
     161        .event = wevent, .event_flags = wflags}
     162
     163/* generic widgets */
    148164#define SND_SOC_DAPM_REG(wid, wname, wreg, wshift, wmask, won_val, woff_val) \
    149165{       .id = wid, .name = wname, .kcontrols = NULL, .num_kcontrols = 0, \
     
    151167        .on_val = won_val, .off_val = woff_val, .event = dapm_reg_event, \
    152168        .event_flags = SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD}
     169#define SND_SOC_DAPM_SUPPLY(wname, wreg, wshift, winvert, wevent, wflags) \
     170{       .id = snd_soc_dapm_supply, .name = wname, .reg = wreg,  \
     171        .shift = wshift, .invert = winvert, .event = wevent, \
     172        .event_flags = wflags}
    153173
    154174/* dapm kcontrol types */
     
    266286int snd_soc_dapm_stream_event(struct snd_soc_codec *codec, char *stream,
    267287        int event);
    268 int snd_soc_dapm_set_bias_level(struct snd_soc_device *socdev,
    269         enum snd_soc_bias_level level);
     288void snd_soc_dapm_shutdown(struct snd_soc_device *socdev);
    270289
    271290/* dapm sys fs - used by the core */
    272291int snd_soc_dapm_sys_add(struct device *dev);
     292void snd_soc_dapm_debugfs_init(struct snd_soc_codec *codec);
    273293
    274294/* dapm audio pin control and status */
     
    299319        snd_soc_dapm_pre,                       /* machine specific pre widget - exec first */
    300320        snd_soc_dapm_post,                      /* machine specific post widget - exec last */
     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 */
    301324};
    302325
     
    358381        unsigned char pmdown:1;                 /* waiting for timeout */
    359382
     383        int (*power_check)(struct snd_soc_dapm_widget *w);
     384
    360385        /* external events */
    361386        unsigned short event_flags;             /* flags to specify event types */
     
    369394        struct list_head sources;
    370395        struct list_head sinks;
     396
     397        /* used during DAPM updates */
     398        struct list_head power_list;
    371399};
    372400
  • GPL/trunk/alsa-kernel/include/sound/soc.h

    r426 r464  
    119119        .get = xhandler_get, .put = xhandler_put, \
    120120        .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} }
    121129#define SOC_SINGLE_EXT_TLV(xname, xreg, xshift, xmax, xinvert,\
    122130         xhandler_get, xhandler_put, tlv_array) \
     
    128136        .get = xhandler_get, .put = xhandler_put, \
    129137        .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} }
    130160#define SOC_SINGLE_BOOL_EXT(xname, xdata, xhandler_get, xhandler_put) \
    131161{       .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
     
    180210extern struct snd_ac97_bus_ops soc_ac97_ops;
    181211
     212enum snd_soc_control_type {
     213        SND_SOC_CUSTOM,
     214        SND_SOC_I2C,
     215        SND_SOC_SPI,
     216};
     217
    182218int snd_soc_register_platform(struct snd_soc_platform *platform);
    183219void snd_soc_unregister_platform(struct snd_soc_platform *platform);
    184220int snd_soc_register_codec(struct snd_soc_codec *codec);
    185221void snd_soc_unregister_codec(struct snd_soc_codec *codec);
     222int snd_soc_codec_volatile_register(struct snd_soc_codec *codec, int reg);
     223int 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
     228int snd_soc_suspend_device(struct device *dev);
     229int snd_soc_resume_device(struct device *dev);
     230#endif
    186231
    187232/* pcm <-> DAI connect */
     
    207252#endif
    208253
    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 
    213254/* codec register bit access */
    214255int 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);
    216257int 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);
    218259
    219260int snd_soc_new_ac97_codec(struct snd_soc_codec *codec,
     
    332373        struct mutex mutex;
    333374        struct device *dev;
     375        struct snd_soc_device *socdev;
    334376
    335377        struct list_head list;
     
    352394        int (*display_register)(struct snd_soc_codec *, char *,
    353395                                size_t, unsigned int);
     396        int (*volatile_register)(unsigned int);
     397        int (*readable_register)(unsigned int);
    354398        hw_write_t hw_write;
    355         hw_read_t hw_read;
     399        unsigned int (*hw_read)(struct snd_soc_codec *, unsigned int);
    356400        void *reg_cache;
    357401        short reg_cache_size;
     
    373417        struct dentry *debugfs_reg;
    374418        struct dentry *debugfs_pop_time;
     419        struct dentry *debugfs_dapm;
    375420#endif
    376421};
     
    417462        /* codec/machine specific init - e.g. add machine controls */
    418463        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;
    419470
    420471        /* DAI pcm */
     
    491542};
    492543
     544/* codec IO */
     545static inline unsigned int snd_soc_read(struct snd_soc_codec *codec,
     546                                        unsigned int reg)
     547{
     548        return codec->read(codec, reg);
     549}
     550
     551static 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
    493557#include <sound/soc-dai.h>
    494558
  • GPL/trunk/alsa-kernel/include/sound/tlv.h

    r305 r464  
    3636#define SNDRV_CTL_TLVT_DB_LINEAR 2      /* linear volume */
    3737#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 */
    3840
    3941#define TLV_DB_SCALE_ITEM(min, step, mute)                      \
     
    4244#define DECLARE_TLV_DB_SCALE(name, min, step, mute) \
    4345        unsigned int name[] = { TLV_DB_SCALE_ITEM(min, step, mute) }
     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) }
    4458
    4559/* linear volume between min_dB and max_dB (.01dB unit) */
  • GPL/trunk/alsa-kernel/include/sound/ymfpci.h

    r305 r464  
    332332        struct snd_rawmidi *rawmidi;
    333333        struct snd_timer *timer;
     334        unsigned int timer_ticks;
    334335
    335336        struct pci_dev *pci;
Note: See TracChangeset for help on using the changeset viewer.