Date:2009-12-01 07:55:13 (10 years 6 months ago)
Author:xiangfu
Commit:8490d6df809d289e1b260e7b4761c5ada1fb7294
Message:410-soc-32bit-regs.patch

Files: include/sound/soc.h (2 diffs)
sound/soc/soc-core.c (13 diffs)
sound/soc/soc-dapm.c (8 diffs)

Change Details

include/sound/soc.h
215215#endif
216216
217217/* codec register bit access */
218int snd_soc_update_bits(struct snd_soc_codec *codec, unsigned short reg,
219                unsigned short mask, unsigned short value);
220int snd_soc_test_bits(struct snd_soc_codec *codec, unsigned short reg,
221                unsigned short mask, unsigned short value);
218int snd_soc_update_bits(struct snd_soc_codec *codec, unsigned int reg,
219                unsigned int mask, unsigned int value);
220int snd_soc_test_bits(struct snd_soc_codec *codec, unsigned int reg,
221                unsigned int mask, unsigned int value);
222222
223223int snd_soc_new_ac97_codec(struct snd_soc_codec *codec,
224224    struct snd_ac97_bus_ops *ops, int num);
...... 
492492
493493/* enumerated kcontrol */
494494struct soc_enum {
495    unsigned short reg;
496    unsigned short reg2;
495    unsigned int reg;
496    unsigned int reg2;
497497    unsigned char shift_l;
498498    unsigned char shift_r;
499499    unsigned int max;
sound/soc/soc-core.c
500500    if (cpu_dai->ops->hw_params) {
501501        ret = cpu_dai->ops->hw_params(substream, params, cpu_dai);
502502        if (ret < 0) {
503            printk(KERN_ERR "asoc: interface %s hw params failed\n",
504                cpu_dai->name);
503            printk(KERN_ERR "asoc: interface %s hw params failed: %d\n",
504                cpu_dai->name, ret);
505505            goto interface_err;
506506        }
507507    }
...... 
842842     * DAIs currently; we can't do this per link since some AC97
843843     * codecs have non-AC97 DAIs.
844844     */
845    if (!ac97)
845    if (!ac97) {
846846        for (i = 0; i < card->num_links; i++) {
847847            found = 0;
848848            list_for_each_entry(dai, &dai_list, list)
...... 
856856                return;
857857            }
858858        }
859    }
859860
860861    /* Note that we do not current check for codec components */
861862
...... 
12631264 *
12641265 * Returns 1 for change else 0.
12651266 */
1266int snd_soc_update_bits(struct snd_soc_codec *codec, unsigned short reg,
1267                unsigned short mask, unsigned short value)
1267int snd_soc_update_bits(struct snd_soc_codec *codec, unsigned int reg,
1268                unsigned int mask, unsigned int value)
12681269{
12691270    int change;
1270    unsigned short old, new;
1271    unsigned int old, new;
12711272
12721273    mutex_lock(&io_mutex);
12731274    old = snd_soc_read(codec, reg);
...... 
12931294 *
12941295 * Returns 1 for change else 0.
12951296 */
1296int snd_soc_test_bits(struct snd_soc_codec *codec, unsigned short reg,
1297                unsigned short mask, unsigned short value)
1297int snd_soc_test_bits(struct snd_soc_codec *codec, unsigned int reg,
1298                unsigned int mask, unsigned int value)
12981299{
12991300    int change;
1300    unsigned short old, new;
1301    unsigned int old, new;
13011302
13021303    mutex_lock(&io_mutex);
13031304    old = snd_soc_read(codec, reg);
...... 
15861587{
15871588    struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
15881589    struct soc_enum *e = (struct soc_enum *)kcontrol->private_value;
1589    unsigned short val, bitmask;
1590    unsigned int val, bitmask;
15901591
15911592    for (bitmask = 1; bitmask < e->max; bitmask <<= 1)
15921593        ;
...... 
16151616{
16161617    struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
16171618    struct soc_enum *e = (struct soc_enum *)kcontrol->private_value;
1618    unsigned short val;
1619    unsigned short mask, bitmask;
1619    unsigned int val;
1620    unsigned int mask, bitmask;
16201621
16211622    for (bitmask = 1; bitmask < e->max; bitmask <<= 1)
16221623        ;
...... 
16521653{
16531654    struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
16541655    struct soc_enum *e = (struct soc_enum *)kcontrol->private_value;
1655    unsigned short reg_val, val, mux;
1656    unsigned int reg_val, val, mux;
16561657
16571658    reg_val = snd_soc_read(codec, e->reg);
16581659    val = (reg_val >> e->shift_l) & e->mask;
...... 
16911692{
16921693    struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
16931694    struct soc_enum *e = (struct soc_enum *)kcontrol->private_value;
1694    unsigned short val;
1695    unsigned short mask;
1695    unsigned int val;
1696    unsigned int mask;
16961697
16971698    if (ucontrol->value.enumerated.item[0] > e->max - 1)
16981699        return -EINVAL;
...... 
18521853    int max = mc->max;
18531854    unsigned int mask = (1 << fls(max)) - 1;
18541855    unsigned int invert = mc->invert;
1855    unsigned short val, val2, val_mask;
1856    unsigned int val, val2, val_mask;
18561857
18571858    val = (ucontrol->value.integer.value[0] & mask);
18581859    if (invert)
...... 
19581959    unsigned int mask = (1 << fls(max)) - 1;
19591960    unsigned int invert = mc->invert;
19601961    int err;
1961    unsigned short val, val2, val_mask;
1962    unsigned int val, val2, val_mask;
19621963
19631964    val_mask = mask << shift;
19641965    val = (ucontrol->value.integer.value[0] & mask);
...... 
20502051    struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
20512052    unsigned int reg = mc->reg;
20522053    int min = mc->min;
2053    unsigned short val;
2054    unsigned int val;
20542055
20552056    val = (ucontrol->value.integer.value[0]+min) & 0xff;
20562057    val |= ((ucontrol->value.integer.value[1]+min) & 0xff) << 8;
...... 
22512252    if (!dai->ops)
22522253        dai->ops = &null_dai_ops;
22532254
2255
22542256    INIT_LIST_HEAD(&dai->list);
22552257
22562258    mutex_lock(&client_mutex);
sound/soc/soc-dapm.c
268268static int dapm_update_bits(struct snd_soc_dapm_widget *widget)
269269{
270270    int change, power;
271    unsigned short old, new;
271    unsigned int old, new;
272272    struct snd_soc_codec *codec = widget->codec;
273273
274274    /* check for valid widgets */
...... 
12461246/**
12471247 * snd_soc_dapm_new_widgets - add new dapm widgets
12481248 * @codec: audio codec
1249 *
12501249 * Checks the codec for any new dapm widgets and creates them if found.
12511250 *
12521251 * Returns 0 for success.
...... 
13361335
13371336    ucontrol->value.integer.value[0] =
13381337        (snd_soc_read(widget->codec, reg) >> shift) & mask;
1339    if (shift != rshift)
1338
1339    if (shift != rshift)
13401340        ucontrol->value.integer.value[1] =
13411341            (snd_soc_read(widget->codec, reg) >> rshift) & mask;
13421342    if (invert) {
...... 
13721372    int max = mc->max;
13731373    unsigned int mask = (1 << fls(max)) - 1;
13741374    unsigned int invert = mc->invert;
1375    unsigned short val, val2, val_mask;
1375    unsigned int val, val2, val_mask;
13761376    int ret;
13771377
13781378    val = (ucontrol->value.integer.value[0] & mask);
...... 
14361436{
14371437    struct snd_soc_dapm_widget *widget = snd_kcontrol_chip(kcontrol);
14381438    struct soc_enum *e = (struct soc_enum *)kcontrol->private_value;
1439    unsigned short val, bitmask;
1439    unsigned int val, bitmask;
14401440
14411441    for (bitmask = 1; bitmask < e->max; bitmask <<= 1)
14421442        ;
...... 
14641464{
14651465    struct snd_soc_dapm_widget *widget = snd_kcontrol_chip(kcontrol);
14661466    struct soc_enum *e = (struct soc_enum *)kcontrol->private_value;
1467    unsigned short val, mux;
1468    unsigned short mask, bitmask;
1467    unsigned int val, mux;
1468    unsigned int mask, bitmask;
14691469    int ret = 0;
14701470
14711471    for (bitmask = 1; bitmask < e->max; bitmask <<= 1)
...... 
15231523{
15241524    struct snd_soc_dapm_widget *widget = snd_kcontrol_chip(kcontrol);
15251525    struct soc_enum *e = (struct soc_enum *)kcontrol->private_value;
1526    unsigned short reg_val, val, mux;
1526    unsigned int reg_val, val, mux;
15271527
15281528    reg_val = snd_soc_read(widget->codec, e->reg);
15291529    val = (reg_val >> e->shift_l) & e->mask;
...... 
15631563{
15641564    struct snd_soc_dapm_widget *widget = snd_kcontrol_chip(kcontrol);
15651565    struct soc_enum *e = (struct soc_enum *)kcontrol->private_value;
1566    unsigned short val, mux;
1567    unsigned short mask;
1566    unsigned int val, mux;
1567    unsigned int mask;
15681568    int ret = 0;
15691569
15701570    if (ucontrol->value.enumerated.item[0] > e->max - 1)

Archive Download the corresponding diff file



interactive