]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
Merge branch 'topic/jack-mechanical' into to-push
authorTakashi Iwai <tiwai@suse.de>
Thu, 25 Dec 2008 10:40:29 +0000 (11:40 +0100)
committerTakashi Iwai <tiwai@suse.de>
Thu, 25 Dec 2008 10:40:29 +0000 (11:40 +0100)
1  2 
include/linux/input.h
sound/core/jack.c

diff --combined include/linux/input.h
index 1a958cd90ce908d857fc29d945fee6587874469f,abd223b0f586c4df137660c8523af3209d28be1c..9a6355f74db25b28233cb3d9d8765d7aec13632e
@@@ -238,7 -238,6 +238,7 @@@ struct input_absinfo 
  #define KEY_KPEQUAL           117
  #define KEY_KPPLUSMINUS               118
  #define KEY_PAUSE             119
 +#define KEY_SCALE             120     /* AL Compiz Scale (Expose) */
  
  #define KEY_KPCOMMA           121
  #define KEY_HANGEUL           122
  #define KEY_PAUSECD           201
  #define KEY_PROG3             202
  #define KEY_PROG4             203
 +#define KEY_DASHBOARD         204     /* AL Dashboard */
  #define KEY_SUSPEND           205
  #define KEY_CLOSE             206     /* AC Close */
  #define KEY_PLAY              207
  #define KEY_BRL_DOT9          0x1f9
  #define KEY_BRL_DOT10         0x1fa
  
 +#define KEY_NUMERIC_0         0x200   /* used by phones, remote controls, */
 +#define KEY_NUMERIC_1         0x201   /* and other keypads */
 +#define KEY_NUMERIC_2         0x202
 +#define KEY_NUMERIC_3         0x203
 +#define KEY_NUMERIC_4         0x204
 +#define KEY_NUMERIC_5         0x205
 +#define KEY_NUMERIC_6         0x206
 +#define KEY_NUMERIC_7         0x207
 +#define KEY_NUMERIC_8         0x208
 +#define KEY_NUMERIC_9         0x209
 +#define KEY_NUMERIC_STAR      0x20a
 +#define KEY_NUMERIC_POUND     0x20b
 +
  /* We avoid low common keys in module aliases so they don't get huge. */
  #define KEY_MIN_INTERESTING   KEY_MUTE
 -#define KEY_MAX                       0x1ff
 +#define KEY_MAX                       0x2ff
  #define KEY_CNT                       (KEY_MAX+1)
  
  /*
  #define SW_MICROPHONE_INSERT  0x04  /* set = inserted */
  #define SW_DOCK                       0x05  /* set = plugged into dock */
  #define SW_LINEOUT_INSERT     0x06  /* set = inserted */
+ #define SW_JACK_PHYSICAL_INSERT 0x07  /* set = mechanical switch set */
  #define SW_MAX                        0x0f
  #define SW_CNT                        (SW_MAX+1)
  
diff --combined sound/core/jack.c
index 284432f427f4b7c32a178a11329520e112dedbee,6ebd5f12bc5062a7546235776650bcbd17343f30..dd4a12dc09aa44f4c50c5b60f2cf5584c5635589
@@@ -34,7 -34,6 +34,7 @@@ static int snd_jack_dev_free(struct snd
        else
                input_free_device(jack->input_dev);
  
 +      kfree(jack->id);
        kfree(jack);
  
        return 0;
@@@ -88,7 -87,7 +88,7 @@@ int snd_jack_new(struct snd_card *card
        if (jack == NULL)
                return -ENOMEM;
  
 -      jack->id = id;
 +      jack->id = kstrdup(id, GFP_KERNEL);
  
        jack->input_dev = input_allocate_device();
        if (jack->input_dev == NULL) {
        if (type & SND_JACK_MICROPHONE)
                input_set_capability(jack->input_dev, EV_SW,
                                     SW_MICROPHONE_INSERT);
+       if (type & SND_JACK_MECHANICAL)
+               input_set_capability(jack->input_dev, EV_SW,
+                                    SW_JACK_PHYSICAL_INSERT);
  
        err = snd_device_new(card, SNDRV_DEV_JACK, jack, &ops);
        if (err < 0)
@@@ -151,9 -153,6 +154,9 @@@ EXPORT_SYMBOL(snd_jack_set_parent)
   */
  void snd_jack_report(struct snd_jack *jack, int status)
  {
 +      if (!jack)
 +              return;
 +
        if (jack->type & SND_JACK_HEADPHONE)
                input_report_switch(jack->input_dev, SW_HEADPHONE_INSERT,
                                    status & SND_JACK_HEADPHONE);
        if (jack->type & SND_JACK_MICROPHONE)
                input_report_switch(jack->input_dev, SW_MICROPHONE_INSERT,
                                    status & SND_JACK_MICROPHONE);
+       if (jack->type & SND_JACK_MECHANICAL)
+               input_report_switch(jack->input_dev, SW_JACK_PHYSICAL_INSERT,
+                                   status & SND_JACK_MECHANICAL);
  
        input_sync(jack->input_dev);
  }