Hello,
attached patch changes primarily h5400.c -- addsone structure, which
is required in order to get pxaficp_ir working properly. It also
modifies one comment in h5400-gpio.c, so everyone in the future will
know that IRDA_SD means "IrDA transceiver shutdown" :). It was tested at
least with one siemens phone, I was able to receive ~250KByte file, so
it probably works:).
This patch was only tested on h5550 device, which contains only SIR
controller. I'm not sure how the other devices (namely h54xx ones,
capable of CIR) will behave.
Milan
h5000 IrDA fix
From: Milan Plzik <milan.plzik_at_gmail.com>
---
arch/arm/mach-pxa/h5400/h5400.c | 30 +++++++++++++++++++++++++++++-
include/asm-arm/arch-pxa/h5400-gpio.h | 4 ++--
2 files changed, 31 insertions(+), 3 deletions(-)
diff --git a/arch/arm/mach-pxa/h5400/h5400.c b/arch/arm/mach-pxa/h5400/h5400.c
index f87415d..ea4b677 100644
--- a/arch/arm/mach-pxa/h5400/h5400.c
+++ b/arch/arm/mach-pxa/h5400/h5400.c
@@ -63,6 +63,7 @@
#include <asm/arch/serial.h>
#include <asm/arch/pxa-dmabounce.h>
#include <asm/arch/irq.h>
+#include <asm/arch/irda.h>
#include <asm/types.h>
#include <linux/mfd/samcop_base.h>
#include <asm/hardware/samcop_leds.h>
@@ -97,6 +98,32 @@ static int h5400_dma_needs_bounce (struct device *dev, dma_addr_t addr, size_t s
};
/****************************************************************************
+ * PXA IrDA functions and data structures
+ ****************************************************************************/
+
+static void h5000_irda_transceiver_mode(struct device *dev, int mode)
+{
+ unsigned long flags;
+ local_irq_save(flags);
+
+ if (mode & IR_OFF) {
+ SET_H5400_GPIO(IRDA_SD, 1);
+ } else {
+ SET_H5400_GPIO(IRDA_SD, 0);
+ };
+
+ local_irq_restore(flags);
+}
+
+
+static struct pxaficp_platform_data h5000_ficp_platform_data = {
+ .transceiver_cap = IR_SIRMODE | IR_OFF,
+ .transceiver_mode = h5000_irda_transceiver_mode,
+};
+
+
+
+/****************************************************************************
* Bluetooth functions and data structures
****************************************************************************/
@@ -507,7 +534,7 @@ static short h5400_gpio_modes[] __initdata = {
GPIO_NR_H5400_IRDA_SD | GPIO_OUT, /* GPIO58 */
59 | GPIO_OUT, /* GPIO59 XXX docs say "usb charge on" input */
GPIO_NR_H5400_POWER_SD_N | GPIO_OUT, /* GPIO60 XXX not really active low? */
- GPIO_NR_H5400_POWER_RS232_OR_FS_N | GPIO_OUT | GPIO_DFLT_HIGH,
+ GPIO_NR_H5400_POWER_RS232_N_OR_FS | GPIO_OUT | GPIO_DFLT_HIGH,
GPIO_NR_H5400_POWER_ACCEL_N | GPIO_OUT | GPIO_DFLT_HIGH,
63 | GPIO_OUT, /* GPIO63 NC */
GPIO_NR_H5400_OPT_NVRAM | GPIO_OUT ,
@@ -741,6 +768,7 @@ h5400_init (void)
platform_device_register (&h5000_gpiodev_keys2);
pxa_set_udc_info (&h5400_udc_mach_info);
pxa_set_dma_needs_bounce (h5400_dma_needs_bounce);
+ pxa_set_ficp_info (&h5000_ficp_platform_data);
}
MACHINE_START(H5400, "HP iPAQ H5400")
diff --git a/include/asm-arm/arch-pxa/h5400-gpio.h b/include/asm-arm/arch-pxa/h5400-gpio.h
index ff17bb6..ed594f0 100644
--- a/include/asm-arm/arch-pxa/h5400-gpio.h
+++ b/include/asm-arm/arch-pxa/h5400-gpio.h
@@ -85,10 +85,10 @@ else \
#define GPIO_NR_H5400_PWAIT_N 56 /* used for pcmcia */
#define GPIO_NR_H5400_IOIS16_N 57 /* used for pcmcia */
-#define GPIO_NR_H5400_IRDA_SD 58 /* to hsdl3002 sd */
+#define GPIO_NR_H5400_IRDA_SD 58 /* to hsdl3002 shutdown pin */
/* 59 not connected */
#define GPIO_NR_H5400_POWER_SD_N 60 /* controls power to SD */
-#define GPIO_NR_H5400_POWER_RS232_OR_FS_N 61 /* inverted FORCEON to rs232 transceiver or FCD*/
+#define GPIO_NR_H5400_POWER_RS232_N_OR_FS 61 /* inverted FORCEON to rs232 transceiver or FCD*/
#define GPIO_NR_H5400_POWER_ACCEL_N 62 /* controls power to accel */
/* 63 is not connected */
#define GPIO_NR_H5400_OPT_NVRAM 64 /* controls power to expansion pack */
Received on Sun Aug 19 2007 - 05:11:35 EDT
This archive was generated by hypermail 2.2.0 : Sun Aug 19 2007 - 05:11:53 EDT