Hm. My experience is that bluetooth lives on ttyS3. While I havn't
gotten a connection working yet, I can pole and get information from my
phone and my phone sees my ipaq. I'm using an ipaq 4350 which has a
keyboard so my settings may be different. My keyboard lives on ttyS2,
my screen lives on ttyS0, and my bluetooth lives on ttyS3 so that just
leaves ttyS1 for IR (which I havn't used).
-Dan
Eugeny Boger wrote:
> Hello all.
>
> 1. I think there is a mistake in /etc/init.d/irattach script, IR port
> should be set to /dev/ttyS2 or /dev/tts/2 instead of bt /dev/ttyS1.
>
> With /dev/ttyS1, irattach is trying to power on bluetooth.
>
>
> 2. I wrote support for bluetooth indicator and fixed some bugs in
> charge indicator code. I think, now it is ready for use.
>
>
> 3. Seems like, OPIE couldn't power on/off bluetooth and irda on h4000.
> Also there isn't any LED and cpufreq support for 2.6 kernels. Are
> there any workarounds, or we need to rewrite opie bluetooth/IRda code ?
>
>------------------------------------------------------------------------
>
>--- h4000_batt.c-orig 2007-03-01 01:14:10.000000000 +0300
>+++ h4000_batt.c 2007-03-01 00:31:06.000000000 +0300
>@@ -16,6 +16,9 @@
> #include <linux/soc/asic3_base.h>
> #include <linux/platform_device.h>
> #include <linux/battery.h>
>+#include <linux/leds.h>
>+#include <asm/hardware/asic3_leds.h>
>+
>
> #include <asm/mach-types.h>
> #include <asm/arch/hardware.h>
>@@ -66,7 +69,7 @@
> extern u32 ads7846_ssp_putget(u32 data);
> static int h4000_get_sample(int source);
>
>-static struct timer_list timer_bat;
>+static struct timer_list timer_bat,timer_leds;
>
> static struct {
> int voltage;
>@@ -150,6 +153,34 @@
> .get_voltage = backup_get_voltage,
> };
>
>+DEFINE_LED_TRIGGER(charging_trig);
>+DEFINE_LED_TRIGGER(chargefull_trig);
>+
>+
>+static void
>+set_leds(int ac_status,/* int Current, int battery_life,*/ int battery_status) //Set LED states
>+{
>+ // printk("LED: status:%d Current:%d life:%d ; status: %d \n",ac_status,Current,battery_life,battery_status);
>+ if (ac_status == APM_AC_ONLINE){
>+ /* check battery status update LEDs. LEDs are off when on battery */
>+ if (battery_status!=APM_BATTERY_STATUS_CHARGING ) {
>+
>+ /* Green LED on solid, red off */
>+ led_trigger_event(chargefull_trig, LED_FULL);
>+ led_trigger_event(charging_trig, LED_OFF);
>+ } else {
>+ /* Red LED blinking, green off */
>+ led_trigger_event(chargefull_trig, LED_OFF);
>+ led_trigger_event(charging_trig, LED_FULL);
>+ }
>+ } else {
>+ /* No charging power is applied; both LEDs off */
>+ led_trigger_event(chargefull_trig, LED_OFF);
>+ led_trigger_event(charging_trig, LED_OFF);
>+ }
>+}
>+
>+
> static int h4000_get_sample(int source)
> {
> int sample, mux_b = 0, mux_d = 0;
>@@ -198,6 +229,33 @@
> mod_timer(&timer_bat, jiffies + (5000 * HZ) / 1000);
> }
>
>+static void h4000_leds_timer_func(unsigned long nr)
>+{
>+ /* I can't figure out how set callback function to AC status change event, so I just use timer */
>+ int ac_line_status, battery_status;
>+ //printk("**led timer func\n");
>+ if (!GET_H4000_GPIO(AC_IN_N))
>+ ac_line_status = APM_AC_ONLINE;
>+ else
>+ ac_line_status = APM_AC_OFFLINE;
>+
>+ if (GET_H4000_GPIO(CHARGING))
>+ battery_status = APM_BATTERY_STATUS_CHARGING;
>+ else
>+ battery_status = APM_BATTERY_STATUS_NOT_PRESENT;
>+
>+ set_leds(ac_line_status, battery_status);
>+
>+ mod_timer(&timer_leds, jiffies + (1500 * HZ) / 1000);
>+
>+}
>+
>+
>+
>+/*
>+*/
>+
>+
> static void h4000_apm_get_power_status(struct apm_power_info *info)
> {
> int battery_power = ((h4000_batt_info.voltage - BATTERY_MIN) * 100) / (BATTERY_MAX - BATTERY_MIN);
>@@ -233,6 +291,8 @@
> info->units = APM_UNITS_MINS;
> }
>
>+
>+
> static int h4000_batt_probe(struct platform_device *dev)
> {
> int retval;
>@@ -243,9 +303,16 @@
> init_timer(&timer_bat);
> timer_bat.function = h4000_battery_timer_func;
> timer_bat.data = (unsigned long)NULL;
>+
> // Still schedule next sampling soon
> mod_timer(&timer_bat, jiffies + (500 * HZ) / 1000);
>
>+
>+ init_timer(&timer_leds);
>+ timer_leds.function = h4000_leds_timer_func;
>+ timer_leds.data = (unsigned long)NULL;
>+ mod_timer(&timer_leds, jiffies + (500 * HZ) / 1000);
>+
> #ifdef CONFIG_PM
> apm_get_power_status = h4000_apm_get_power_status;
> #endif
>@@ -270,6 +337,11 @@
> {
> if (!machine_is_h4000())
> return -ENODEV;
>+ /* Initializing LED triggers, solid for chargefull, blinking for charging */
>+ led_trigger_register_simple("h4000-chargefull", &chargefull_trig);
>+ led_trigger_register_asic3_timer("h4000-charging", &charging_trig);
>+ led_trigger_event(chargefull_trig, LED_OFF);
>+ led_trigger_event(charging_trig, LED_OFF);
>
> return platform_driver_register(&h4000_batt_driver);
> }
>@@ -277,7 +349,12 @@
> static void __exit h4000_batt_exit(void)
> {
> del_timer_sync(&timer_bat);
>+ del_timer_sync(&timer_leds);
>+ led_trigger_unregister_simple(chargefull_trig);
>+ led_trigger_unregister_asic3_timer(charging_trig);
>+
> platform_driver_unregister(&h4000_batt_driver);
>+
> }
>
> module_init(h4000_batt_init)
>
>
>------------------------------------------------------------------------
>
>--- h4000_bt.c-orig 2007-03-01 01:14:10.000000000 +0300
>+++ h4000_bt.c 2007-03-01 00:04:18.000000000 +0300
>@@ -20,6 +20,10 @@
>
> #include <asm/hardware.h>
>
>+#include <linux/leds.h>
>+#include <asm/hardware/asic3_leds.h>
>+
>+
> #include <asm/arch/pxa-regs.h>
> #include <asm/arch/serial.h>
> #include <asm/arch/h4000-gpio.h>
>@@ -34,6 +38,9 @@
> #define BTUART_IDX 0
> #define HWUART_IDX 1
>
>+DEFINE_LED_TRIGGER(bt_trig);
>+
>+
> static void h4000_bluetooth_power(int uart, int on)
> {
> int tries;
>@@ -56,6 +63,8 @@
> } while (((uart ? HWMSR : BTMSR) & MSR_CTS) == 0 && ++tries < 50);
> printk("BRF initialization delay: %d0ms\n", tries);
>
>+ led_trigger_event(bt_trig, LED_FULL);
>+
> } else {
> DPM_DEBUG("h4000_bt: Turning off\n");
> asic3_set_gpio_out_b(&h4000_asic3.dev, GPIOB_BT_WAKE_UP, 0);
>@@ -64,6 +73,7 @@
> asic3_set_gpio_out_c(&h4000_asic3.dev, GPIOC_BLUETOOTH_3V3_ON, 0);
> // Just in case we'll activated immediately again, we should delay here
> mdelay(10);
>+ led_trigger_event(bt_trig, LED_OFF);
> }
> }
>
>@@ -151,12 +161,16 @@
> {
> printk(KERN_INFO "h4000 Bluetooth Driver\n");
> platform_driver_register(&bluetooth_driver);
>+ led_trigger_register_simple("h4000-bt", &bt_trig);
>+ led_trigger_event(bt_trig, LED_OFF);
>+
>
> return 0;
> }
>
> static void __exit h4000_bluetooth_exit(void)
>-{
>+{
>+ led_trigger_unregister_simple(bt_trig);
> platform_driver_unregister(&bluetooth_driver);
> }
>
>
>
>------------------------------------------------------------------------
>
>_______________________________________________
>H4100-port mailing list
>H4100-port_at_handhelds.org
>https://www.handhelds.org/mailman/listinfo/h4100-port
>
>
Received on Wed Feb 28 2007 - 18:55:35 EST
This archive was generated by hypermail 2.2.0 : Wed Feb 28 2007 - 18:55:53 EST