Jump to content

New SMB380 G-Sensor Driver with Sysfs Control


Recommended Posts

Guest xaueious
Posted (edited)

Found a new gsensor driver here:

https://patchwork.kernel.org/patch/112207/

Implemented in a kernel, and it seems to work.

Go to /sys/devices/platform/i2c-adapter/i2c-0/0-0038

bandwidth	 hg_int		lg_hyst	   name		  subsystem

driver		hg_thres	  lg_int		new_data_int  temperature

hg_dur		input		 lg_thres	  power		 uevent

hg_hyst	   lg_dur		modalias	  range		 xyz

There's now a 'bandwidth' control:

So you can now control the filtering and make the gsensor more or less sensitive

bandwidth: indicate the digital filtering of ADC output data

to obtain the desired bandwidth

0: 25Hz (default)

1: 50Hz

2: 100Hz

3: 190Hz

4: 375Hz

5: 750Hz

6: 1500Hz

My screenshot program isn't working right now, so you guys just have to kind of try it for yourself.

Also looks like you can extend the range up to 8g! But I'd be hard pressed to find situations for that. Maybe if you want to start using the acceleratometer for your car. 2g = about 60 km/h and will not give you good readings :(

If you are having trouble with racing games and other gsensor stuff, the filter is on pretty high. You can see the effects in something like Accelogger

Edited by xaueious
Guest phhusson
Posted
Found a new gsensor driver here:

https://patchwork.kernel.org/patch/112207/

OURGH

You should REALLY not do this that way, this patch is for an alternate smb380 driver, which means that when using it you have two different smb380 drivers running at the same time, this might lead to really weird things ... At least kernel panics wouldn't seem weird to me while doing that...

At least don't put that in a "production" or for real use kernel...

If you find any useful setting in there, tell me, I'll add it in the current driver.

Guest xaueious
Posted (edited)

The bandwidth setting and range are there, but nothing useful.

Kernel panic or not it's not like I'm releasing it.

It's an alternate driver?

The driver says v2, and the one in there used to be roughly 3 times the filesize of this one.

Why so serious?

It seems to be more or less under review at the moment, but it's been floating around.

Holding in hand...

bandwidth 0

s02n6.png

bandwidth 6

tZ280.png

Settingthe bandwidth to 1 works okay in terms of noise

Edited by xaueious
Guest phhusson
Posted
The bandwidth setting and range are there, but nothing useful.

Kernel panic or not it's not like I'm releasing it.

It's an alternate driver?

The driver says v2, and the one in there used to be roughly 3 times the filesize of this one.

Why so serious?

It seems to be more or less under review at the moment, but it's been floating around.

I'm not saying this driver is bad, it's actually way better than the one we have, but it's incompatible (and we can't use it unless rewriting all sensors drivers) !

Guest xaueious
Posted (edited)

Oh it's incompatible?

I compiled it replacing smb380.c and smb380.h, and modifying the include. I don't know what I'm doing...

Here's the generated diff

Just throwing out ideas here...

Edited by xaueious

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.