Giter Club home page Giter Club logo

yoga-laptop's Introduction

Yoga - Laptop

Note: Built initially for the Lenovo yoga 2 Pro. Works for some other Lenovo Yoga laptops. Depends on which sensor chips are in the laptop.

Systems and information to make Lenovo Ideapad Yoga laptops work better. Best tested for Yoga 2 Pro, but most of this works on other Ideapad Yogas. Thinkpad Yogas may need modifications, and can't use ideapad-laptop.

These systems include kernel modules, so you have to have added kernel-headers and kernel-devel to your system. For the orientation program and sensor drivers you also need to have the IIO subsystem included in your system. If you are running a kernel older than 3.13 you will very likely have problems. If you are running a current kernel you should already have the required drivers and a working ideapad-laptop module.

1/ orientation and light programs

The orientation program re-orients the screen so that the top of the screen is physically up. The program needs the hid-sensor-accel-3d sensor driver. See "docs/Orientation and rotation" for more information.

The light program adjusts the brightness of the screen in response to changes in ambient brightness. The program needs the hid-sensor-als sensor driver.

There is also a generic program that can be used to test sensors - generic_buffer.

You need to have the libXrandr-devel and libnotify-dev package installed.

sudo apt-get install libxrandr-dev libnotify-dev

To compile and install: make programs sudo make programs-install

You may have to first install the sensor drivers, but only do this if necessary because these drivers are old and might cause problems in newer kernels.

To make the screen rotate you need to be running orientation. To make the screen brightness change you need to be running light.

2/ yoga_laptop/ideapad-laptop.c

OBSOLETE, use with caution

Changes to this file should instead be made to the ideapad-laptop kernel module in the Linux kernel.

NOT NEEDED in Fedora 20 or Fedora 19 Probably not needed in 3.16 or newer kernels

A patch to the ideapad-laptop kernel module to make Wifi work on the Yoga 2 Pro. The ideapad-laptop moodule also handles several ACPI-related keys on the Yoga keyboard. A similar patch will be in 3.16, but one that works for the Yoga Ideapad 1 and Yoga 2 11/13/Pro. This better patch has been backported to Fedora 19 and Fedora 20 as of the end of June 2014.

To compile and install (warning - this installs a kernel module and may break your system, and has to be done each time you install a new kernel, after booting into the new kernel): bash make ideapad-laptop bash sudo make ideapad-laptop-install

The installation also sets up udev rules and an xmodmap file to handle the touchpad_toggle and break keys that are not usually handled correctly.

Reboot your system to load the module

3/ sensor drivers

OBSOLETE, use with caution

Changes to these files should instead be made to the appropriate Linux kernel modules

NOT NEEDED in 3.15 kernels or newer or Fedora 19 or newer

Patched 3.14 drivers for five of the sensors in the Yoga laptops. The patch adds a quirk so that the hub initializes correctly. The quirk has been added to 3.15 and 3.15 should have better drivers than the ones here, so don't use these drivers with a 3.15 or newer kernel. The 3.15 drivers also have more quirks, perhaps even the right quirk for the Thinkpad Yoga.

To compile and install (warning - this installs several kernel modules and may break your system, and has to be done each time you install a new kernel, after booting into the new kernel): bash make sensors-drivers bash sudo make sensors-drivers-install Reboot your system to load the drivers

You need to have the libXrandr-devel package installed.

yoga-laptop's People

Contributors

bagage avatar buri avatar chhtz avatar jamescordell avatar litanyww avatar lleixat avatar moert09 avatar pfps avatar prtuson avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

yoga-laptop's Issues

Permissions on /sys files revert on reboot

Hi! Thanks for your helpful programs. I had an annoying issue where the permissions on the various files in /sys read by your program reverted every time I rebooted. I fixed it by throwing this file in /etc/udev/rules.d/.

Not sure if anyone else has run into this but I thought the rules might help someone.

How to setup it

Hi,
I cannot make accelerometer sensor to work (light and special key work perfectly).
I have Lenovo Yoga 2 pro.

