Skip to content

Commit

Permalink
ARM: OMAP: Remove old dead gpio expander code
Browse files Browse the repository at this point in the history
This should be done with GPIO calls. Patches against the
mainline tree welcome to add the necessary working functionality
back.

Signed-off-by: Tony Lindgren <tony@atomide.com>
  • Loading branch information
Tony Lindgren committed Apr 23, 2009
1 parent da1b94e commit ba16ec7
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 235 deletions.
101 changes: 0 additions & 101 deletions arch/arm/mach-omap1/board-h3.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,10 @@
#include <asm/mach/flash.h>
#include <asm/mach/map.h>

#include <mach/gpioexpander.h>
#include <mach/irqs.h>
#include <mach/mux.h>
#include <mach/tc.h>
#include <mach/nand.h>
#include <mach/irda.h>
#include <mach/usb.h>
#include <mach/keypad.h>
#include <mach/dma.h>
Expand Down Expand Up @@ -276,104 +274,6 @@ static struct platform_device h3_kp_device = {
.resource = h3_kp_resources,
};


/* Select between the IrDA and aGPS module
*/
static int h3_select_irda(struct device *dev, int state)
{
unsigned char expa;
int err = 0;

if ((err = read_gpio_expa(&expa, 0x26))) {
printk(KERN_ERR "Error reading from I/O EXPANDER \n");
return err;
}

/* 'P6' enable/disable IRDA_TX and IRDA_RX */
if (state & IR_SEL) { /* IrDA */
if ((err = write_gpio_expa(expa | 0x40, 0x26))) {
printk(KERN_ERR "Error writing to I/O EXPANDER \n");
return err;
}
} else {
if ((err = write_gpio_expa(expa & ~0x40, 0x26))) {
printk(KERN_ERR "Error writing to I/O EXPANDER \n");
return err;
}
}
return err;
}

static void set_trans_mode(struct work_struct *work)
{
struct omap_irda_config *irda_config =
container_of(work, struct omap_irda_config, gpio_expa.work);
int mode = irda_config->mode;
unsigned char expa;
int err = 0;

if ((err = read_gpio_expa(&expa, 0x27)) != 0) {
printk(KERN_ERR "Error reading from I/O expander\n");
}

expa &= ~0x03;

if (mode & IR_SIRMODE) {
expa |= 0x01;
} else { /* MIR/FIR */
expa |= 0x03;
}

if ((err = write_gpio_expa(expa, 0x27)) != 0) {
printk(KERN_ERR "Error writing to I/O expander\n");
}
}

static int h3_transceiver_mode(struct device *dev, int mode)
{
struct omap_irda_config *irda_config = dev->platform_data;

irda_config->mode = mode;
cancel_delayed_work(&irda_config->gpio_expa);
PREPARE_DELAYED_WORK(&irda_config->gpio_expa, set_trans_mode);
schedule_delayed_work(&irda_config->gpio_expa, 0);

return 0;
}

static struct omap_irda_config h3_irda_data = {
.transceiver_cap = IR_SIRMODE | IR_MIRMODE | IR_FIRMODE,
.transceiver_mode = h3_transceiver_mode,
.select_irda = h3_select_irda,
.rx_channel = OMAP_DMA_UART3_RX,
.tx_channel = OMAP_DMA_UART3_TX,
.dest_start = UART3_THR,
.src_start = UART3_RHR,
.tx_trigger = 0,
.rx_trigger = 0,
};

static struct resource h3_irda_resources[] = {
[0] = {
.start = INT_UART3,
.end = INT_UART3,
.flags = IORESOURCE_IRQ,
},
};

static u64 irda_dmamask = 0xffffffff;

static struct platform_device h3_irda_device = {
.name = "omapirda",
.id = 0,
.dev = {
.platform_data = &h3_irda_data,
.dma_mask = &irda_dmamask,
},
.num_resources = ARRAY_SIZE(h3_irda_resources),
.resource = h3_irda_resources,
};

static struct platform_device h3_lcd_device = {
.name = "lcd_h3",
.id = -1,
Expand All @@ -395,7 +295,6 @@ static struct platform_device *devices[] __initdata = {
&nand_device,
&smc91x_device,
&intlat_device,
&h3_irda_device,
&h3_kp_device,
&h3_lcd_device,
};
Expand Down
95 changes: 0 additions & 95 deletions arch/arm/mach-omap2/board-h4.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,8 @@

#include <mach/control.h>
#include <mach/gpio.h>
#include <mach/gpioexpander.h>
#include <mach/mux.h>
#include <mach/usb.h>
#include <mach/irda.h>
#include <mach/board.h>
#include <mach/common.h>
#include <mach/keypad.h>
Expand Down Expand Up @@ -138,98 +136,6 @@ static struct platform_device h4_flash_device = {
.resource = &h4_flash_resource,
};

/* Select between the IrDA and aGPS module
*/
static int h4_select_irda(struct device *dev, int state)
{
unsigned char expa;
int err = 0;

if ((err = read_gpio_expa(&expa, 0x21))) {
printk(KERN_ERR "Error reading from I/O expander\n");
return err;
}

/* 'P6' enable/disable IRDA_TX and IRDA_RX */
if (state & IR_SEL) { /* IrDa */
if ((err = write_gpio_expa(expa | 0x01, 0x21))) {
printk(KERN_ERR "Error writing to I/O expander\n");
return err;
}
} else {
if ((err = write_gpio_expa(expa & ~0x01, 0x21))) {
printk(KERN_ERR "Error writing to I/O expander\n");
return err;
}
}
return err;
}

static void set_trans_mode(struct work_struct *work)
{
struct omap_irda_config *irda_config =
container_of(work, struct omap_irda_config, gpio_expa.work);
int mode = irda_config->mode;
unsigned char expa;
int err = 0;

if ((err = read_gpio_expa(&expa, 0x20)) != 0) {
printk(KERN_ERR "Error reading from I/O expander\n");
}

expa &= ~0x01;

if (!(mode & IR_SIRMODE)) { /* MIR/FIR */
expa |= 0x01;
}

if ((err = write_gpio_expa(expa, 0x20)) != 0) {
printk(KERN_ERR "Error writing to I/O expander\n");
}
}

static int h4_transceiver_mode(struct device *dev, int mode)
{
struct omap_irda_config *irda_config = dev->platform_data;

irda_config->mode = mode;
cancel_delayed_work(&irda_config->gpio_expa);
PREPARE_DELAYED_WORK(&irda_config->gpio_expa, set_trans_mode);
schedule_delayed_work(&irda_config->gpio_expa, 0);

return 0;
}

static struct omap_irda_config h4_irda_data = {
.transceiver_cap = IR_SIRMODE | IR_MIRMODE | IR_FIRMODE,
.transceiver_mode = h4_transceiver_mode,
.select_irda = h4_select_irda,
.rx_channel = OMAP24XX_DMA_UART3_RX,
.tx_channel = OMAP24XX_DMA_UART3_TX,
.dest_start = OMAP_UART3_BASE,
.src_start = OMAP_UART3_BASE,
.tx_trigger = OMAP24XX_DMA_UART3_TX,
.rx_trigger = OMAP24XX_DMA_UART3_RX,
};

static struct resource h4_irda_resources[] = {
[0] = {
.start = INT_24XX_UART3_IRQ,
.end = INT_24XX_UART3_IRQ,
.flags = IORESOURCE_IRQ,
},
};

static struct platform_device h4_irda_device = {
.name = "omapirda",
.id = -1,
.dev = {
.platform_data = &h4_irda_data,
},
.num_resources = 1,
.resource = h4_irda_resources,
};

static struct omap_kp_platform_data h4_kp_data = {
.rows = 6,
.cols = 7,
Expand All @@ -255,7 +161,6 @@ static struct platform_device h4_lcd_device = {

static struct platform_device *h4_devices[] __initdata = {
&h4_flash_device,
&h4_irda_device,
&h4_kp_device,
&h4_lcd_device,
};
Expand Down
35 changes: 0 additions & 35 deletions arch/arm/plat-omap/include/mach/gpioexpander.h

This file was deleted.

4 changes: 0 additions & 4 deletions arch/arm/plat-omap/include/mach/irda.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@ struct omap_irda_config {
int transceiver_cap;
int (*transceiver_mode)(struct device *dev, int mode);
int (*select_irda)(struct device *dev, int state);
/* Very specific to the needs of some platforms (h3,h4)
* having calls which can sleep in irda_set_speed.
*/
struct delayed_work gpio_expa;
int rx_channel;
int tx_channel;
unsigned long dest_start;
Expand Down

0 comments on commit ba16ec7

Please sign in to comment.