Commit 9cb4dc2e authored by Tony Lindgren's avatar Tony Lindgren

Manual merge after pull from Linus' tree

parent da84b303
...@@ -18,9 +18,7 @@ ...@@ -18,9 +18,7 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
#undef DEBUG
#include <linux/config.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/init.h> #include <linux/init.h>
...@@ -50,11 +48,7 @@ ...@@ -50,11 +48,7 @@
MODULE_DESCRIPTION("TPS6501x Power Management Driver"); MODULE_DESCRIPTION("TPS6501x Power Management Driver");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
/* only two addresses possible */ static unsigned short normal_i2c[] = { 0x48, /* 0x49, */ I2C_CLIENT_END };
#define TPS_BASE 0x48
static unsigned short normal_i2c[] = {
TPS_BASE,
I2C_CLIENT_END };
I2C_CLIENT_INSMOD; I2C_CLIENT_INSMOD;
...@@ -88,7 +82,6 @@ struct tps65010 { ...@@ -88,7 +82,6 @@ struct tps65010 {
struct i2c_client client; struct i2c_client client;
struct mutex lock; struct mutex lock;
int irq; int irq;
int irq_type;
struct work_struct work; struct work_struct work;
struct dentry *file; struct dentry *file;
unsigned charging:1; unsigned charging:1;
...@@ -103,10 +96,10 @@ struct tps65010 { ...@@ -103,10 +96,10 @@ struct tps65010 {
u8 chgstatus, regstatus, chgconf; u8 chgstatus, regstatus, chgconf;
u8 nmask1, nmask2; u8 nmask1, nmask2;
/* plus four GPIOs, probably used to switch power */ /* not currently tracking GPIO state */
}; };
#define POWER_POLL_DELAY msecs_to_jiffies(800) #define POWER_POLL_DELAY msecs_to_jiffies(5000)
/*-------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------*/
...@@ -136,7 +129,7 @@ static void dbg_regstat(char *buf, size_t len, u8 regstatus) ...@@ -136,7 +129,7 @@ static void dbg_regstat(char *buf, size_t len, u8 regstatus)
(regstatus & TPS_REG_COVER) ? " uncover" : "", (regstatus & TPS_REG_COVER) ? " uncover" : "",
(regstatus & TPS_REG_UVLO) ? " UVLO" : "", (regstatus & TPS_REG_UVLO) ? " UVLO" : "",
(regstatus & TPS_REG_NO_CHG) ? " NO_CHG" : "", (regstatus & TPS_REG_NO_CHG) ? " NO_CHG" : "",
(regstatus & TPS_REG_PG_LD02) ? " ld01_bad" : "", (regstatus & TPS_REG_PG_LD02) ? " ld02_bad" : "",
(regstatus & TPS_REG_PG_LD01) ? " ld01_bad" : "", (regstatus & TPS_REG_PG_LD01) ? " ld01_bad" : "",
(regstatus & TPS_REG_PG_MAIN) ? " main_bad" : "", (regstatus & TPS_REG_PG_MAIN) ? " main_bad" : "",
(regstatus & TPS_REG_PG_CORE) ? " core_bad" : ""); (regstatus & TPS_REG_PG_CORE) ? " core_bad" : "");
...@@ -144,7 +137,7 @@ static void dbg_regstat(char *buf, size_t len, u8 regstatus) ...@@ -144,7 +137,7 @@ static void dbg_regstat(char *buf, size_t len, u8 regstatus)
static void dbg_chgconf(int por, char *buf, size_t len, u8 chgconfig) static void dbg_chgconf(int por, char *buf, size_t len, u8 chgconfig)
{ {
char *hibit; const char *hibit;
if (por) if (por)
hibit = (chgconfig & TPS_CHARGE_POR) hibit = (chgconfig & TPS_CHARGE_POR)
...@@ -296,7 +289,7 @@ static int dbg_show(struct seq_file *s, void *_) ...@@ -296,7 +289,7 @@ static int dbg_show(struct seq_file *s, void *_)
seq_printf(s, "defgpio %02x mask3 %02x\n", value, v2); seq_printf(s, "defgpio %02x mask3 %02x\n", value, v2);
for (i = 0; i < 4; i++) { for (i = 0; i < 4; i++) {
if (value & (1 << (4 +i))) if (value & (1 << (4 + i)))
seq_printf(s, " gpio%d-out %s\n", i + 1, seq_printf(s, " gpio%d-out %s\n", i + 1,
(value & (1 << i)) ? "low" : "hi "); (value & (1 << i)) ? "low" : "hi ");
else else
...@@ -482,7 +475,7 @@ static int __exit tps65010_detach_client(struct i2c_client *client) ...@@ -482,7 +475,7 @@ static int __exit tps65010_detach_client(struct i2c_client *client)
debugfs_remove(tps->file); debugfs_remove(tps->file);
if (i2c_detach_client(client) == 0) if (i2c_detach_client(client) == 0)
kfree(tps); kfree(tps);
the_tps = 0; the_tps = NULL;
return 0; return 0;
} }
...@@ -500,6 +493,7 @@ tps65010_probe(struct i2c_adapter *bus, int address, int kind) ...@@ -500,6 +493,7 @@ tps65010_probe(struct i2c_adapter *bus, int address, int kind)
{ {
struct tps65010 *tps; struct tps65010 *tps;
int status; int status;
unsigned long irqflags;
if (the_tps) { if (the_tps) {
dev_dbg(&bus->dev, "only one %s for now\n", DRIVER_NAME); dev_dbg(&bus->dev, "only one %s for now\n", DRIVER_NAME);
...@@ -514,7 +508,6 @@ tps65010_probe(struct i2c_adapter *bus, int address, int kind) ...@@ -514,7 +508,6 @@ tps65010_probe(struct i2c_adapter *bus, int address, int kind)
INIT_WORK(&tps->work, tps65010_work, tps); INIT_WORK(&tps->work, tps65010_work, tps);
tps->irq = -1; tps->irq = -1;
tps->client.addr = address; tps->client.addr = address;
i2c_set_clientdata(&tps->client, tps);
tps->client.adapter = bus; tps->client.adapter = bus;
tps->client.driver = &tps65010_driver; tps->client.driver = &tps65010_driver;
strlcpy(tps->client.name, DRIVER_NAME, I2C_NAME_SIZE); strlcpy(tps->client.name, DRIVER_NAME, I2C_NAME_SIZE);
...@@ -523,13 +516,13 @@ tps65010_probe(struct i2c_adapter *bus, int address, int kind) ...@@ -523,13 +516,13 @@ tps65010_probe(struct i2c_adapter *bus, int address, int kind)
if (status < 0) { if (status < 0) {
dev_dbg(&bus->dev, "can't attach %s to device %d, err %d\n", dev_dbg(&bus->dev, "can't attach %s to device %d, err %d\n",
DRIVER_NAME, address, status); DRIVER_NAME, address, status);
fail1: goto fail1;
kfree(tps);
return 0;
} }
tps->irq_type = 0; /* the IRQ is active low, but many gpio lines can't support that
* so this driver can use falling-edge triggers instead.
*/
irqflags = IRQF_SAMPLE_RANDOM;
#ifdef CONFIG_ARM #ifdef CONFIG_ARM
if (machine_is_omap_h2()) { if (machine_is_omap_h2()) {
tps->model = TPS65010; tps->model = TPS65010;
...@@ -537,7 +530,7 @@ fail1: ...@@ -537,7 +530,7 @@ fail1:
tps->irq = OMAP_GPIO_IRQ(58); tps->irq = OMAP_GPIO_IRQ(58);
omap_request_gpio(58); omap_request_gpio(58);
omap_set_gpio_direction(58, 1); omap_set_gpio_direction(58, 1);
tps->irq_type = SA_TRIGGER_FALLING; irqflags |= IRQF_TRIGGER_FALLING;
} }
if (machine_is_omap_osk()) { if (machine_is_omap_osk()) {
tps->model = TPS65010; tps->model = TPS65010;
...@@ -545,7 +538,7 @@ fail1: ...@@ -545,7 +538,7 @@ fail1:
tps->irq = OMAP_GPIO_IRQ(OMAP_MPUIO(1)); tps->irq = OMAP_GPIO_IRQ(OMAP_MPUIO(1));
omap_request_gpio(OMAP_MPUIO(1)); omap_request_gpio(OMAP_MPUIO(1));
omap_set_gpio_direction(OMAP_MPUIO(1), 1); omap_set_gpio_direction(OMAP_MPUIO(1), 1);
tps->irq_type = SA_TRIGGER_FALLING; irqflags |= IRQF_TRIGGER_FALLING;
} }
if (machine_is_omap_h3()) { if (machine_is_omap_h3()) {
tps->model = TPS65013; tps->model = TPS65013;
...@@ -556,7 +549,7 @@ fail1: ...@@ -556,7 +549,7 @@ fail1:
if (tps->irq > 0) { if (tps->irq > 0) {
status = request_irq(tps->irq, tps65010_irq, status = request_irq(tps->irq, tps65010_irq,
tps->irq_type, DRIVER_NAME, tps); irqflags, DRIVER_NAME, tps);
if (status < 0) { if (status < 0) {
dev_dbg(&tps->client.dev, "can't get IRQ %d, err %d\n", dev_dbg(&tps->client.dev, "can't get IRQ %d, err %d\n",
tps->irq, status); tps->irq, status);
...@@ -632,6 +625,9 @@ fail1: ...@@ -632,6 +625,9 @@ fail1:
tps->file = debugfs_create_file(DRIVER_NAME, S_IRUGO, NULL, tps->file = debugfs_create_file(DRIVER_NAME, S_IRUGO, NULL,
tps, DEBUG_FOPS); tps, DEBUG_FOPS);
return 0; return 0;
fail1:
kfree(tps);
return 0;
} }
static int __init tps65010_scan_bus(struct i2c_adapter *bus) static int __init tps65010_scan_bus(struct i2c_adapter *bus)
...@@ -645,7 +641,6 @@ static struct i2c_driver tps65010_driver = { ...@@ -645,7 +641,6 @@ static struct i2c_driver tps65010_driver = {
.driver = { .driver = {
.name = "tps65010", .name = "tps65010",
}, },
.id = 888, /* FIXME assign "official" value */
.attach_adapter = tps65010_scan_bus, .attach_adapter = tps65010_scan_bus,
.detach_client = __exit_p(tps65010_detach_client), .detach_client = __exit_p(tps65010_detach_client),
}; };
...@@ -743,7 +738,7 @@ int tps65010_set_led(unsigned led, unsigned mode) ...@@ -743,7 +738,7 @@ int tps65010_set_led(unsigned led, unsigned mode)
if (!the_tps) if (!the_tps)
return -ENODEV; return -ENODEV;
if(led == LED1) if (led == LED1)
offs = 0; offs = 0;
else { else {
offs = 2; offs = 2;
...@@ -752,11 +747,13 @@ int tps65010_set_led(unsigned led, unsigned mode) ...@@ -752,11 +747,13 @@ int tps65010_set_led(unsigned led, unsigned mode)
mutex_lock(&the_tps->lock); mutex_lock(&the_tps->lock);
dev_dbg (&the_tps->client.dev, "led%i_on 0x%02x\n", led, pr_debug("%s: led%i_on 0x%02x\n", DRIVER_NAME, led,
i2c_smbus_read_byte_data(&the_tps->client, TPS_LED1_ON + offs)); i2c_smbus_read_byte_data(&the_tps->client,
TPS_LED1_ON + offs));
dev_dbg (&the_tps->client.dev, "led%i_per 0x%02x\n", led, pr_debug("%s: led%i_per 0x%02x\n", DRIVER_NAME, led,
i2c_smbus_read_byte_data(&the_tps->client, TPS_LED1_PER + offs)); i2c_smbus_read_byte_data(&the_tps->client,
TPS_LED1_PER + offs));
switch (mode) { switch (mode) {
case OFF: case OFF:
...@@ -772,7 +769,7 @@ int tps65010_set_led(unsigned led, unsigned mode) ...@@ -772,7 +769,7 @@ int tps65010_set_led(unsigned led, unsigned mode)
led_per = 0x08 | (1 << 7); led_per = 0x08 | (1 << 7);
break; break;
default: default:
printk(KERN_ERR "%s: Wrong mode parameter for tps65010_set_led()\n", printk(KERN_ERR "%s: Wrong mode parameter for set_led()\n",
DRIVER_NAME); DRIVER_NAME);
mutex_unlock(&the_tps->lock); mutex_unlock(&the_tps->lock);
return -EINVAL; return -EINVAL;
...@@ -788,7 +785,7 @@ int tps65010_set_led(unsigned led, unsigned mode) ...@@ -788,7 +785,7 @@ int tps65010_set_led(unsigned led, unsigned mode)
return status; return status;
} }
dev_dbg (&the_tps->client.dev, "led%i_on 0x%02x\n", led, pr_debug("%s: led%i_on 0x%02x\n", DRIVER_NAME, led,
i2c_smbus_read_byte_data(&the_tps->client, TPS_LED1_ON + offs)); i2c_smbus_read_byte_data(&the_tps->client, TPS_LED1_ON + offs));
status = i2c_smbus_write_byte_data(&the_tps->client, status = i2c_smbus_write_byte_data(&the_tps->client,
...@@ -801,8 +798,9 @@ int tps65010_set_led(unsigned led, unsigned mode) ...@@ -801,8 +798,9 @@ int tps65010_set_led(unsigned led, unsigned mode)
return status; return status;
} }
dev_dbg (&the_tps->client.dev, "led%i_per 0x%02x\n", led, pr_debug("%s: led%i_per 0x%02x\n", DRIVER_NAME, led,
i2c_smbus_read_byte_data(&the_tps->client, TPS_LED1_PER + offs)); i2c_smbus_read_byte_data(&the_tps->client,
TPS_LED1_PER + offs));
mutex_unlock(&the_tps->lock); mutex_unlock(&the_tps->lock);
...@@ -1008,7 +1006,7 @@ static int __init tps_init(void) ...@@ -1008,7 +1006,7 @@ static int __init tps_init(void)
msleep(10); msleep(10);
} }
#if defined(CONFIG_ARM) #ifdef CONFIG_ARM
if (machine_is_omap_osk()) { if (machine_is_omap_osk()) {
// FIXME: More should be placed in the initialization code // FIXME: More should be placed in the initialization code
...@@ -1048,8 +1046,8 @@ static int __init tps_init(void) ...@@ -1048,8 +1046,8 @@ static int __init tps_init(void)
} else if (machine_is_omap_h3()) { } else if (machine_is_omap_h3()) {
/* gpio4 for SD, gpio3 for VDD_DSP */ /* gpio4 for SD, gpio3 for VDD_DSP */
#ifdef CONFIG_PM #ifdef CONFIG_PM
/* FIXME: Enable LOW_PWR hangs H3 */ /* Enable LOW_PWR */
//tps65013_set_low_pwr(ON); tps65013_set_low_pwr(ON);
#endif #endif
} }
#endif #endif
......
...@@ -5,36 +5,19 @@ ...@@ -5,36 +5,19 @@
# #
# Prompt user for primary drivers. # Prompt user for primary drivers.
config SOUND_OMAP config OSS_OBSOLETE_DRIVER
tristate "OMAP Sound Driver" bool "Obsolete OSS drivers"
depends on SOUND_PRIME!=n && SOUND && ARCH_OMAP depends on SOUND_PRIME
---help--- help
OMAP Audio driver This option enables support for obsolete OSS drivers that
are scheduled for removal in the near future since there
are ALSA drivers for the same hardware.
config SOUND_OMAP_TSC2101 Please contact Adrian Bunk <bunk@stusta.de> if you had to
tristate "TSC2101 Stereo Codec" say Y here because your soundcard is not properly supported
depends on SOUND_OMAP && ( MACH_OMAP_H2 || MACH_OMAP_H3 || MACH_OMAP_H4 || MACH_OMAP_APOLLON) by ALSA.
select OMAP_TSC2101 if ( MACH_OMAP_H2 || MACH_OMAP_H3 )
select OMAP_UWIRE if ARCH_OMAP1 If unsure, say N.
---help---
Tsc2101 Audio Codec Driver for OMAP will be enabled.
Will also Enable the following:
case OMAP1:
1. uWire Driver based on Platform
2. TSC2101 Glue driver
case OMAP2:
1. McSPI Driver based on Platform
2. TSC2101 Glue driver
config SOUND_OMAP_AIC23
tristate "AIC23 Stereo Codec"
depends on SOUND_OMAP && ( MACH_OMAP_INNOVATOR || MACH_OMAP_OSK )
select I2C
select I2C_OMAP if ARCH_OMAP
select SENSORS_TLV320AIC23 if ARCH_OMAP
---help---
AIC23 Audio Codec Driver for OMAP will be enabled.
Additionally, AIC23 I2C support is enabled.
config SOUND_BT878 config SOUND_BT878
tristate "BT878 audio dma" tristate "BT878 audio dma"
...@@ -54,7 +37,7 @@ config SOUND_BT878 ...@@ -54,7 +37,7 @@ config SOUND_BT878
config SOUND_EMU10K1 config SOUND_EMU10K1
tristate "Creative SBLive! (EMU10K1)" tristate "Creative SBLive! (EMU10K1)"
depends on SOUND_PRIME && PCI depends on SOUND_PRIME && PCI && OSS_OBSOLETE_DRIVER
---help--- ---help---
Say Y or M if you have a PCI sound card using the EMU10K1 chipset, Say Y or M if you have a PCI sound card using the EMU10K1 chipset,
such as the Creative SBLive!, SB PCI512 or Emu-APS. such as the Creative SBLive!, SB PCI512 or Emu-APS.
...@@ -80,7 +63,7 @@ config MIDI_EMU10K1 ...@@ -80,7 +63,7 @@ config MIDI_EMU10K1
config SOUND_FUSION config SOUND_FUSION
tristate "Crystal SoundFusion (CS4280/461x)" tristate "Crystal SoundFusion (CS4280/461x)"
depends on SOUND_PRIME && PCI depends on SOUND_PRIME && PCI && OSS_OBSOLETE_DRIVER
help help
This module drives the Crystal SoundFusion devices (CS4280/46xx This module drives the Crystal SoundFusion devices (CS4280/46xx
series) when wired as native sound drivers with AC97 codecs. If series) when wired as native sound drivers with AC97 codecs. If
...@@ -471,7 +454,7 @@ config SOUND_DMAP ...@@ -471,7 +454,7 @@ config SOUND_DMAP
config SOUND_AD1816 config SOUND_AD1816
tristate "AD1816(A) based cards (EXPERIMENTAL)" tristate "AD1816(A) based cards (EXPERIMENTAL)"
depends on EXPERIMENTAL && SOUND_OSS depends on EXPERIMENTAL && SOUND_OSS && OSS_OBSOLETE_DRIVER
help help
Say M here if you have a sound card based on the Analog Devices Say M here if you have a sound card based on the Analog Devices
AD1816(A) chip. AD1816(A) chip.
...@@ -481,21 +464,21 @@ config SOUND_AD1816 ...@@ -481,21 +464,21 @@ config SOUND_AD1816
config SOUND_AD1889 config SOUND_AD1889
tristate "AD1889 based cards (AD1819 codec) (EXPERIMENTAL)" tristate "AD1889 based cards (AD1819 codec) (EXPERIMENTAL)"
depends on EXPERIMENTAL && SOUND_OSS && PCI depends on EXPERIMENTAL && SOUND_OSS && PCI && OSS_OBSOLETE_DRIVER
help help
Say M here if you have a sound card based on the Analog Devices Say M here if you have a sound card based on the Analog Devices
AD1889 chip. AD1889 chip.
config SOUND_ADLIB config SOUND_ADLIB
tristate "Adlib Cards" tristate "Adlib Cards"
depends on SOUND_OSS depends on SOUND_OSS && OSS_OBSOLETE_DRIVER
help help
Includes ASB 64 4D. Information on programming AdLib cards is Includes ASB 64 4D. Information on programming AdLib cards is
available at <http://www.itsnet.com/home/ldragon/Specs/adlib.html>. available at <http://www.itsnet.com/home/ldragon/Specs/adlib.html>.
config SOUND_ACI_MIXER config SOUND_ACI_MIXER
tristate "ACI mixer (miroSOUND PCM1-pro/PCM12/PCM20)" tristate "ACI mixer (miroSOUND PCM1-pro/PCM12/PCM20)"
depends on SOUND_OSS depends on SOUND_OSS && OSS_OBSOLETE_DRIVER
---help--- ---help---
ACI (Audio Command Interface) is a protocol used to communicate with ACI (Audio Command Interface) is a protocol used to communicate with
the microcontroller on some sound cards produced by miro and the microcontroller on some sound cards produced by miro and
...@@ -617,7 +600,7 @@ config SOUND_MPU401 ...@@ -617,7 +600,7 @@ config SOUND_MPU401
config SOUND_NM256 config SOUND_NM256
tristate "NM256AV/NM256ZX audio support" tristate "NM256AV/NM256ZX audio support"
depends on SOUND_OSS depends on SOUND_OSS && OSS_OBSOLETE_DRIVER
help help
Say M here to include audio support for the NeoMagic 256AV/256ZX Say M here to include audio support for the NeoMagic 256AV/256ZX
chipsets. These are the audio chipsets found in the Sony chipsets. These are the audio chipsets found in the Sony
...@@ -737,7 +720,7 @@ config SOUND_YM3812 ...@@ -737,7 +720,7 @@ config SOUND_YM3812
config SOUND_OPL3SA2 config SOUND_OPL3SA2
tristate "Yamaha OPL3-SA2 and SA3 based PnP cards" tristate "Yamaha OPL3-SA2 and SA3 based PnP cards"
depends on SOUND_OSS depends on SOUND_OSS && OSS_OBSOLETE_DRIVER
help help
Say Y or M if you have a card based on one of these Yamaha sound Say Y or M if you have a card based on one of these Yamaha sound
chipsets or the "SAx", which is actually a SA3. Read chipsets or the "SAx", which is actually a SA3. Read
...@@ -869,7 +852,7 @@ config SOUND_WAVEARTIST ...@@ -869,7 +852,7 @@ config SOUND_WAVEARTIST
config SOUND_TVMIXER config SOUND_TVMIXER
tristate "TV card (bt848) mixer support" tristate "TV card (bt848) mixer support"
depends on SOUND_PRIME && I2C depends on SOUND_PRIME && I2C && VIDEO_V4L1
help help
Support for audio mixer facilities on the BT848 TV frame-grabber Support for audio mixer facilities on the BT848 TV frame-grabber
card. card.
......
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