lukas@lenprac:/tmp/yoga-laptop/docs$ uname -a
Linux lenprac 3.13.0-30-generic #54-Ubuntu SMP Mon Jun 9 22:45:01 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
lukas@lenprac:
/tmp/yoga-laptop/docs$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 14.04 LTS
Release: 14.04
Codename: trusty

This is the output of orientation --debug 4
iio device number being used is 0
iio trigger number being used is 0
Finding orientation 0
Polling the data

lukas@lenprac:~/tmp/yoga-laptop/sensors$ ./status
Sensor name: accel_3d
Channel /sys/bus/iio/devices/iio:device0/scan_elements/in_accel_x_en:t status: -1
Channel /sys/bus/iio/devices/iio:device0/scan_elements/in_accel_y_en:t status: -1
Channel /sys/bus/iio/devices/iio:device0/scan_elements/in_accel_z_en:t status: -1
Buffer status: 0
Buffer length: 128
Current trigger: accel_3d-dev0

lukas@lenprac:~/tmp/yoga-laptop/sensors$ ./status 1
Sensor name: gyro_3d
Channel /sys/bus/iio/devices/iio:device1/scan_elements/in_anglvel_x_en:t status: 0
Channel /sys/bus/iio/devices/iio:device1/scan_elements/in_anglvel_y_en:t status: 0
Channel /sys/bus/iio/devices/iio:device1/scan_elements/in_anglvel_z_en:t status: 0
Buffer status: 0
Buffer length: 2
Current trigger:

I install drivers from sensors/drivers by sudo make install.
Then in sensors directory install and set permissions.

Script unstick 0 does not help.

Is anything what I forget? .. or is something what I can try further?

Progress on other sensors

Hey,
how's progress on other sensors going? Any updates?

I have just upgraded to latest stable kernel (3.14.2), but there is still no official support for the remaining four sensors.

Usage (Ubuntu)

I'm new to all this, so be gentle ;)
Thanks for writing these patches to get the lenovo 2 pro laptops play nicely with linux!

2 Issues:

Is it possible the documentation in /yoga-laptop/yoga-laptop/README is outdated? It reads

Then to load the module itself
  sudo insmod ./ideapad_laptop.ko 

But the .ko file seems to have been removed since.

Then, for /yoga-laptop/sensors:
As soon as I run ./setup, the terminal says

./setup: 5: ./setup: Bad substitution

I'm running ubuntu 13.10 with gnome 3.10.

Possible Error in code of orientation

Hey pfps.

I am almost certain I found a small error in your orientation.c code that prevents the auto rotation:

406 if (previous_orientation == orientation /* only rotate when stable */ && orientation !=
407 screen_orientation && orientation != FLAT && !orientation_lock) {
408 rotate_to(orientation);
409 previous_orientation = orientation;
410
411 }

In line 406 the dependencies to execute the rotate_to - section are defined as

if (previous_orientation == orientation /* only rotate when stable */ &&
orientation != screen_orientation && orientation != FLAT && !orientation_lock)

If I understand it correct, the value of previous_orientation is defined as "-1" in the header section and gets a new value at two positions:

  1. after the dependencies above are met and rotate_to sequence is executed (Line 409) it gets the same value as orientation,
  2. during the sigusr_callback_handler sequence (Line 225) it gets the same value as screen_orientation.

BUT, here comes the clue: screen_orientation also only gets his value in the rotate_to sequence.
But that prevents the section from actually running because the algorithms to set the values to fulfil the dependencies are only executed AFTER the dependencies are fulfilled.
It SHOULD (imo) set the value of previous_orientation after each time the check orientation process is finished.

So.. long story short: I think the previous_orientation=orientation command should be taken out of the sequence above and placed as a dependencie-free command behind the rest

Something like this:
406 if (previous_orientation == orientation /* only rotate when stable */ && orientation !=
407 screen_orientation && orientation != FLAT && !orientation_lock) {
408 rotate_to(orientation);
409
410 }
411 previous_orientation = orientation;

