Send commitlog mailing list submissions to
[email protected]
To subscribe or unsubscribe via the World Wide Web, visit
http://lists.openmoko.org/mailman/listinfo/commitlog
or, via email, send a message with subject or body 'help' to
[EMAIL PROTECTED]
You can reach the person managing the list at
[EMAIL PROTECTED]
When replying, please edit your Subject line so it is more specific
than "Re: Contents of commitlog digest..."
Today's Topics:
1. r1517 -
trunk/src/target/OM-2007/panel-plugins/openmoko-panel-gsm/src
([EMAIL PROTECTED])
2. r1518 - trunk/src/target/kernel/patches
([EMAIL PROTECTED])
3. r1519 - in
trunk/src/target/OM-2007/applications/openmoko-today: . src
([EMAIL PROTECTED])
4. r1520 - trunk/src/target/gsm/src/gsmd ([EMAIL PROTECTED])
5. r1521 -
trunk/src/target/OM-2007/panel-plugins/openmoko-panel-gsm/data
([EMAIL PROTECTED])
6. r1522 -
trunk/src/target/OM-2007/applications/openmoko-messages/src
([EMAIL PROTECTED])
--- Begin Message ---
Author: zhiyong_sun
Date: 2007-03-27 13:52:01 +0200 (Tue, 27 Mar 2007)
New Revision: 1517
Modified:
trunk/src/target/OM-2007/panel-plugins/openmoko-panel-gsm/src/moko-gsm-conn.c
trunk/src/target/OM-2007/panel-plugins/openmoko-panel-gsm/src/moko-gsm-conn.h
trunk/src/target/OM-2007/panel-plugins/openmoko-panel-gsm/src/openmoko-panel-gsm.c
Log:
fix lgsmd connection problem, success to get the value of gsm signal quality
Modified:
trunk/src/target/OM-2007/panel-plugins/openmoko-panel-gsm/src/moko-gsm-conn.c
===================================================================
---
trunk/src/target/OM-2007/panel-plugins/openmoko-panel-gsm/src/moko-gsm-conn.c
2007-03-27 08:34:31 UTC (rev 1516)
+++
trunk/src/target/OM-2007/panel-plugins/openmoko-panel-gsm/src/moko-gsm-conn.c
2007-03-27 11:52:01 UTC (rev 1517)
@@ -5,6 +5,9 @@
#include <libgsmd/libgsmd.h>
#include <libgsmd/event.h>
+#include <glib/gmain.h>
+#include <glib/giochannel.h>
+
#include "moko-gsm-conn.h"
#undef FALSE
@@ -13,29 +16,66 @@
#define TRUE 1
static struct lgsm_handle *lgsmh = NULL;
-static int signal_value = 0;
-static int updated = FALSE;
-static int gsm_conn_init = FALSE;
+static GPollFD GPfd;
+static int signal_value = -99;
-static int
-incall_handler(struct lgsm_handle *lh, int evt, struct gsmd_evt_auxdata *aux)
+static gboolean
+gsm_watcher_prepare (GSource * source, gint * timeout)
{
- printf("EVENT: Incoming call type = %u\n", aux->u.call.type);
- return 0;
+ *timeout = -1;
+
+ return FALSE;
}
+static gboolean
+gsm_watcher_check (GSource * source)
+{
+ if (GPfd.revents & (G_IO_IN | G_IO_PRI))
+ {
+ return TRUE;
+ }
+ else
+ {
+ return FALSE;
+ }
+
+}
+static gboolean
+gsm_watcher_dispatch (GSource * source,
+ GSourceFunc callback, gpointer user_data)
+{
+ int rc;
+ char buf[STDIN_BUF_SIZE + 1];
+ int gsm_fd = lgsm_fd (lgsmh);
+ /* we've received something on the gsmd socket, pass it
+ * on to the library */
+
+ rc = read (gsm_fd, buf, sizeof (buf));
+ if (rc <= 0)
+ {
+ return FALSE;
+ }
+ else
+ {
+ rc = lgsm_handle_packet (lgsmh, buf, rc);
+ }
+
+ return TRUE;
+}
+
static int
sigq_handler(struct lgsm_handle *lh, int evt, struct gsmd_evt_auxdata *aux)
{
printf("EVENT: Signal Quality: %u\n", aux->u.signal.sigq.rssi);
- //signal_value = aux->u.signal.sigq.rssi;
+ signal_value = aux->u.signal.sigq.rssi;
+ //FIXME: Call panel applet image change function here, instead of use g
timeout function to check singal value
return 0;
}
static int
netreg_handler(struct lgsm_handle *lh, int evt, struct gsmd_evt_auxdata *aux)
{
- printf("EVENT: Netreg ");
+ printf("EVENT: Netreg ");
switch (aux->u.netreg.state)
{
@@ -66,111 +106,53 @@
return 0;
}
-static int
-event_init(struct lgsm_handle *lh)
-{
- int rc;
-
- rc = lgsm_evt_handler_register(lh, GSMD_EVT_IN_CALL, &incall_handler);
- rc |= lgsm_evt_handler_register(lh, GSMD_EVT_NETREG, &netreg_handler);
- rc |= lgsm_evt_handler_register(lh, GSMD_EVT_SIGNAL, &sigq_handler);
-
- return rc;
-}
-
-static void
+static int
gsm_connect_init()
{
- lgsmh = lgsm_init(LGSMD_DEVICE_GSMD);
+ lgsmh = lgsm_init(LGSMD_DEVICE_GSMD);
- if (!lgsmh)
- {
- gsm_conn_init = FALSE;
- //fprintf(stderr, "openmoko-panel-gsm:Can't connect to gsmd\n");
- printf("Can't connect to gsmd\n");
- return FALSE;
- }
- else
- {
- event_init(lgsmh);
- return TRUE;
- }
+ if (!lgsmh)
+ {
+ printf("Can't connect to gsmd\n");
+ return FALSE;
+ }
+ else
+ {
+ lgsm_evt_handler_register(lgsmh, GSMD_EVT_NETREG, &netreg_handler);
+ lgsm_evt_handler_register(lgsmh, GSMD_EVT_SIGNAL, &sigq_handler);
+ return TRUE;
+ }
}
int
-update_gsm_signal_qualite()
+moko_panel_gsm_signal_quality()
{
- printf("update_gsm_signal_qualite\n");
- fd_set readset;
- int rc;
- char buf[STDIN_BUF_SIZE+1];
- struct timeval t;
- t.tv_sec=0;
- t.tv_usec=0;
-
- if (!gsm_conn_init)
- gsm_connect_init();
-
- if (!lgsmh){
- gsm_conn_init = FALSE;
- return FALSE;
- }
-
- int gsm_fd = lgsm_fd (lgsmh);
-
- FD_SET(gsm_fd, &readset);
- printf("select>\n");
- rc = select(gsm_fd+1, &readset, NULL, NULL, &t);
- printf("select<\n");
-
- if (FD_ISSET(gsm_fd, &readset))
- {
- printf("read>\n");
- rc = read(gsm_fd, buf, sizeof(buf));
- printf("read<\n");
- if (rc <= 0)
- {
- printf("ERROR reding from gsm_fd\n");
- return FALSE;
- }
- else
- {
- printf("data from gsm_fd\n");
- rc = lgsm_handle_packet (lgsmh, buf, rc);
- updated = TRUE;
- return TRUE;
- }
- }
+ return signal_value;
}
-int
-moko_panel_gsm_quality(int *quality)
+void
+gsm_watcher_install (void)
{
- update_gsm_signal_qualite();
+ static GSourceFuncs gsm_watcher_funcs = {
+ gsm_watcher_prepare,
+ gsm_watcher_check,
+ gsm_watcher_dispatch,
+ NULL
+ };
+ /* FIXME: we never unref the watcher. */
+ GSource *gsm_watcher = g_source_new (&gsm_watcher_funcs, sizeof (GSource));
+ gsm_connect_init();
+
+ if (!lgsmh)
+ return ;
+ GPfd.fd = lgsm_fd (lgsmh);
+ GPfd.events = G_IO_IN | G_IO_HUP | G_IO_ERR | G_IO_PRI;
+ GPfd.revents = 0;
- if (updated)
- {
- /*switch (signal_value) //needs debug board to test signal
value range.
- {
- }
- */
-
+ g_source_add_poll (gsm_watcher, &GPfd);
+ g_source_attach (gsm_watcher, NULL);
- updated = FALSE;
- return TRUE;
- }
- else
- {
- printf ("This is a test resualt without libgsmd support\n");
- static int test = 0;
-
- *quality = test;
-
- if ( ++test >= TOTAL_SIGNALS )
- test = 0;
-
- return FALSE;
- }
+ return;
}
Modified:
trunk/src/target/OM-2007/panel-plugins/openmoko-panel-gsm/src/moko-gsm-conn.h
===================================================================
---
trunk/src/target/OM-2007/panel-plugins/openmoko-panel-gsm/src/moko-gsm-conn.h
2007-03-27 08:34:31 UTC (rev 1516)
+++
trunk/src/target/OM-2007/panel-plugins/openmoko-panel-gsm/src/moko-gsm-conn.h
2007-03-27 11:52:01 UTC (rev 1517)
@@ -13,7 +13,8 @@
TOTAL_SIGNALS
};
-int
-moko_panel_gsm_quality(int *quality);
+void gsm_watcher_install (void);
+int moko_panel_gsm_signal_quality(void);
+
#endif /*_MOKO_PANEL_GSM_CONN_*/
Modified:
trunk/src/target/OM-2007/panel-plugins/openmoko-panel-gsm/src/openmoko-panel-gsm.c
===================================================================
---
trunk/src/target/OM-2007/panel-plugins/openmoko-panel-gsm/src/openmoko-panel-gsm.c
2007-03-27 08:34:31 UTC (rev 1516)
+++
trunk/src/target/OM-2007/panel-plugins/openmoko-panel-gsm/src/openmoko-panel-gsm.c
2007-03-27 11:52:01 UTC (rev 1517)
@@ -38,13 +38,9 @@
static gboolean
timeout_cb (GsmApplet *applet)
{
-
- /* if (!moko_panel_gsm_quality (&gsm_quality)) //signal value not changed.
- return TRUE;
- */
- moko_panel_gsm_quality (&(applet->gsm_quality));
- g_debug ("moko gsm quality = %d", applet->gsm_quality);
-
+ int sig_q = moko_panel_gsm_signal_quality ();
+ g_debug ("moko gsm quality = %d", sig_q);
+if (0){
switch (applet->gsm_quality)
{
case GSM_SIGNAL_ERROR :
@@ -75,7 +71,7 @@
gtk_image_set_from_file (applet->image,
PKGDATADIR"/SignalStrength_00.png");
break;
}
-
+}
/* Keep going */
return TRUE;
}
@@ -97,9 +93,13 @@
t = time( NULL );
local_time = localtime(&t);
+ //FIXME: Do not use g_timeout function, convert to use gsm signal handle
callback.
applet->timeout_id = g_timeout_add( 2000, (GSourceFunc) timeout_cb,
applet);
moko_panel_applet_set_widget( GTK_CONTAINER(mokoapplet), applet->image );
gtk_widget_show_all( GTK_WIDGET(mokoapplet) );
+
+ gsm_watcher_install ();
+
return GTK_WIDGET(mokoapplet);
};
--- End Message ---
--- Begin Message ---
Author: laforge
Date: 2007-03-27 16:27:57 +0200 (Tue, 27 Mar 2007)
New Revision: 1518
Modified:
trunk/src/target/kernel/patches/gta01-pcf50606.patch
Log:
* cosmetic fix of debug statement
* correct NTC reading algorithm to compensate for 10kOhms parallel resistor
* print charge current as milliamperes (rather than integral amperes which are
deemed to be 0)
* implement charge mode printing
* use sysfs_{create,remove}_group()
Modified: trunk/src/target/kernel/patches/gta01-pcf50606.patch
===================================================================
--- trunk/src/target/kernel/patches/gta01-pcf50606.patch 2007-03-27
11:52:01 UTC (rev 1517)
+++ trunk/src/target/kernel/patches/gta01-pcf50606.patch 2007-03-27
14:27:57 UTC (rev 1518)
@@ -1,10 +1,10 @@
This is the PCF50606 power management unit driver for FIC GTA01
-Index: linux-2.6.20.1/drivers/i2c/chips/pcf50606.c
+Index: linux-2.6.20.4/drivers/i2c/chips/pcf50606.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.20.1/drivers/i2c/chips/pcf50606.c 2007-03-02
18:41:31.000000000 +0100
-@@ -0,0 +1,1613 @@
++++ linux-2.6.20.4/drivers/i2c/chips/pcf50606.c 2007-03-27
16:24:25.000000000 +0200
+@@ -0,0 +1,1633 @@
+/* Philips PCF50606 Power Management Unit (PMU) driver
+ *
+ * (C) 2006 by OpenMoko, Inc.
@@ -245,7 +245,7 @@
+
+ mutex_unlock(&pcf->lock);
+
-+ DEBUGP("returnung %u %u\n", ret, data2 ? *data2 : 0);
++ DEBUGP("returning %u %u\n", ret, data2 ? *data2 : 0);
+
+ return ret;
+}
@@ -872,9 +872,17 @@
+EXPORT_SYMBOL(pcf50606_charge_fast);
+
+#define PCF50606_R_FIXBATT 10000 /* 10 kOhms */
++#define PCF50606_R_FIXBATT_PAR 10000 /* 10 kOhms */
++#define ONE 1000000
+static inline u_int16_t adc_to_rntc(u_int16_t adc)
+{
-+ return (adc * PCF50606_R_FIXBATT) / (1023 - adc);
++ u_int32_t r_batt = (adc * PCF50606_R_FIXBATT) / (1023 - adc);
++ u_int16_t r_ntc;
++
++ /* The battery NTC has a parallell 10kOhms resistor */
++ r_ntc = ONE / ((ONE/r_batt) - (ONE/PCF50606_R_FIXBATT_PAR));
++
++ return r_ntc;
+}
+
+static inline int16_t rntc_to_temp(u_int16_t rntc)
@@ -901,11 +909,12 @@
+}
+static DEVICE_ATTR(battemp, S_IRUGO | S_IWUSR, show_battemp, NULL);
+
-+#define MULT_R_SENSE_1024 225 /* 0.22 * 1024 */
++#define MULT_R_SENSE_1024 225 /* 0.22 Ohms * 1024 */
+static inline u_int16_t adc_to_chg_milliamps(u_int16_t adc_adcin1,
+ u_int16_t adc_batvolt)
+{
-+ return (((adc_adcin1 - adc_batvolt) * 24) / 10) / MULT_R_SENSE_1024;
++ u_int32_t res = ((adc_adcin1 - adc_batvolt) * 6000);
++ return res / MULT_R_SENSE_1024;
+}
+
+static ssize_t show_chgcur(struct device *dev, struct device_attribute *attr,
@@ -990,11 +999,17 @@
+{
+ struct i2c_client *client = to_i2c_client(dev);
+ struct pcf50606_data *pcf = i2c_get_clientdata(client);
-+ u_int8_t mbcc1 = reg_read(pcf, PCF50606_REG_MBCC1);
-+ u_int8_t chgmod = (mbcc1 & PCF50606_MBCC1_CHGMOD_MASK);
++ char *b = buf;
++ int i;
+
-+ //return sprintf(buf, "%s\n", chgstate_names[chgmod]);
-+ return 0;
++ for (i = 0; i < 32; i++)
++ if (pcf->flags & (1 << i) && i < ARRAY_SIZE(chgstate_names))
++ b += sprintf(b, "%s ", chgstate_names[i]);
++
++ if (b > buf)
++ b += sprintf(b, "\n");
++
++ return b - buf;
+}
+static DEVICE_ATTR(chgstate, S_IRUGO | S_IWUSR, show_chgstate, NULL);
+
@@ -1342,9 +1357,32 @@
+};
+#endif
+
++static struct attribute *pcf_sysfs_entries[] = {
++ &dev_attr_battvolt.attr,
++ &dev_attr_battemp.attr,
++ &dev_attr_chgcur.attr,
++ &dev_attr_chgstate.attr,
++ &dev_attr_chgmode.attr,
++ &dev_attr_voltage_dcd.attr,
++ &dev_attr_voltage_dcde.attr,
++ &dev_attr_voltage_dcud.attr,
++ &dev_attr_voltage_d1reg.attr,
++ &dev_attr_voltage_d2reg.attr,
++ &dev_attr_voltage_d3reg.attr,
++ &dev_attr_voltage_lpreg.attr,
++ &dev_attr_voltage_ioreg.attr,
++ NULL
++};
++
++static struct attribute_group pcf_attr_group = {
++ .name = NULL, /* put in device directory */
++ .attrs = pcf_sysfs_entries,
++};
++
+static int pcf50606_detect(struct i2c_adapter *adapter, int address, int kind)
+{
+ struct i2c_client *new_client;
++ struct pcf50606_platform_data *pdata;
+ struct pcf50606_data *data;
+ int err = 0;
+
@@ -1382,19 +1420,11 @@
+
+ pcf50606_global = data;
+
-+ device_create_file(&new_client->dev, &dev_attr_battvolt);
-+ device_create_file(&new_client->dev, &dev_attr_battemp);
-+ device_create_file(&new_client->dev, &dev_attr_chgcur);
-+ device_create_file(&new_client->dev, &dev_attr_chgstate);
-+ device_create_file(&new_client->dev, &dev_attr_chgmode);
-+ device_create_file(&new_client->dev, &dev_attr_voltage_dcd);
-+ device_create_file(&new_client->dev, &dev_attr_voltage_dcde);
-+ device_create_file(&new_client->dev, &dev_attr_voltage_dcud);
-+ device_create_file(&new_client->dev, &dev_attr_voltage_d1reg);
-+ device_create_file(&new_client->dev, &dev_attr_voltage_d2reg);
-+ device_create_file(&new_client->dev, &dev_attr_voltage_d3reg);
-+ device_create_file(&new_client->dev, &dev_attr_voltage_lpreg);
-+ device_create_file(&new_client->dev, &dev_attr_voltage_ioreg);
++ err = sysfs_create_group(&new_client->dev.kobj, &pcf_attr_group);
++ if (err) {
++ dev_err(&new_client->dev, "error creating sysfs group\n");
++ goto exit_detach;
++ }
+
+ /* create virtual charger 'device' */
+
@@ -1411,7 +1441,7 @@
+ err = request_irq(GTA01_IRQ_PCF50606, pcf50606_irq, SA_INTERRUPT,
+ "pcf50606", data);
+ if (err < 0)
-+ goto exit_detach;
++ goto exit_sysfs;
+
+ if (enable_irq_wake(GTA01_IRQ_PCF50606) < 0)
+ printk(KERN_ERR "PCF50606: IRQ %u cannot be enabled as wake-up"
@@ -1466,6 +1496,8 @@
+ rtc_device_unregister(pcf50606_global->rtc);
+exit_irq:
+ free_irq(GTA01_IRQ_PCF50606, pcf50606_global);
++exit_sysfs:
++ sysfs_remove_group(&new_client->dev.kobj, &pcf_attr_group);
+exit_detach:
+ i2c_detach_client(new_client);
+exit_free:
@@ -1493,19 +1525,7 @@
+ rtc_device_unregister(pcf->rtc);
+ pm_power_off = NULL;
+
-+ device_remove_file(&client->dev, &dev_attr_battvolt);
-+ device_remove_file(&client->dev, &dev_attr_battemp);
-+ device_remove_file(&client->dev, &dev_attr_chgcur);
-+ device_remove_file(&client->dev, &dev_attr_chgstate);
-+ device_remove_file(&client->dev, &dev_attr_chgmode);
-+ device_remove_file(&client->dev, &dev_attr_voltage_dcd);
-+ device_remove_file(&client->dev, &dev_attr_voltage_dcde);
-+ device_remove_file(&client->dev, &dev_attr_voltage_dcud);
-+ device_remove_file(&client->dev, &dev_attr_voltage_d1reg);
-+ device_remove_file(&client->dev, &dev_attr_voltage_d2reg);
-+ device_remove_file(&client->dev, &dev_attr_voltage_d3reg);
-+ device_remove_file(&client->dev, &dev_attr_voltage_lpreg);
-+ device_remove_file(&client->dev, &dev_attr_voltage_ioreg);
++ sysfs_remove_group(&client->dev.kobj, &pcf_attr_group);
+
+ kfree(pcf);
+
@@ -1618,10 +1638,10 @@
+
+module_init(pcf50606_init);
+module_exit(pcf50606_exit);
-Index: linux-2.6.20.1/drivers/i2c/chips/pcf50606.h
+Index: linux-2.6.20.4/drivers/i2c/chips/pcf50606.h
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.20.1/drivers/i2c/chips/pcf50606.h 2007-03-02
17:33:25.000000000 +0100
++++ linux-2.6.20.4/drivers/i2c/chips/pcf50606.h 2007-03-26
19:01:17.000000000 +0200
@@ -0,0 +1,259 @@
+#ifndef _PCF50606_H
+#define _PCF50606_H
@@ -1882,10 +1902,10 @@
+
+#endif /* _PCF50606_H */
+
-Index: linux-2.6.20.1/drivers/i2c/chips/Kconfig
+Index: linux-2.6.20.4/drivers/i2c/chips/Kconfig
===================================================================
---- linux-2.6.20.1.orig/drivers/i2c/chips/Kconfig 2007-03-02
17:32:22.000000000 +0100
-+++ linux-2.6.20.1/drivers/i2c/chips/Kconfig 2007-03-02 17:33:25.000000000
+0100
+--- linux-2.6.20.4.orig/drivers/i2c/chips/Kconfig 2007-03-23
20:52:51.000000000 +0100
++++ linux-2.6.20.4/drivers/i2c/chips/Kconfig 2007-03-26 19:01:17.000000000
+0200
@@ -36,6 +36,17 @@
This driver can also be built as a module. If so, the module
will be called eeprom.
@@ -1904,10 +1924,10 @@
config SENSORS_PCF8574
tristate "Philips PCF8574 and PCF8574A"
depends on I2C && EXPERIMENTAL
-Index: linux-2.6.20.1/drivers/i2c/chips/Makefile
+Index: linux-2.6.20.4/drivers/i2c/chips/Makefile
===================================================================
---- linux-2.6.20.1.orig/drivers/i2c/chips/Makefile 2007-03-02
17:32:22.000000000 +0100
-+++ linux-2.6.20.1/drivers/i2c/chips/Makefile 2007-03-02 17:33:25.000000000
+0100
+--- linux-2.6.20.4.orig/drivers/i2c/chips/Makefile 2007-03-23
20:52:51.000000000 +0100
++++ linux-2.6.20.4/drivers/i2c/chips/Makefile 2007-03-26 19:01:17.000000000
+0200
@@ -8,6 +8,7 @@
obj-$(CONFIG_SENSORS_MAX6875) += max6875.o
obj-$(CONFIG_SENSORS_M41T00) += m41t00.o
@@ -1916,10 +1936,10 @@
obj-$(CONFIG_SENSORS_PCF8574) += pcf8574.o
obj-$(CONFIG_SENSORS_PCF8591) += pcf8591.o
obj-$(CONFIG_ISP1301_OMAP) += isp1301_omap.o
-Index: linux-2.6.20.1/include/linux/i2c-id.h
+Index: linux-2.6.20.4/include/linux/i2c-id.h
===================================================================
---- linux-2.6.20.1.orig/include/linux/i2c-id.h 2007-03-02 17:33:24.000000000
+0100
-+++ linux-2.6.20.1/include/linux/i2c-id.h 2007-03-02 17:33:25.000000000
+0100
+--- linux-2.6.20.4.orig/include/linux/i2c-id.h 2007-03-26 19:01:17.000000000
+0200
++++ linux-2.6.20.4/include/linux/i2c-id.h 2007-03-26 19:01:17.000000000
+0200
@@ -159,6 +159,7 @@
#define I2C_DRIVERID_FSCHER 1046
#define I2C_DRIVERID_W83L785TS 1047
@@ -1928,11 +1948,11 @@
/*
* ---- Adapter types ----------------------------------------------------
-Index: linux-2.6.20.1/include/linux/pcf50606.h
+Index: linux-2.6.20.4/include/linux/pcf50606.h
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.20.1/include/linux/pcf50606.h 2007-03-02 17:33:25.000000000
+0100
-@@ -0,0 +1,55 @@
++++ linux-2.6.20.4/include/linux/pcf50606.h 2007-03-26 19:01:17.000000000
+0200
+@@ -0,0 +1,56 @@
+#ifndef _LINUX_PCF50606_H
+#define _LINUX_PCF50606_H
+
@@ -1980,6 +2000,7 @@
+pcf50606_charge_fast(struct pcf50606_data *pcf, int on);
+
+struct pcf50606_platform_data {
++ unsigned int irq;
+ unsigned int initial_voltage[__NUM_PCF50606_REGULATORS];
+
+ struct {
--- End Message ---
--- Begin Message ---
Author: thomas
Date: 2007-03-27 17:44:17 +0200 (Tue, 27 Mar 2007)
New Revision: 1519
Modified:
trunk/src/target/OM-2007/applications/openmoko-today/ChangeLog
trunk/src/target/OM-2007/applications/openmoko-today/src/today-events-area.c
Log:
* src/today-events-area.c: (update_paging_info): Set page numbers
rather than number of events on pager widget
Modified: trunk/src/target/OM-2007/applications/openmoko-today/ChangeLog
===================================================================
--- trunk/src/target/OM-2007/applications/openmoko-today/ChangeLog
2007-03-27 14:27:57 UTC (rev 1518)
+++ trunk/src/target/OM-2007/applications/openmoko-today/ChangeLog
2007-03-27 15:44:17 UTC (rev 1519)
@@ -1,5 +1,10 @@
-2007-03-26 Thomas Wood <[EMAIL PROTECTED]>
+Tue, 27 Mar 2007 16:41:20 +0100 Thomas Wood
+ * src/today-events-area.c: (update_paging_info): Set page numbers
+ rather than number of events on pager widget
+
+Mon, 26 Mar 2007 11:12:04 +0100 Thomas Wood
+
* src/Makefile.am: Change binary name to openmoko-today to be more
consistent with other openmoko applications
Modified:
trunk/src/target/OM-2007/applications/openmoko-today/src/today-events-area.c
===================================================================
---
trunk/src/target/OM-2007/applications/openmoko-today/src/today-events-area.c
2007-03-27 14:27:57 UTC (rev 1518)
+++
trunk/src/target/OM-2007/applications/openmoko-today/src/today-events-area.c
2007-03-27 15:44:17 UTC (rev 1519)
@@ -34,6 +34,7 @@
#include <gtk/gtklabel.h>
#include "today-utils.h"
#include "today-events-area.h"
+#include <math.h>
struct _TodayEventsAreaPrivate {
@@ -596,9 +597,15 @@
g_return_val_if_fail (a_this->priv->cur_event, FALSE) ;
g_return_val_if_fail (a_this->priv->events, FALSE) ;
+ /* Set the page label to display the current and number of pages */
+
+ gdouble num = a_this->priv->max_visible_events;
+ int num_pages = ceil (a_this->priv->nb_events / num);
+ int curr_page = a_this->priv->cur_event_index / num + 1;
+
str = g_strdup_printf ("%d/%d",
- a_this->priv->cur_event_index + 1,
- a_this->priv->nb_events) ;
+ curr_page,
+ num_pages) ;
gtk_label_set_text (GTK_LABEL (a_this->priv->paging_info), str) ;
g_free (str) ;
--- End Message ---
--- Begin Message ---
Author: laforge
Date: 2007-03-28 02:21:15 +0200 (Wed, 28 Mar 2007)
New Revision: 1520
Modified:
trunk/src/target/gsm/src/gsmd/vendor_ti.c
Log:
fix GSM signal strength parsing (Closes: 291)
Modified: trunk/src/target/gsm/src/gsmd/vendor_ti.c
===================================================================
--- trunk/src/target/gsm/src/gsmd/vendor_ti.c 2007-03-27 15:44:17 UTC (rev
1519)
+++ trunk/src/target/gsm/src/gsmd/vendor_ti.c 2007-03-28 00:21:15 UTC (rev
1520)
@@ -81,7 +81,7 @@
aux = (struct gsmd_evt_auxdata *) ucmd->buf;
- tok = strtok(buf, ",");
+ tok = strtok(param, ",");
if (!tok)
goto out_free_io;
@@ -93,7 +93,6 @@
aux->u.signal.sigq.ber = atoi(tok);
- DEBUGP("sending EVT_SIGNAL\n");
usock_evt_send(gsmd, ucmd, GSMD_EVT_SIGNAL);
return 0;
--- End Message ---
--- Begin Message ---
Author: ken_zhao
Date: 2007-03-28 04:33:14 +0200 (Wed, 28 Mar 2007)
New Revision: 1521
Removed:
trunk/src/target/OM-2007/panel-plugins/openmoko-panel-gsm/data/SignalStrength25g_00.png
Modified:
trunk/src/target/OM-2007/panel-plugins/openmoko-panel-gsm/data/Makefile.am
Log:
delete gps connect error image, which is only for test and useless
Modified:
trunk/src/target/OM-2007/panel-plugins/openmoko-panel-gsm/data/Makefile.am
===================================================================
--- trunk/src/target/OM-2007/panel-plugins/openmoko-panel-gsm/data/Makefile.am
2007-03-28 00:21:15 UTC (rev 1520)
+++ trunk/src/target/OM-2007/panel-plugins/openmoko-panel-gsm/data/Makefile.am
2007-03-28 02:33:14 UTC (rev 1521)
@@ -5,7 +5,6 @@
#
resourcedir = $(pkgdatadir)
resource_DATA = \
- SignalStrength25g_00.png \
SignalStrength25g_01.png \
SignalStrength25g_02.png \
SignalStrength25g_03.png \
Deleted:
trunk/src/target/OM-2007/panel-plugins/openmoko-panel-gsm/data/SignalStrength25g_00.png
===================================================================
(Binary files differ)
--- End Message ---
--- Begin Message ---
Author: alex_tang
Date: 2007-03-28 07:58:08 +0200 (Wed, 28 Mar 2007)
New Revision: 1522
Modified:
trunk/src/target/OM-2007/applications/openmoko-messages/src/callbacks.c
trunk/src/target/OM-2007/applications/openmoko-messages/src/sms-contact-window.c
trunk/src/target/OM-2007/applications/openmoko-messages/src/sms-contact-window.h
Log:
Get selected contacts and set into sms send entry.
Modified:
trunk/src/target/OM-2007/applications/openmoko-messages/src/callbacks.c
===================================================================
--- trunk/src/target/OM-2007/applications/openmoko-messages/src/callbacks.c
2007-03-28 02:33:14 UTC (rev 1521)
+++ trunk/src/target/OM-2007/applications/openmoko-messages/src/callbacks.c
2007-03-28 05:58:08 UTC (rev 1522)
@@ -590,6 +590,26 @@
{
g_debug("sms select contact done");
GtkWidget* toEntry = (GtkWidget*)data;
- gtk_entry_set_text (GTK_ENTRY(toEntry),SMS_CONTACT_WINDOW(widget)->nameList);
+ GList* contacts = SMS_CONTACT_WINDOW(widget)->selectedContacts;
+ g_debug ("start to add %d contacts to entry", g_list_length(contacts));
+ gchar* nameList = NULL;
+ gchar* name;
+ GList* nextContext = contacts;
+ EContact *contact;
+ for ( ; nextContext != NULL; nextContext = nextContext->next){
+ contact = E_CONTACT (nextContext->data);
+ name = e_contact_get_const (contact, E_CONTACT_FULL_NAME);
+ if (nameList == NULL)
+ nameList = g_strdup (name);
+ else
+ nameList = g_strconcat (nameList,",",name,NULL);
+ g_debug(nameList);
+ }
+ if (strlen(gtk_entry_get_text (GTK_ENTRY(toEntry))) > 0)
+ gtk_entry_append_text (GTK_ENTRY(toEntry),g_strdup_printf(",%s",nameList));
+ else
+ gtk_entry_set_text (GTK_ENTRY(toEntry),nameList);
+ g_free(nameList);
+ g_free(name);
}
Modified:
trunk/src/target/OM-2007/applications/openmoko-messages/src/sms-contact-window.c
===================================================================
---
trunk/src/target/OM-2007/applications/openmoko-messages/src/sms-contact-window.c
2007-03-28 02:33:14 UTC (rev 1521)
+++
trunk/src/target/OM-2007/applications/openmoko-messages/src/sms-contact-window.c
2007-03-28 05:58:08 UTC (rev 1522)
@@ -28,6 +28,7 @@
GtkWidget* vbox;
GtkWidget* buttonbox;
GtkWidget* contacts_view;
+ SmsContactData* data;
}SmsContactWindowPrivate;
static gint sms_contact_signals[LAST_SIGNAL] = {0};
@@ -40,6 +41,8 @@
GList* contacts, gpointer closure);
static void contacts_view_cursor_changed(GtkTreeSelection* selection,
SmsContactData* data);
static void contact_select_done(void);
+gboolean get_selected_contact (GtkTreeModel* model, GtkTreePath* path,
+ GtkTreeIter* iter, gpointer data);
static void
sms_contact_window_dispose(GObject* object)
@@ -83,11 +86,11 @@
static void updateContactsView (EBook* book, EBookStatus status,
GList* contacts, gpointer closure)
{
- g_debug("contacts has ");
GtkTreeIter iter;
SmsContactData* data = (SmsContactData*)closure;
GtkListStore *contacts_liststore = data->contacts_liststore;
GList* c = contacts;
+ data->contacts = contacts;
g_debug ("list length %d", g_list_length(c));
for (;c;c=c->next){
@@ -141,10 +144,10 @@
SmsContactWindowPrivate* priv = SMS_CONTACT_WINDOW_GET_PRIVATE(self);
priv->vbox = gtk_vbox_new(FALSE,0);
SmsContactData* data = g_new0(SmsContactData,1);
+ priv->data = data;
data->book = e_book_new_system_addressbook(NULL);
if (!data->book)
g_critical ("Could not load system addressbook");
- self->nameList = g_strdup("tyh");
/* Set the "select" window title */
GtkWidget* titleLabel = gtk_label_new ("Select Contacts");
@@ -225,8 +228,48 @@
return GTK_WIDGET (moko_navigation_list);
}
+gboolean get_selected_contact (GtkTreeModel* model, GtkTreePath* path,
+ GtkTreeIter* iter, gpointer data)
+{
+ SmsContactWindow* self = (SmsContactWindow*)data;
+ SmsContactWindowPrivate* priv = SMS_CONTACT_WINDOW_GET_PRIVATE(self);
+ SmsContactData* contactData = priv->data;
+ g_debug ("select item contacts %d", g_list_length(contactData->contacts));
+
+ gchar* name;
+ gboolean selected;
+ gtk_tree_model_get (model, iter,
+ CONTACT_SEL_COL, &selected,
+ CONTACT_NAME_COL,&name,
+ -1);
+ if (selected)
+ g_debug ("contact %s selected", name);
+ else {
+ g_debug ("contact %s not selected, remove from contacts list", name);
+ GList* contactListItem = contactData->contacts;
+ for ( ; contactListItem; contactListItem=contactListItem->next){
+ EContact* contact = E_CONTACT (contactListItem->data);
+ const gchar *contactName;
+ contactName = e_contact_get_const (contact, E_CONTACT_FULL_NAME);
+ if (!g_strcasecmp(name, contactName))
+ contactData->contacts = g_list_remove (contactData->contacts,
+ contactListItem->data);
+ }
+ }
+
+ return FALSE;
+}
+
static void sms_contact_window_close (SmsContactWindow* self)
{
+ /* get selected items */
+ SmsContactWindowPrivate* priv = SMS_CONTACT_WINDOW_GET_PRIVATE(self);
+ GtkWidget* contactView =
moko_navigation_list_get_tree_view(MOKO_NAVIGATION_LIST(priv->contacts_view));
+ GtkTreeModel* contactModel = gtk_tree_view_get_model
(GTK_TREE_VIEW(contactView));
+ gtk_tree_model_foreach (contactModel, get_selected_contact, self);
+ self->selectedContacts = priv->data->contacts;
+
+ /* emit selection done signal */
g_signal_emit
(G_OBJECT(self),sms_contact_signals[CONTACT_SELECT_DONE_SIGNAL],0);
/* Synthesize delete_event to close dialog. */
Modified:
trunk/src/target/OM-2007/applications/openmoko-messages/src/sms-contact-window.h
===================================================================
---
trunk/src/target/OM-2007/applications/openmoko-messages/src/sms-contact-window.h
2007-03-28 02:33:14 UTC (rev 1521)
+++
trunk/src/target/OM-2007/applications/openmoko-messages/src/sms-contact-window.h
2007-03-28 05:58:08 UTC (rev 1522)
@@ -55,7 +55,7 @@
{
MokoWindow parent;
/* instance members */
- gchar* nameList;
+ GList* selectedContacts;
}SmsContactWindow;
typedef struct
@@ -69,6 +69,7 @@
{
EBook* book;
GtkListStore *contacts_liststore;
+ GList* contacts;
}SmsContactData;
G_END_DECLS
--- End Message ---
_______________________________________________
commitlog mailing list
[email protected]
http://lists.openmoko.org/mailman/listinfo/commitlog