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

Manual merge after pull from Linus' tree

parent da84b303
......@@ -18,9 +18,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#undef DEBUG
#include <linux/config.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/init.h>
......@@ -50,11 +48,7 @@
MODULE_DESCRIPTION("TPS6501x Power Management Driver");
MODULE_LICENSE("GPL");
/* only two addresses possible */
#define TPS_BASE 0x48
static unsigned short normal_i2c[] = {
TPS_BASE,
I2C_CLIENT_END };
static unsigned short normal_i2c[] = { 0x48, /* 0x49, */ I2C_CLIENT_END };
I2C_CLIENT_INSMOD;
......@@ -88,7 +82,6 @@ struct tps65010 {
struct i2c_client client;
struct mutex lock;
int irq;
int irq_type;
struct work_struct work;
struct dentry *file;
unsigned charging:1;
......@@ -103,10 +96,10 @@ struct tps65010 {
u8 chgstatus, regstatus, chgconf;
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)
(regstatus & TPS_REG_COVER) ? " uncover" : "",
(regstatus & TPS_REG_UVLO) ? " UVLO" : "",
(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_MAIN) ? " main_bad" : "",
(regstatus & TPS_REG_PG_CORE) ? " core_bad" : "");
......@@ -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)
{
char *hibit;
const char *hibit;
if (por)
hibit = (chgconfig & TPS_CHARGE_POR)
......@@ -296,7 +289,7 @@ static int dbg_show(struct seq_file *s, void *_)
seq_printf(s, "defgpio %02x mask3 %02x\n", value, v2);
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,
(value & (1 << i)) ? "low" : "hi ");
else
......@@ -482,7 +475,7 @@ static int __exit tps65010_detach_client(struct i2c_client *client)
debugfs_remove(tps->file);
if (i2c_detach_client(client) == 0)
kfree(tps);
the_tps = 0;
the_tps = NULL;
return 0;
}
......@@ -500,6 +493,7 @@ tps65010_probe(struct i2c_adapter *bus, int address, int kind)
{
struct tps65010 *tps;
int status;
unsigned long irqflags;
if (the_tps) {
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)
INIT_WORK(&tps->work, tps65010_work, tps);
tps->irq = -1;
tps->client.addr = address;
i2c_set_clientdata(&tps->client, tps);
tps->client.adapter = bus;
tps->client.driver = &tps65010_driver;
strlcpy(tps->client.name, DRIVER_NAME, I2C_NAME_SIZE);
......@@ -523,13 +516,13 @@ tps65010_probe(struct i2c_adapter *bus, int address, int kind)
if (status < 0) {
dev_dbg(&bus->dev, "can't attach %s to device %d, err %d\n",
DRIVER_NAME, address, status);
fail1:
kfree(tps);
return 0;
goto fail1;
}
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
if (machine_is_omap_h2()) {
tps->model = TPS65010;
......@@ -537,7 +530,7 @@ fail1:
tps->irq = OMAP_GPIO_IRQ(58);
omap_request_gpio(58);
omap_set_gpio_direction(58, 1);
tps->irq_type = SA_TRIGGER_FALLING;
irqflags |= IRQF_TRIGGER_FALLING;
}
if (machine_is_omap_osk()) {
tps->model = TPS65010;
......@@ -545,7 +538,7 @@ fail1:
tps->irq = OMAP_GPIO_IRQ(OMAP_MPUIO(1));
omap_request_gpio(OMAP_MPUIO(1));
omap_set_gpio_direction(OMAP_MPUIO(1), 1);
tps->irq_type = SA_TRIGGER_FALLING;
irqflags |= IRQF_TRIGGER_FALLING;
}
if (machine_is_omap_h3()) {
tps->model = TPS65013;
......@@ -556,7 +549,7 @@ fail1:
if (tps->irq > 0) {
status = request_irq(tps->irq, tps65010_irq,
tps->irq_type, DRIVER_NAME, tps);
irqflags, DRIVER_NAME, tps);
if (status < 0) {
dev_dbg(&tps->client.dev, "can't get IRQ %d, err %d\n",
tps->irq, status);
......@@ -632,6 +625,9 @@ fail1:
tps->file = debugfs_create_file(DRIVER_NAME, S_IRUGO, NULL,
tps, DEBUG_FOPS);
return 0;
fail1:
kfree(tps);
return 0;
}
static int __init tps65010_scan_bus(struct i2c_adapter *bus)
......@@ -643,9 +639,8 @@ static int __init tps65010_scan_bus(struct i2c_adapter *bus)
static struct i2c_driver tps65010_driver = {
.driver = {
.name = "tps65010",
.name = "tps65010",
},
.id = 888, /* FIXME assign "official" value */
.attach_adapter = tps65010_scan_bus,
.detach_client = __exit_p(tps65010_detach_client),
};
......@@ -699,14 +694,14 @@ int tps65010_set_gpio_out_value(unsigned gpio, unsigned value)
return -ENODEV;
if ((gpio < GPIO1) || (gpio > GPIO4))
return -EINVAL;
mutex_lock(&the_tps->lock);
defgpio = i2c_smbus_read_byte_data(&the_tps->client, TPS_DEFGPIO);
/* Configure GPIO for output */
defgpio |= 1 << (gpio + 3);
/* Writing 1 forces a logic 0 on that GPIO and vice versa */
switch (value) {
case LOW:
......@@ -717,14 +712,14 @@ int tps65010_set_gpio_out_value(unsigned gpio, unsigned value)
defgpio &= ~(1 << (gpio - 1)); /* set GPIO high by writing 0 */
break;
}
status = i2c_smbus_write_byte_data(&the_tps->client,
TPS_DEFGPIO, defgpio);
pr_debug("%s: gpio%dout = %s, defgpio 0x%02x\n", DRIVER_NAME,
gpio, value ? "high" : "low",
i2c_smbus_read_byte_data(&the_tps->client, TPS_DEFGPIO));
mutex_unlock(&the_tps->lock);
return status;
}
......@@ -743,7 +738,7 @@ int tps65010_set_led(unsigned led, unsigned mode)
if (!the_tps)
return -ENODEV;
if(led == LED1)
if (led == LED1)
offs = 0;
else {
offs = 2;
......@@ -752,12 +747,14 @@ int tps65010_set_led(unsigned led, unsigned mode)
mutex_lock(&the_tps->lock);
dev_dbg (&the_tps->client.dev, "led%i_on 0x%02x\n", led,
i2c_smbus_read_byte_data(&the_tps->client, TPS_LED1_ON + offs));
pr_debug("%s: led%i_on 0x%02x\n", DRIVER_NAME, led,
i2c_smbus_read_byte_data(&the_tps->client,
TPS_LED1_ON + offs));
pr_debug("%s: led%i_per 0x%02x\n", DRIVER_NAME, led,
i2c_smbus_read_byte_data(&the_tps->client,
TPS_LED1_PER + offs));
dev_dbg (&the_tps->client.dev, "led%i_per 0x%02x\n", led,
i2c_smbus_read_byte_data(&the_tps->client, TPS_LED1_PER + offs));
switch (mode) {
case OFF:
led_on = 1 << 7;
......@@ -772,7 +769,7 @@ int tps65010_set_led(unsigned led, unsigned mode)
led_per = 0x08 | (1 << 7);
break;
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);
mutex_unlock(&the_tps->lock);
return -EINVAL;
......@@ -782,27 +779,28 @@ int tps65010_set_led(unsigned led, unsigned mode)
TPS_LED1_ON + offs, led_on);
if (status != 0) {
printk(KERN_ERR "%s: Failed to write led%i_on register\n",
printk(KERN_ERR "%s: Failed to write led%i_on register\n",
DRIVER_NAME, led);
mutex_unlock(&the_tps->lock);
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));
status = i2c_smbus_write_byte_data(&the_tps->client,
TPS_LED1_PER + offs, led_per);
if (status != 0) {
printk(KERN_ERR "%s: Failed to write led%i_per register\n",
printk(KERN_ERR "%s: Failed to write led%i_per register\n",
DRIVER_NAME, led);
mutex_unlock(&the_tps->lock);
return status;
}
dev_dbg (&the_tps->client.dev, "led%i_per 0x%02x\n", led,
i2c_smbus_read_byte_data(&the_tps->client, TPS_LED1_PER + offs));
pr_debug("%s: led%i_per 0x%02x\n", DRIVER_NAME, led,
i2c_smbus_read_byte_data(&the_tps->client,
TPS_LED1_PER + offs));
mutex_unlock(&the_tps->lock);
......@@ -857,7 +855,7 @@ int tps65010_set_low_pwr(unsigned mode)
i2c_smbus_read_byte_data(&the_tps->client, TPS_VDCDC1));
vdcdc1 = i2c_smbus_read_byte_data(&the_tps->client, TPS_VDCDC1);
switch (mode) {
case OFF:
vdcdc1 &= ~TPS_ENABLE_LP; /* disable ENABLE_LP bit */
......@@ -872,8 +870,8 @@ int tps65010_set_low_pwr(unsigned mode)
TPS_VDCDC1, vdcdc1);
if (status != 0)
printk(KERN_ERR "%s: Failed to write vdcdc1 register\n",
DRIVER_NAME);
printk(KERN_ERR "%s: Failed to write vdcdc1 register\n",
DRIVER_NAME);
else
pr_debug("%s: vdcdc1 0x%02x\n", DRIVER_NAME,
i2c_smbus_read_byte_data(&the_tps->client, TPS_VDCDC1));
......@@ -898,15 +896,15 @@ int tps65010_config_vregs1(unsigned value)
mutex_lock(&the_tps->lock);
pr_debug("%s: vregs1 0x%02x\n", DRIVER_NAME,
i2c_smbus_read_byte_data(&the_tps->client, TPS_VREGS1));
pr_debug("%s: vregs1 0x%02x\n", DRIVER_NAME,
i2c_smbus_read_byte_data(&the_tps->client, TPS_VREGS1));
status = i2c_smbus_write_byte_data(&the_tps->client,
TPS_VREGS1, value);
if (status != 0)
printk(KERN_ERR "%s: Failed to write vregs1 register\n",
DRIVER_NAME);
printk(KERN_ERR "%s: Failed to write vregs1 register\n",
DRIVER_NAME);
else
pr_debug("%s: vregs1 0x%02x\n", DRIVER_NAME,
i2c_smbus_read_byte_data(&the_tps->client, TPS_VREGS1));
......@@ -1008,7 +1006,7 @@ static int __init tps_init(void)
msleep(10);
}
#if defined(CONFIG_ARM)
#ifdef CONFIG_ARM
if (machine_is_omap_osk()) {
// FIXME: More should be placed in the initialization code
......@@ -1048,8 +1046,8 @@ static int __init tps_init(void)
} else if (machine_is_omap_h3()) {
/* gpio4 for SD, gpio3 for VDD_DSP */
#ifdef CONFIG_PM
/* FIXME: Enable LOW_PWR hangs H3 */
//tps65013_set_low_pwr(ON);
/* Enable LOW_PWR */
tps65013_set_low_pwr(ON);
#endif
}
#endif
......
......@@ -5,36 +5,19 @@
#
# Prompt user for primary drivers.
config SOUND_OMAP
tristate "OMAP Sound Driver"
depends on SOUND_PRIME!=n && SOUND && ARCH_OMAP
---help---
OMAP Audio driver
config OSS_OBSOLETE_DRIVER
bool "Obsolete OSS drivers"
depends on SOUND_PRIME
help
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
tristate "TSC2101 Stereo Codec"
depends on SOUND_OMAP && ( MACH_OMAP_H2 || MACH_OMAP_H3 || MACH_OMAP_H4 || MACH_OMAP_APOLLON)
select OMAP_TSC2101 if ( MACH_OMAP_H2 || MACH_OMAP_H3 )
select OMAP_UWIRE if ARCH_OMAP1
---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.
Please contact Adrian Bunk <bunk@stusta.de> if you had to
say Y here because your soundcard is not properly supported
by ALSA.
If unsure, say N.
config SOUND_BT878
tristate "BT878 audio dma"
......@@ -54,7 +37,7 @@ config SOUND_BT878
config SOUND_EMU10K1
tristate "Creative SBLive! (EMU10K1)"
depends on SOUND_PRIME && PCI
depends on SOUND_PRIME && PCI && OSS_OBSOLETE_DRIVER
---help---
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.
......@@ -62,7 +45,7 @@ config SOUND_EMU10K1
For more information on this driver and the degree of support for
the different card models please check:
<http://sourceforge.net/projects/emu10k1/>
<http://sourceforge.net/projects/emu10k1/>
It is now possible to load dsp microcode patches into the EMU10K1
chip. These patches are used to implement real time sound
......@@ -80,7 +63,7 @@ config MIDI_EMU10K1
config SOUND_FUSION
tristate "Crystal SoundFusion (CS4280/461x)"
depends on SOUND_PRIME && PCI
depends on SOUND_PRIME && PCI && OSS_OBSOLETE_DRIVER
help
This module drives the Crystal SoundFusion devices (CS4280/46xx
series) when wired as native sound drivers with AC97 codecs. If
......@@ -171,7 +154,7 @@ config SOUND_TRIDENT
system support" and "Sysctl support", and after the /proc file
system has been mounted, executing the command
command what is enabled
command what is enabled
echo 0>/proc/ALi5451 pcm out is also set to S/PDIF out. (Default).
......@@ -471,7 +454,7 @@ config SOUND_DMAP
config SOUND_AD1816
tristate "AD1816(A) based cards (EXPERIMENTAL)"
depends on EXPERIMENTAL && SOUND_OSS
depends on EXPERIMENTAL && SOUND_OSS && OSS_OBSOLETE_DRIVER
help
Say M here if you have a sound card based on the Analog Devices
AD1816(A) chip.
......@@ -481,21 +464,21 @@ config SOUND_AD1816
config SOUND_AD1889
tristate "AD1889 based cards (AD1819 codec) (EXPERIMENTAL)"
depends on EXPERIMENTAL && SOUND_OSS && PCI
depends on EXPERIMENTAL && SOUND_OSS && PCI && OSS_OBSOLETE_DRIVER
help
Say M here if you have a sound card based on the Analog Devices
AD1889 chip.
config SOUND_ADLIB
tristate "Adlib Cards"
depends on SOUND_OSS
depends on SOUND_OSS && OSS_OBSOLETE_DRIVER
help
Includes ASB 64 4D. Information on programming AdLib cards is
available at <http://www.itsnet.com/home/ldragon/Specs/adlib.html>.
config SOUND_ACI_MIXER
tristate "ACI mixer (miroSOUND PCM1-pro/PCM12/PCM20)"
depends on SOUND_OSS
depends on SOUND_OSS && OSS_OBSOLETE_DRIVER
---help---
ACI (Audio Command Interface) is a protocol used to communicate with
the microcontroller on some sound cards produced by miro and
......@@ -617,7 +600,7 @@ config SOUND_MPU401
config SOUND_NM256
tristate "NM256AV/NM256ZX audio support"
depends on SOUND_OSS
depends on SOUND_OSS && OSS_OBSOLETE_DRIVER
help
Say M here to include audio support for the NeoMagic 256AV/256ZX
chipsets. These are the audio chipsets found in the Sony
......@@ -737,7 +720,7 @@ config SOUND_YM3812
config SOUND_OPL3SA2
tristate "Yamaha OPL3-SA2 and SA3 based PnP cards"
depends on SOUND_OSS
depends on SOUND_OSS && OSS_OBSOLETE_DRIVER
help
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
......@@ -869,7 +852,7 @@ config SOUND_WAVEARTIST
config SOUND_TVMIXER
tristate "TV card (bt848) mixer support"
depends on SOUND_PRIME && I2C
depends on SOUND_PRIME && I2C && VIDEO_V4L1
help
Support for audio mixer facilities on the BT848 TV frame-grabber
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