I tried it with this code and if "run sequence once" - write previous_orientation at the end after all other commands - "run sequence again" - previous_orientation=orientation at the beginning - Hurray!

Greetings

Felix

Add another input to orientation

I successfully made the orientation work with my Atmel touch panel (by replacing "ELAN Touchscreen" with "Atmel maXtouch ...") but I have also a Wacom digitizer, if I replace Elan with wacom's name it works too. Is there a way to add two input devices to the orientation?

Can't compile on Ubuntu 14.10

Hi !

Here is the result I get :

christophe@Lenovo-Yoga-2-Pro:~/Apps/yoga-laptop$ make sensors-drivers
cd sensors/drivers && make default
make[1]: Entering directory '/home/christophe/Apps/yoga-laptop/sensors/drivers'
make -C /usr/src/linux-headers-3.16.0-30-generic SUBDIRS=/home/christophe/Apps/yoga-laptop/sensors/drivers modules
make[2]: Entering directory '/usr/src/linux-headers-3.16.0-30-generic'
CC [M] /home/christophe/Apps/yoga-laptop/sensors/drivers/hid-sensor-trigger.o
/home/christophe/Apps/yoga-laptop/sensors/drivers/hid-sensor-trigger.c: In function ‘hid_sensor_data_rdy_trigger_set_state’:
/home/christophe/Apps/yoga-laptop/sensors/drivers/hid-sensor-trigger.c:56:17: error: incompatible types when assigning to type ‘atomic_t’ from type ‘bool’
st->data_ready = state;
^
scripts/Makefile.build:263: recipe for target '/home/christophe/Apps/yoga-laptop/sensors/drivers/hid-sensor-trigger.o' failed
make[3]: *** [/home/christophe/Apps/yoga-laptop/sensors/drivers/hid-sensor-trigger.o] Error 1
Makefile:1345: recipe for target 'module/home/christophe/Apps/yoga-laptop/sensors/drivers' failed
make[2]: *** [module/home/christophe/Apps/yoga-laptop/sensors/drivers] Error 2
make[2]: Leaving directory '/usr/src/linux-headers-3.16.0-30-generic'
Makefile:22: recipe for target 'default' failed
make[1]: *** [default] Error 2
make[1]: Leaving directory '/home/christophe/Apps/yoga-laptop/sensors/drivers'
Makefile:15: recipe for target 'sensors-drivers' failed
make: *** [sensors-drivers] Error 2

Any idea what I'm doing wrong ?

Debounce light sensor

First of all, thanks for your amazing work. I have been testing the light sensor, and it works fantastic in general, but I have noticed, that in low light conditions, the sensor is somewhat unstable and the backlight changes constantly, making it uncomfortable. Maybe a debounce algorythm can be implemented to prevent this? Thanks!

how to makethis work

I'm new to github and making programs in Linux, so could someone please tell me what I need to do, in order to make this work, or where I can read about it? I downloaded the files, what then? Thank you.

Use libiio?

Hi,

I don't know if you saw the recent libiio project.
I have not looked in detail, but do you think it would be useful to use that to talk to the sensors? Maybe this could help with the strange behavior of the Thinkpad Yoga sensors raised in #4?

Does nothing on Ubuntu 15.04 / 15.10

Did both

cd yoga_laptop
sudo make install-keys

and

make programs && sudo make programs-install

But it changes nothing. (Fn+F6 still not working; screen not rotating etc.)

install orientation program

At the end of the README file you write, concerning the orientation and light sensor programs:

To compile and install (after first compiling and installing the sensor drivers if necessary): make programs sudo make programs-install

which I cannot get to work. Could you provide more detailed instructions please?

Many thanks.

Failed make sensor drivers (OpenSuse)

Hello! I tried to compile sensors drivers and got errors:

