Skip to contentSkip to conversation

24xx Irda update

PATCH In review Komal Shah 2 participants 3 messages Jan 6, 2006 – Jan 12, 2006

Subsystems (6)
lore
Share & tools
lore

Komal Shah

author
#0 lore raw

PATCH 1/1 24xx Irda update

Tony,

Attached the updated IrDA patch (integrated workqueue) with 24xx support.

---Komal Shah
http://komalshah.blogspot.com/

__________________________________________
Yahoo! DSL – Something to write home about.
Just $16.99/mo. or less.
dsl.yahoo.com

arch/arm/mach-omap1/board-h2.c +44 -0
index 7335ad2..3bd850c 100644
@@ -36,6 +36,7 @@
 #include <asm/arch/gpio.h>
 #include <asm/arch/mux.h>
 #include <asm/arch/tc.h>
+#include <asm/arch/irda.h>
 #include <asm/arch/usb.h>
 #include <asm/arch/common.h>
 
@@ -171,10 +172,44 @@ static struct platform_device h2_smc91x_
 	.resource	= h2_smc91x_resources,
 };
 
+#define H2_IRDA_FIRSEL_GPIO_PIN	17
+
+static int h2_transceiver_mode(struct device *dev, int state)
+{
+	if (state & IR_SIRMODE)
+		omap_set_gpio_dataout(H2_IRDA_FIRSEL_GPIO_PIN, 0);
+	else    /* MIR/FIR */
+		omap_set_gpio_dataout(H2_IRDA_FIRSEL_GPIO_PIN, 1);
+		
+	return 0;
+}
+
+static struct omap_irda_config h2_irda_data = {
+	.transceiver_cap	= IR_SIRMODE | IR_MIRMODE | IR_FIRMODE,
+};
+
+static struct resource h2_irda_resources[] = {
+	[0] = {
+		.start	= INT_UART3,
+		.end	= INT_UART3,
+		.flags	= IORESOURCE_IRQ,
+	},
+};
+static struct platform_device h2_irda_device = {
+	.name		= "omapirda",
+	.id		= 0,
+	.dev		= {
+		.platform_data	= &h2_irda_data,
+	},
+	.num_resources	= ARRAY_SIZE(h2_irda_resources),
+	.resource	= h2_irda_resources,
+};
+
 static struct platform_device *h2_devices[] __initdata = {
 	&h2_nor_device,
 	&h2_nand_device,
 	&h2_smc91x_device,
+	&h2_irda_device,
 };
 
 static void __init h2_init_smc91x(void)
@@ -267,6 +302,15 @@ static void __init h2_init(void)
 	// omap_cfg_reg(U19_ARMIO1);		/* CD */
 	omap_cfg_reg(BALLOUT_V8_ARMIO3);	/* WP */
 
+	/* Irda */
+#if defined(CONFIG_OMAP_IR) || defined(CONFIG_OMAP_IR_MODULE)
+	omap_writel(omap_readl(FUNC_MUX_CTRL_A) | 7, FUNC_MUX_CTRL_A);
+	if (!(omap_request_gpio(H2_IRDA_FIRSEL_GPIO_PIN))) {
+		omap_set_gpio_direction(H2_IRDA_FIRSEL_GPIO_PIN, 0);
+		h2_irda_data.transceiver_mode = h2_transceiver_mode;
+	}
+#endif
+
 	platform_add_devices(h2_devices, ARRAY_SIZE(h2_devices));
 	omap_board_config = h2_config;
 	omap_board_config_size = ARRAY_SIZE(h2_config);
arch/arm/mach-omap1/board-h3.c +88 -0

114 lines not on this page · raw message

arch/arm/mach-omap2/board-h4.c +91 -0

120 lines not on this page · raw message

arch/arm/mach-omap2/clock.c +0 -0
arch/arm/mach-omap2/mux.c +4 -0
index ea46548..9e6b79f 100644
@@ -54,6 +54,10 @@ MUX_CFG_24XX("W19_24XX_SYS_NIRQ",	0x12c,
 MUX_CFG_24XX("Y20_24XX_GPIO60",		0x12c,	3,	0,	0,	1)
 MUX_CFG_24XX("M15_24XX_GPIO92",		0x10a,	3,	0,	0,	1)
 
+/* UART3  */
+MUX_CFG_24XX("K15_24XX_UART3_TX",	0x118,	0,	0,	0,	1)
+MUX_CFG_24XX("K14_24XX_UART3_RX",	0x119,	0,	0,	0,	1)
+
 };
 
 int __init omap2_mux_init(void)
