~ubuntu-branches/ubuntu/precise/alsa-driver/precise

« back to all changes in this revision

Viewing changes to alsa-kernel/soc/soc-jack.c

  • Committer: Bazaar Package Importer
  • Author(s): Luke Yelavich
  • Date: 2009-11-04 16:28:58 UTC
  • mfrom: (1.1.12 upstream) (3.1.7 squeeze)
  • Revision ID: james.westby@ubuntu.com-20091104162858-7ky0tu33d7mn6oys
Tags: 1.0.21+dfsg-3ubuntu1
* Merge from debian unstable, remaining changes:
  - Script paths (/usr/sbin -> /sbin, /usr/bin -> /bin);
  - debian/rules:
    + Don't install snddevices and program-wrapper
    + install alsa-base apport hook
    + Package separate USB card list file
  - Vcs and maintainer fields mangling
  - Rename blacklist files in /etc/modprobe.d to be consistant with the rest
    of the distro
  - debian/alsa-base.init:
    + create /var/run/alsa if it doesn't exist
    + Run alsactl store before force unloading modules
    + Run alsactl restore after reloading unloaded modules
  - debian/linux-sound-base.postrm: Remove /etc/modprobe.d/blacklist* files
    on package removal
  - Add missing $CMDLINE_OPTS to all install rules.
  - Replace -Q with --quiet.
  - Add --use-blacklist to all rules so the blacklist still takes effect.
  - debian/alsa-base.postinst: Do not run snddevices
  - retain patches:
    + add_suspend_quirk_hp_nc6220_nw8240.patch,
    + refix_lp_68659_by_disabling_dxs_for_0x1458a002.patch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
73
73
        oldstatus = jack->status;
74
74
 
75
75
        jack->status &= ~mask;
76
 
        jack->status |= status;
 
76
        jack->status |= status & mask;
77
77
 
78
 
        /* The DAPM sync is expensive enough to be worth skipping */
79
 
        if (jack->status == oldstatus)
 
78
        /* The DAPM sync is expensive enough to be worth skipping.
 
79
         * However, empty mask means pin synchronization is desired. */
 
80
        if (mask && (jack->status == oldstatus))
80
81
                goto out;
81
82
 
82
83
        list_for_each_entry(pin, &jack->pins, list) {
83
 
                enable = pin->mask & status;
 
84
                enable = pin->mask & jack->status;
84
85
 
85
86
                if (pin->invert)
86
87
                        enable = !enable;
220
221
                if (ret)
221
222
                        goto err;
222
223
 
 
224
                INIT_WORK(&gpios[i].work, gpio_work);
 
225
                gpios[i].jack = jack;
 
226
 
223
227
                ret = request_irq(gpio_to_irq(gpios[i].gpio),
224
228
                                gpio_handler,
225
229
                                IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
228
232
                if (ret)
229
233
                        goto err;
230
234
 
231
 
                INIT_WORK(&gpios[i].work, gpio_work);
232
 
                gpios[i].jack = jack;
 
235
#ifdef CONFIG_GPIO_SYSFS
 
236
                /* Expose GPIO value over sysfs for diagnostic purposes */
 
237
                gpio_export(gpios[i].gpio, false);
 
238
#endif
 
239
 
 
240
                /* Update initial jack status */
 
241
                snd_soc_jack_gpio_detect(&gpios[i]);
233
242
        }
234
243
 
235
244
        return 0;
258
267
        int i;
259
268
 
260
269
        for (i = 0; i < count; i++) {
 
270
#ifdef CONFIG_GPIO_SYSFS
 
271
                gpio_unexport(gpios[i].gpio);
 
272
#endif
261
273
                free_irq(gpio_to_irq(gpios[i].gpio), &gpios[i]);
262
274
                gpio_free(gpios[i].gpio);
263
275
                gpios[i].jack = NULL;