$ cd sensors/drivers/
$ make
make -C /lib/modules/3.13.4-1.g6eda950-desktop/build SUBDIRS=/home/konst/test/yoga-laptop/sensors/drivers modules
make[1]: Entering directory `/usr/src/linux-3.13.4-1.g6eda950-obj/x86_64/desktop'
  CC [M]  /home/konst/test/yoga-laptop/sensors/drivers/hid-sensor-trigger.o
/home/konst/test/yoga-laptop/sensors/drivers/hid-sensor-trigger.c: In function 'hid_sensor_data_rdy_trigger_set_state':
/home/konst/test/yoga-laptop/sensors/drivers/hid-sensor-trigger.c:34:9: error: implicit declaration of function 'iio_trigger_get_drvdata' [-Werror=implicit-function-declaration]
  struct hid_sensor_common *st = iio_trigger_get_drvdata(trig);
         ^
/home/konst/test/yoga-laptop/sensors/drivers/hid-sensor-trigger.c:34:33: warning: initialization makes pointer from integer without a cast [enabled by default]
  struct hid_sensor_common *st = iio_trigger_get_drvdata(trig);
                                 ^
/home/konst/test/yoga-laptop/sensors/drivers/hid-sensor-trigger.c: In function 'hid_sensor_remove_trigger':
/home/konst/test/yoga-laptop/sensors/drivers/hid-sensor-trigger.c:70:2: error: implicit declaration of function 'iio_trigger_unregister' [-Werror=implicit-function-declaration]
  iio_trigger_unregister(attrb->trigger);
  ^
/home/konst/test/yoga-laptop/sensors/drivers/hid-sensor-trigger.c:71:2: error: implicit declaration of function 'iio_trigger_free' [-Werror=implicit-function-declaration]
  iio_trigger_free(attrb->trigger);
  ^
/home/konst/test/yoga-laptop/sensors/drivers/hid-sensor-trigger.c: At top level:
/home/konst/test/yoga-laptop/sensors/drivers/hid-sensor-trigger.c:75:21: error: variable 'hid_sensor_trigger_ops' has initializer but incomplete type
 static const struct iio_trigger_ops hid_sensor_trigger_ops = {
                     ^
/home/konst/test/yoga-laptop/sensors/drivers/hid-sensor-trigger.c:76:2: error: unknown field 'owner' specified in initializer
  .owner = THIS_MODULE,
  ^
/home/konst/test/yoga-laptop/sensors/drivers/hid-sensor-trigger.c:76:2: warning: excess elements in struct initializer [enabled by default]
/home/konst/test/yoga-laptop/sensors/drivers/hid-sensor-trigger.c:76:2: warning: (near initialization for 'hid_sensor_trigger_ops') [enabled by default]
/home/konst/test/yoga-laptop/sensors/drivers/hid-sensor-trigger.c:77:2: error: unknown field 'set_trigger_state' specified in initializer
  .set_trigger_state = &hid_sensor_data_rdy_trigger_set_state,
  ^
/home/konst/test/yoga-laptop/sensors/drivers/hid-sensor-trigger.c:77:2: warning: excess elements in struct initializer [enabled by default]
/home/konst/test/yoga-laptop/sensors/drivers/hid-sensor-trigger.c:77:2: warning: (near initialization for 'hid_sensor_trigger_ops') [enabled by default]
/home/konst/test/yoga-laptop/sensors/drivers/hid-sensor-trigger.c: In function 'hid_sensor_setup_trigger':
/home/konst/test/yoga-laptop/sensors/drivers/hid-sensor-trigger.c:86:2: error: implicit declaration of function 'iio_trigger_alloc' [-Werror=implicit-function-declaration]
  trig = iio_trigger_alloc("%s-dev%d", name, indio_dev->id);
  ^
/home/konst/test/yoga-laptop/sensors/drivers/hid-sensor-trigger.c:86:7: warning: assignment makes pointer from integer without a cast [enabled by default]
  trig = iio_trigger_alloc("%s-dev%d", name, indio_dev->id);
       ^
/home/konst/test/yoga-laptop/sensors/drivers/hid-sensor-trigger.c:93:6: error: dereferencing pointer to incomplete type
  trig->dev.parent = indio_dev->dev.parent;
      ^
/home/konst/test/yoga-laptop/sensors/drivers/hid-sensor-trigger.c:94:2: error: implicit declaration of function 'iio_trigger_set_drvdata' [-Werror=implicit-function-declaration]
  iio_trigger_set_drvdata(trig, attrb);
  ^
/home/konst/test/yoga-laptop/sensors/drivers/hid-sensor-trigger.c:95:6: error: dereferencing pointer to incomplete type
  trig->ops = &hid_sensor_trigger_ops;
      ^
/home/konst/test/yoga-laptop/sensors/drivers/hid-sensor-trigger.c:96:2: error: implicit declaration of function 'iio_trigger_register' [-Werror=implicit-function-declaration]
  ret = iio_trigger_register(trig);
  ^
cc1: some warnings being treated as errors
make[4]: *** [/home/konst/test/yoga-laptop/sensors/drivers/hid-sensor-trigger.o] Error 1
make[3]: *** [_module_/home/konst/test/yoga-laptop/sensors/drivers] Error 2
make[2]: *** [sub-make] Error 2
make[1]: *** [all] Error 2
make[1]: Leaving directory `/usr/src/linux-3.13.4-1.g6eda950-obj/x86_64/desktop'
make: *** [default] Error 2

