Commit a50f7731 authored by Alan Cox's avatar Alan Cox Committed by Linus Torvalds

[PATCH] forward port toughbook fixes for maestro3

(Jaroslav you may want to clone this into ALSA if ALSA lacks this one)
parent 76e4ec6c
...@@ -28,6 +28,9 @@ ...@@ -28,6 +28,9 @@
* Shouts go out to Mike "DJ XPCom" Ang. * Shouts go out to Mike "DJ XPCom" Ang.
* *
* History * History
* v1.23 - Jun 5 2002 - Michael Olson <olson@cs.odu.edu>
* added a module option to allow selection of GPIO pin number
* for external amp
* v1.22 - Feb 28 2001 - Zach Brown <zab@zabbo.net> * v1.22 - Feb 28 2001 - Zach Brown <zab@zabbo.net>
* allocate mem at insmod/setup, rather than open * allocate mem at insmod/setup, rather than open
* limit pci dma addresses to 28bit, thanks guys. * limit pci dma addresses to 28bit, thanks guys.
...@@ -153,7 +156,7 @@ ...@@ -153,7 +156,7 @@
#define M_DEBUG 1 #define M_DEBUG 1
#define DRIVER_VERSION "1.22" #define DRIVER_VERSION "1.23"
#define M3_MODULE_NAME "maestro3" #define M3_MODULE_NAME "maestro3"
#define PFX M3_MODULE_NAME ": " #define PFX M3_MODULE_NAME ": "
...@@ -190,6 +193,7 @@ struct m3_list { ...@@ -190,6 +193,7 @@ struct m3_list {
}; };
int external_amp = 1; int external_amp = 1;
int gpio_pin = -1;
struct m3_state { struct m3_state {
unsigned int magic; unsigned int magic;
...@@ -2472,14 +2476,20 @@ static void m3_amp_enable(struct m3_card *card, int enable) ...@@ -2472,14 +2476,20 @@ static void m3_amp_enable(struct m3_card *card, int enable)
if(!external_amp) if(!external_amp)
return; return;
switch (card->card_type) { if (gpio_pin >= 0 && gpio_pin <= 15) {
case ESS_ALLEGRO: polarity_port = 0x1000 + (0x100 * gpio_pin);
polarity_port = 0x1800; } else {
break; switch (card->card_type) {
default: case ESS_ALLEGRO:
/* presumably this is for all 'maestro3's.. */ polarity_port = 0x1800;
polarity_port = 0x1100; break;
break; default:
polarity_port = 0x1100;
/* Panasonic toughbook CF72 has to be different... */
if(card->pcidev->subsystem_vendor == 0x10F7 && card->pcidev->subsystem_device == 0x833D)
polarity_port = 0x1D00;
break;
}
} }
gpo = (polarity_port >> 8) & 0x0F; gpo = (polarity_port >> 8) & 0x0F;
...@@ -2912,6 +2922,7 @@ MODULE_LICENSE("GPL"); ...@@ -2912,6 +2922,7 @@ MODULE_LICENSE("GPL");
MODULE_PARM(debug,"i"); MODULE_PARM(debug,"i");
#endif #endif
MODULE_PARM(external_amp,"i"); MODULE_PARM(external_amp,"i");
MODULE_PARM(gpio_pin, "i");
static struct pci_driver m3_pci_driver = { static struct pci_driver m3_pci_driver = {
name: "ess_m3_audio", name: "ess_m3_audio",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment