Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 36033422 authored by Ian Molton's avatar Ian Molton
Browse files

[ARM] IrDA support for e7xx



This patchset provides a fully functional SIR IrDA driver for the Toshiba
e7xx PDAs.

Signed-off-by: default avatarIan Molton <spyro@f2s.com>
parent 5e1dbdb4
Loading
Loading
Loading
Loading
+6 −0
Original line number Original line Diff line number Diff line
@@ -25,6 +25,7 @@
#include <mach/mfp-pxa25x.h>
#include <mach/mfp-pxa25x.h>
#include <mach/hardware.h>
#include <mach/hardware.h>
#include <mach/udc.h>
#include <mach/udc.h>
#include <mach/irda.h>


#include "generic.h"
#include "generic.h"
#include "eseries.h"
#include "eseries.h"
@@ -118,6 +119,9 @@ static unsigned long e740_pin_config[] __initdata = {
	GPIO44_BTUART_CTS,
	GPIO44_BTUART_CTS,
	GPIO45_GPIO, /* Used by TMIO for #SUSPEND */
	GPIO45_GPIO, /* Used by TMIO for #SUSPEND */


	/* IrDA */
	GPIO38_GPIO | MFP_LPM_DRIVE_HIGH,

	/* PC Card */
	/* PC Card */
	GPIO8_GPIO,   /* CD0 */
	GPIO8_GPIO,   /* CD0 */
	GPIO44_GPIO,  /* CD1 */
	GPIO44_GPIO,  /* CD1 */
@@ -153,6 +157,8 @@ static void __init e740_init(void)
	pxa2xx_mfp_config(ARRAY_AND_SIZE(e740_pin_config));
	pxa2xx_mfp_config(ARRAY_AND_SIZE(e740_pin_config));
	platform_add_devices(devices, ARRAY_SIZE(devices));
	platform_add_devices(devices, ARRAY_SIZE(devices));
	pxa_set_udc_info(&e7xx_udc_mach_info);
	pxa_set_udc_info(&e7xx_udc_mach_info);
	e7xx_irda_init();
	pxa_set_ficp_info(&e7xx_ficp_platform_data);
}
}


MACHINE_START(E740, "Toshiba e740")
MACHINE_START(E740, "Toshiba e740")
+3 −0
Original line number Original line Diff line number Diff line
@@ -25,6 +25,7 @@
#include <mach/mfp-pxa25x.h>
#include <mach/mfp-pxa25x.h>
#include <mach/hardware.h>
#include <mach/hardware.h>
#include <mach/udc.h>
#include <mach/udc.h>
#include <mach/irda.h>


#include "generic.h"
#include "generic.h"
#include "eseries.h"
#include "eseries.h"
@@ -110,6 +111,8 @@ static void __init e750_init(void)
{
{
	platform_add_devices(devices, ARRAY_SIZE(devices));
	platform_add_devices(devices, ARRAY_SIZE(devices));
	pxa_set_udc_info(&e7xx_udc_mach_info);
	pxa_set_udc_info(&e7xx_udc_mach_info);
	e7xx_irda_init();
	pxa_set_ficp_info(&e7xx_ficp_platform_data);
}
}


MACHINE_START(E750, "Toshiba e750")
MACHINE_START(E750, "Toshiba e750")
+43 −0
Original line number Original line Diff line number Diff line
@@ -12,6 +12,8 @@


#include <linux/kernel.h>
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/init.h>
#include <linux/gpio.h>
#include <linux/platform_device.h>


#include <asm/setup.h>
#include <asm/setup.h>
#include <asm/mach/arch.h>
#include <asm/mach/arch.h>
@@ -21,6 +23,7 @@
#include <mach/hardware.h>
#include <mach/hardware.h>
#include <mach/eseries-gpio.h>
#include <mach/eseries-gpio.h>
#include <mach/udc.h>
#include <mach/udc.h>
#include <mach/irda.h>


#include "generic.h"
#include "generic.h"


@@ -43,3 +46,43 @@ struct pxa2xx_udc_mach_info e7xx_udc_mach_info = {
	.gpio_pullup_inverted = 1
	.gpio_pullup_inverted = 1
};
};


static void e7xx_irda_transceiver_mode(struct device *dev, int mode)
{
	if (mode & IR_OFF) {
		gpio_set_value(GPIO_E7XX_IR_OFF, 1);
		pxa2xx_transceiver_mode(dev, mode);
	} else {
		pxa2xx_transceiver_mode(dev, mode);
		gpio_set_value(GPIO_E7XX_IR_OFF, 0);
	}
}

int e7xx_irda_init(void)
{
	int ret;

	ret = gpio_request(GPIO_E7XX_IR_OFF, "IrDA power");
	if (ret)
		goto out;

	ret = gpio_direction_output(GPIO_E7XX_IR_OFF, 0);
	if (ret)
		goto out;

	e7xx_irda_transceiver_mode(NULL, IR_SIRMODE | IR_OFF);
out:
	return ret;
}

static void e7xx_irda_shutdown(struct device *dev)
{
	e7xx_irda_transceiver_mode(dev, IR_SIRMODE | IR_OFF);
	gpio_free(GPIO_E7XX_IR_OFF);
}

struct pxaficp_platform_data e7xx_ficp_platform_data = {
	.transceiver_cap  = IR_SIRMODE | IR_OFF,
	.transceiver_mode = e7xx_irda_transceiver_mode,
	.shutdown = e7xx_irda_shutdown,
};
+3 −0
Original line number Original line Diff line number Diff line
@@ -2,3 +2,6 @@ void __init eseries_fixup(struct machine_desc *desc,
	struct tag *tags, char **cmdline, struct meminfo *mi);
	struct tag *tags, char **cmdline, struct meminfo *mi);


extern struct pxa2xx_udc_mach_info e7xx_udc_mach_info;
extern struct pxa2xx_udc_mach_info e7xx_udc_mach_info;
extern struct pxaficp_platform_data e7xx_ficp_platform_data;
extern int e7xx_irda_init(void);
+1 −1
Original line number Original line Diff line number Diff line
@@ -43,7 +43,7 @@
#define GPIO_E800_PCMCIA_PWR1    73
#define GPIO_E800_PCMCIA_PWR1    73


/* e7xx IrDA power control */
/* e7xx IrDA power control */
#define GPIO_E7XX_IR_ON          38
#define GPIO_E7XX_IR_OFF         38


/* ASIC related GPIOs */
/* ASIC related GPIOs */
#define GPIO_ESERIES_TMIO_IRQ        5
#define GPIO_ESERIES_TMIO_IRQ        5