drivers/net/irda/Kconfig +5 -5
index b200c50..b4562c2 100644
@@ -341,12 +341,12 @@ config TOSHIBA_FIR
 	  To compile it as a module, choose M here: the module will be called
 	  donauboe.
 
-config OMAP1610_IR
-        tristate "OMAP1610 IrDA(SIR/MIR/FIR)"
-	depends on IRDA && ARCH_OMAP
-	select GPIOEXPANDER_OMAP if MACH_OMAP_H3
+config OMAP_IR
+        tristate "OMAP IrDA(SIR/MIR/FIR)"
+	depends on IRDA && (ARCH_OMAP1 || ARCH_OMAP2)
+	select GPIOEXPANDER_OMAP if (MACH_OMAP_H3 || MACH_OMAP_H4)
         help
-          Say Y here if you want to build support for the Omap1610 IR.
+          Say Y here if you want to build support for the OMAP IR.
 
 config AU1000_FIR
 	tristate "Alchemy Au1000 SIR/FIR"
drivers/net/irda/Makefile +1 -1
index 7db79a2..494b0f8 100644
@@ -43,7 +43,7 @@ obj-$(CONFIG_OLD_BELKIN_DONGLE)	+= old_b
 obj-$(CONFIG_MCP2120_DONGLE)	+= mcp2120-sir.o
 obj-$(CONFIG_ACT200L_DONGLE)	+= act200l-sir.o
 obj-$(CONFIG_MA600_DONGLE)	+= ma600-sir.o
-obj-$(CONFIG_OMAP1610_IR)       += omap1610-ir.o
+obj-$(CONFIG_OMAP_IR)		+= omap-ir.o
 
 
 # The SIR helper module
drivers/net/irda/omap-ir.c new file +1022 -0

1,022 lines not on this page · raw message

drivers/net/irda/omap1610-ir.c deleted +0 -997

997 lines not on this page · raw message

include/asm-arm/arch-omap/irda.h new file +30 -0
new file mode 100644
index 0000000..ad71e4b
@@ -0,0 +1,30 @@
+/*
+ *  linux/include/asm-arm/arch-omap/irda.h
+ *
+ *  Copyright (C) 2005 Komal Shah <[email protected]>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+#ifndef ASMARM_ARCH_IRDA_H
+#define ASMARM_ARCH_IRDA_H
+
+/* board specific transceiver capabilities */
+
+#define IR_SEL		1	/* Selects IrDA */
+#define IR_SIRMODE	2
+#define IR_FIRMODE	4
+#define IR_MIRMODE	8
+
+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 work_struct gpio_expa;
+};
+
+#endif
include/asm-arm/arch-omap/irqs.h +1 -0
index 4ffce1d..42bb4c2 100644
@@ -242,6 +242,7 @@
 #define INT_24XX_GPIO_BANK2	30
 #define INT_24XX_GPIO_BANK3	31
 #define INT_24XX_GPIO_BANK4	32
+#define INT_24XX_UART3_IRQ	74
 
 /* Max. 128 level 2 IRQs (OMAP1610), 192 GPIOs (OMAP730) and
  * 16 MPUIO lines */
include/asm-arm/arch-omap/mux.h +5 -0
index 8d1c62e..9776338 100644
@@ -410,6 +410,11 @@ enum omap24xx_index {
 	/* 24xx GPIO */
 	Y20_24XX_GPIO60,
 	M15_24XX_GPIO92,
+
+	/* UART3 */
+	K15_24XX_UART3_TX,
+	K14_24XX_UART3_RX,
+
 };
 
 #ifdef	CONFIG_OMAP_MUX
author
#1 lore raw
Quoted 6 lines · --- Komal Shah

Tony,

Attached the updated IrDA patch (integrated workqueue) with 24xx support.

If everyone is happy with this patch, then please consider it for commit in tree. Thanx.

---Komal Shah
http://komalshah.blogspot.com/

__________________________________________
Yahoo! DSL – Something to write home about.
Just $16.99/mo. or less.
dsl.yahoo.com

maintainer
#2 lore raw
Quoted 11 lines · Komal Shah
Quoted 6 lines · --- Komal Shah

Tony,

Attached the updated IrDA patch (integrated workqueue) with 24xx support.

If everyone is happy with this patch, then please consider it for commit in tree. Thanx.

Sorry for the delay, pushing today, thanks.

Tony