What could be the problem?

Dbus hooks

More of a feature request than an issue: Would it be possible to compile with dbus hooks so that dbus-notify can be called upon rotation?
This could track orientation, or 'mode' as per Windows usage (Tablet, tent, stand, laptop)

Trouble running 'make programs' on Ubuntu 14.04 with kernel 3.16rc5

I've got my Yoga 2 Pro mostly running the way I want, I'm primarily just trying to figure out how to get the auto-rotation in place.

I've tried cloning this repo and running make programs as advised in the docs. I'm getting the following output:

cd sensors && make all
make[1]: Entering directory `/home/dehuszar/Downloads/yoga-laptop/sensors'
cc orientation.c -o orientation
In file included from orientation.c:29:0:
libs/common.h:32:35: fatal error: X11/extensions/Xrandr.h: No such file or directory
 #include <X11/extensions/Xrandr.h>
                                   ^
compilation terminated.
make[1]: *** [orientation] Error 1
make[1]: Leaving directory `/home/dehuszar/Downloads/yoga-laptop/sensors'
make: *** [programs] Error 2

I did a sudo find / -iname for the Xrandr.h file, but there were no hits, so I'm not sure what my next steps should be. The docs made it sound like I wouldn't have to compile the drivers as the 3.15+ kernel should have them. Perhaps there are other dependencies I need to address? If I'm misunderstanding, let me know.

Thanks in advance.

Screen tearing since upgrade to Ubuntu 14.10

I have had the orientation and sensors working pretty well in Ubuntu 14.04, but upon the upgrade to 14.10, I've been experiencing screen tearing when flipping into tent mode directly from the default orientation.

If I rotate to the vertical orientation first and then go upside-down, then it seems to transition smoothly, but from default to upside-down orientation causes the viewport to show inverted duplications of the bottom half of the screen and duplicate cursors for each orientation.

I've tried both with just the compiled orientation program and also with the compiled ideapad-laptop module, just to make sure I wasn't seeing the issue because the orientation program was expecting something to be in place. The sensors program won't compile (and the docs advise against using it), but the default 3.16 sensors drivers seem to be otherwise working okay.

I've attached a screenshot so you can see what I mean.

screen tearing example

Thanks in advance,
Sam

What benefits can I expect from this script running on Ubuntu 14.04 on a Yoga 2 Pro?

At the moment Ubuntu 14.04 is running on kernel 3.14.1-031401 and everything seems to run fine after following my instruction guide: http://askubuntu.com/questions/367963/ubuntu-on-lenovo-yoga-2-pro/485632#485632

All Keyboard keys are already working and there is no issue with the brightness controll.

