From 63a083da8ea8ba94cc457bcd46b1ba2c35c48b00 Mon Sep 17 00:00:00 2001 From: Philip Edelbrock Date: Wed, 16 Jun 1999 05:40:35 +0000 Subject: [PATCH] (Phil) It works! So, I'll commit it. Here's the skinny: There is only one file 'disp'. To send bytes (like chars to be displayed) you send a series of unsigned base-10 values separated by spaces. For example: echo "hi there" | perl -e \ '$_=; while (/(.)/gc) { print ord($1)," "; }' \ > /proc/sys/dev/sensors/matorb*/disp This is equivelent to doing: echo "104 105 32 116 104 101 114 101" > /proc/sys/dev/sensors/matorb*/disp I was going to create more files for doing things like clearing the screen, but it is easier and probably better to do this in user-space. For example, to clean the screen, you can do: echo "254 88" > /proc/sys/dev/sensors/matorb*/disp (As documented in the manual from Matrix-Orbital) If the folks at Matrix-Orbital added device ID on a read (we talked about this), then I will add an ID file to indicate that info. TODO: finish detection. Right now it looks for a device at a particular address and assumes it is a display. git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@482 7894878c-1315-0410-8ee3-d5d059ff63e0 --- kernel/chips/matorb.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/kernel/chips/matorb.c b/kernel/chips/matorb.c index 1b61a891..3aebffe2 100644 --- a/kernel/chips/matorb.c +++ b/kernel/chips/matorb.c @@ -303,6 +303,8 @@ void matorb_update_client(struct i2c_client *client) void matorb_disp(struct i2c_client *client, int operation, int ctl_name, int *nrels_mag, long *results) { +int i; + if (operation == SENSORS_PROC_REAL_INFO) *nrels_mag = 0; else if (operation == SENSORS_PROC_REAL_READ) { @@ -310,8 +312,8 @@ void matorb_disp(struct i2c_client *client, int operation, int ctl_name, results[0] = 0; *nrels_mag = 3; } else if (operation == SENSORS_PROC_REAL_WRITE) { - if (*nrels_mag >= 1) { - matorb_write_value(client,0,results[0]); + for (i=1; i<=*nrels_mag;i++) { + matorb_write_value(client,0,results[i-1]); } } }