The only problem left is, that my wireless card sometimes dies: http://askubuntu.com/questions/517463/wireless-card-unstable-on-lenovo-yoga-2-pro

Are there any enhancements, that are not already implemented in Ubuntu 14.04?

Ubuntu 15.10 - notify.h not found

make
cd sensors && make all
make[1]: Entering directory '/home/tom/yoga-laptop/sensors'
cc orientation.c  -o orientation
^[[Aorientation.c:32:30: fatal error: libnotify/notify.h: No such file or directory 
compilation terminated.
Makefile:16: recipe for target 'orientation' failed
make[1]: *** [orientation] Error 1

Any ideas?

Many thanks,
Tom

Not working on Yoga 2 13 (non-pro)

Using generic_buffer -c 10 -n als will only output one result at a time when executing cat on in_intensity_both_raw. Same for generic_buffer -c 10 -n gyro3d. No matter how I am tilting my device I allways get the same values back. "lsusb" is not giving me any device with Id 2047:0855. Also I can't find a device with iManufacturer Invensense or iInterface HID Sensor
Interface.

Hinge detection on Yoga 13

I noticed this message repeating continually in my syslog:

Oct 15 01:33:38 ideapad-yoga13 kernel: [ 781.539719] atkbd serio0: Use 'setkeycodes e03e ' to make it known.

I also noticed that the message stops when the yoga is in tablet mode, and resumes when in laptop mode. Is there a way to use this keycode to trigger a touchpad enable/disable automatically?

Not working with Yoga 3 Pro and Ubuntu 14.10

Hi,

i played with your stuff around and couldn't get it to work. Orientation script is running but it's not updating data when I move the Yoga 3 Pro around.

Kernel:

cat /proc/version
Linux version 3.16.0-30-generic (buildd@komainu) (gcc version 4.9.1 (Ubuntu 4.9.1-16ubuntu6) ) #40-Ubuntu SMP Mon Jan 12 22:06:37 UTC 2015

Derivate:

cat /etc/issue
Ubuntu 14.10 \n \l

Seems like I do not need to use your ideapad_laptop drivers. Otherwise wlan will break on my system, too.

./orientation --touchscreen='ATML1000:00 03EB:8A10' --usleep=2000000 --count=20 --debug=4
iio device number being used is 3
iio trigger number being used is 3
Finding orientation 0
Polling the data
Reading the data
Read the data
Orientation 1, x:  -19, y: -820, z: -601
Orientation 1, x:  -19, y: -820, z: -601
Orientation 1, x:  -19, y: -820, z: -601
Orientation 1, x:  -19, y: -820, z: -601
Found orientation: or:1, prev:-1, scr:-1, 0
Orientation at 0.0 is normal

The orientation number are not updating, even if i wait for a longer period of time. Any ideas?

stuck in "Polling data" until I manually cat "in_..._raw"

When I run your program (or I even tried to build my own minimalistic program which behaves the same way", then it is stuck in the poll() command. It get's out of it when I manually cat in the sysfs the raw data file in_..._raw. Afterwards the sensor outputs the correct sensor data etc.

It is not a permissions problem (I checked that).

Do you have an idea what else could have caused the problem?

I am using Lenovo ThinkPad Twist S230u with Ubuntu 14.10 (Kernel 3.16).

Implementing on Yoga 11s

Hi! I was curious if you'd have any advice on implementing this on a Yoga 11s.
I don't have much experience working with kernel modules but I bet there probably aren't too many modifications needed to get it working on such similar hardware to the Yoga 13, and it'll be good fun to learn a bit more about managing hardware configuration.

Not working after suspend

The orientation functionality stops working after suspend. I use this crude script as a workaround on Ubuntu 15.10:

/etc/pm/sleep.d/restart_orientation

#!/bin/bash 
case "$1" in
    hibernate|suspend)
         killall orientation &
         ;;
    thaw|resume)
         sleep 30
         nohup /usr/bin/orientation > /dev/null &
         ;;
esac

Issue installing

So I went through the readme and installed all the missing depencies. I have kernel 3.16.0-38.
I'm not sure if I am doing it correctly though, I pulled the git. Extracted the tar.

Not sure if it ran already or not, but when I run "make programs sudo make programs-install"
I get

john@john-Lenovo-Yoga-2-Pro:~/yoga-laptop$ make programs sudo make programs-install
cd sensors && make all
make[1]: Entering directory /home/john/yoga-laptop/sensors' make[1]: Nothing to be done forall'.
make[1]: Leaving directory /home/john/yoga-laptop/sensors' make: *** No rule to make targetsudo'. Stop.

Am I missing anything? Or did it run already?

How to change sensor states

Hi,
I wanted to know if you found a way to set the sensors in the mode (has you say in Orientation and rotation) :
"2/ active with hysteresis - data is produced only after a significant change
3/ active with change - data is produced after any change"
Cheers,
thanks you.

Kernel 4.0 / Debian: make programs fails with "Undefined reference to `build_channel_array'"

According to README, since I am running newer kernel than 3.16 I should only type make programs?
When doing so, I am getting linking error:

$ make programs
cd sensors && make all
make[1]: Entering directory '/home/me/yoga-laptop/sensors'
cc generic_buffer.c  -o generic_buffer
/tmp/ccpVnbqv.o: dans la fonction « main »:
generic_buffer.c:(.text+0x139a): référence indéfinie vers « build_channel_array »
collect2: error: ld returned 1 exit status
Makefile:13: recipe for target 'generic_buffer' failed
make[1]: *** [generic_buffer] Error 1
make[1]: Leaving directory '/home/me/yoga-laptop/sensors'
Makefile:9: recipe for target 'programs' failed
make: *** [programs] Error 2

Compilation warning

produit@yoga$ uname -a
Linux yoga 3.13.0-30-generic #54-Ubuntu SMP Mon Jun 9 22:45:01 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

/home/produit/yoga-laptop/sensors/drivers/hid-sensor-orient.c: In function ‘hid_sensor_probe’:
/home/produit/yoga-laptop/sensors/drivers/hid-sensor-orient.c:329:9: warning: passing argument 1 of ‘hid_sensor_remove_trigger’ from incompatible pointer type [enabled by default]
hid_sensor_remove_trigger(indio_dev);
^
In file included from /home/produit/yoga-laptop/sensors/drivers/hid-sensor-orient.c:31:0:
/home/produit/yoga-laptop/sensors/drivers/./hid-sensor-trigger.h:24:6: note: expected ‘struct hid_sensor_common *’ but argument is of type ‘struct iio_dev *’
void hid_sensor_remove_trigger(struct hid_sensor_common *attrb);
^

Those are just warning, it does compile.
I have seen this code run with some kernels. But not under ubuntu 14.04.
PErhaps it is realted to this warning?

Thanks

Testing on Yoga 2 11''

Hi, I was trying to test this in a Yoga 2 device with the 3.19 kernel (I'm using Manjaro). How does the orientation script is supposed to work? When I execute it (after running make) I get this

$ sudo ./orientation 
iio device number being used is 0
iio trigger number being used is 0
Orientation 1, x:    7, y: -992, z:    7
Orientation 1, x:    7, y: -992, z:    7
Orientation at 0.0 is normal
Orientation 1, x:    7, y: -992, z:    7
Orientation 1, x:    7, y: -992, z:    7
Orientation at 1.0 is normal
ROTATE to normal
unable to find device ELAN Touchscreen
Second child (xinput) returned 256 
Orientation 1, x:    7, y: -992, z:    7
Orientation 1, x:    7, y: -992, z:    7
Orientation at 2.0 is normal
Orientation 1, x:    7, y: -992, z:    7
Orientation 1, x:    7, y: -992, z:    7
Orientation at 3.0 is normal
...

But nothing changes if I rotate my screen. I didn't install the drivers since I'm using a new kernel, or should I?

Regards

Touchpad not being disabled

Running the software on Lenovo Yoga 2 Pro, with Manjaro KDE 16.10 installed, Kernel 4.8.5, KDE Plasma 5.8.3, KDE Frameworks 5.27 QT 5.7

Rotation works great.

Touchpad is not being disabled.

I'm using libinput as touchpad (and touchscreen) driver - which is the new default for most distros.

Could that be relevant?

Installing on ubuntu 15.10

I've cloned from git master, also linux headers are installed.

I get follow exception

x@1 /x/yoga-laptop (git)-[master] % make ideapad-laptop
cd yoga_laptop && make default
make[1]: Entering directory '/x/yoga-laptop/yoga_laptop'
NOTE: You need to have the kernel-devel package installed
echo /usr/src/linux-headers-4.2.0-18-generic
/usr/src/linux-headers-4.2.0-18-generic
make -C /usr/src/linux-headers-4.2.0-18-generic SUBDIRS=/x/yoga-laptop/yoga_laptop modules
make[2]: Entering directory '/usr/src/linux-headers-4.2.0-18-generic'
  CC [M]  /x/yoga-laptop/yoga_laptop/ideapad-laptop.o
/x/yoga-laptop/yoga_laptop/ideapad-laptop.c: In function ‘ideapad_acpi_add’:
/x/yoga-laptop/yoga_laptop/ideapad-laptop.c:920:7: error: implicit declaration of function ‘acpi_video_backlight_support’ [-Werror=implicit-function-declaration]
  if (!acpi_video_backlight_support()) {
       ^
cc1: some warnings being treated as errors
scripts/Makefile.build:264: recipe for target '/x/yoga-laptop/yoga_laptop/ideapad-laptop.o' failed
make[3]: *** [/x/yoga-laptop/yoga_laptop/ideapad-laptop.o] Error 1

Makefile:1398: recipe for target '_module_/x/yoga-laptop/yoga_laptop' failed
make[2]: *** [_module_/x/yoga-laptop/yoga_laptop] Error 2
make[2]: Leaving directory '/usr/src/linux-headers-4.2.0-18-generic'
Makefile:24: recipe for target 'default' failed
make[1]: *** [default] Error 2
make[1]: Leaving directory '/x/yoga-laptop/yoga_laptop'
Makefile:21: recipe for target 'ideapad-laptop' failed
make: *** [ideapad-laptop] Error 2

pls I need a hint

How to make it work for Thinkpad Yoga?

Hi,

I have a Thinkpad Yoga laptop, and I am trying to make the sensors work, with no luck so far.
I am using Ubuntu 14.04 with kernel 3.13.0-18-generic on AMD64, and I managed to compile the drivers you provided (the Makefile needs to be adapted though as for the Fedora case).
I blacklisted the original modules and inserted yours instead as in the README, then ran setup (the first line has to be changed to #!/bin/bash, since you use bashisms and on Debian derivatives, sh != bash).

This is the output of orientation --debug 4

iio device number being used is 0
iio trigger number being used is 0
Finding orientation 0
Polling the data

and of sudo ls -R /sys/bus/iio/devices/iio:device0

/sys/bus/iio/devices/iio:device0:
buffer           in_accel_offset          name       subsystem
dev          in_accel_sampling_frequency  power      trigger
in_accel_hysteresis  in_accel_scale       scan_elements  uevent

/sys/bus/iio/devices/iio:device0/buffer:
enable  length

/sys/bus/iio/devices/iio:device0/power:
async             runtime_active_kids  runtime_status
autosuspend_delay_ms  runtime_active_time  runtime_suspended_time
control           runtime_enabled      runtime_usage

/sys/bus/iio/devices/iio:device0/scan_elements:
in_accel_x_en     in_accel_y_en     in_accel_z_en
in_accel_x_index  in_accel_y_index  in_accel_z_index
in_accel_x_type   in_accel_y_type   in_accel_z_type

/sys/bus/iio/devices/iio:device0/trigger:
current_trigger

Please tell me if you need more informaton.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.