Giter VIP home page Giter VIP logo

Comments (20)

pfps avatar pfps commented on May 21, 2024

Hmm. I'll take a look.

peter

On 02/25/2014 03:24 AM, sirkonst wrote:

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?


Reply to this email directly or view it on GitHub
#2.

from yoga-laptop.

pfps avatar pfps commented on May 21, 2024

iio_trigger_get_drvdata should be defined in trigger.h

Please check to see whether /usr/src/kernels/uname -r/include/linux/iio/trigger.h
has this definition. It should be near the end.

If it's not there, you are probably running a kernel that is too old for these
drivers. What kernel are you running?

peter

On 02/25/2014 03:24 AM, sirkonst wrote:

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?


Reply to this email directly or view it on GitHub
#2.

from yoga-laptop.

sirkonst avatar sirkonst commented on May 21, 2024

I use OpenSuse and kernel-desktop (3.13.4-1.g6eda950-desktop).

Yes, I have iio_trigger_get_drvdata definition:

$ grep -n iio_trigger_get_drvdata /usr/src/linux/include/linux/iio/trigger.h
99: * retrieved by iio_trigger_get_drvdata().
107: * iio_trigger_get_drvdata() - Get trigger driver data
112:static inline void *iio_trigger_get_drvdata(struct iio_trigger *trig)

Alsa, I replaced in Makefile one line:

- KDIR := /usr/src/kernels/$(shell uname -r)
+ KDIR := /lib/modules/$(shell uname -r)/build

I tried replace to KDIR := /usr/src/linux/ bu got same error.

from yoga-laptop.

pfps avatar pfps commented on May 21, 2024

I'm stumped. It appears that you are getting a trigger.h that has the wrong,
or no, definitions.

You can see which files are included by adding
ccflags-y := -H
to the Makefile. Hopefully that will help.

It appears that trigger.h is included indirectly, so you could also move the
include up higher so that the direct include dominates. If that makes a
change, however, then something is strange in your setup.

peter

PS: /lib/modules/... should be asymlink back to /usr/src/kernels/... so that
change shouldn'thave affected anything.

On 02/25/2014 04:51 AM, sirkonst wrote:

I use OpenSuse and kernel-desktop (3.13.4-1.g6eda950-desktop).

Yes, I have iio_trigger_get_drvdata definition:

|$ grep -n iio_trigger_get_drvdata /usr/src/linux/include/linux/iio/trigger.h
99: * retrieved by iio_trigger_get_drvdata().
107: * iio_trigger_get_drvdata() - Get trigger driver data
112:static inline void *iio_trigger_get_drvdata(struct iio_trigger *trig)
|

Alsa, I replaced in Makefile one line:

|- KDIR := /usr/src/kernels/$(shell uname -r)

  • KDIR := /lib/modules/$(shell uname -r)/build
    |

I tried replace to |KDIR := /usr/src/kernels/$(shell uname -r)| bu got same
error.


Reply to this email directly or view it on GitHub
#2 (comment).

from yoga-laptop.

sirkonst avatar sirkonst commented on May 21, 2024

With ccflags-y := -H I get http://pastebin.com/WnrcVqkC.

from yoga-laptop.

pfps avatar pfps commented on May 21, 2024

Strange. You are getting the right includes, in the right order.

There must be something that is preventing trigger.h from being expanded
correctly.

Ithink that the next step is to try to take a look at the preprocessor output.

Try a make with

cc-flags-y := -E

and hid-sensor-trigger.o as the first item in obj-m

This should produce a strange error message about a wrong format, but it
should also create a large text file in hid-sensor-trigger.o

That file should contain the definitions of the the various iio_trigger
functions. I see

101 "include/linux/iio/trigger.h"

static inline attribute((no_instrument_function)) void
iio_trigger_set_drvdata(struct iio_trigger *trig, void *data)
{
dev_set_drvdata(&trig->dev, data);
}

and

int iio_trigger_register(struct iio_trigger *trig_info);

and

void iio_trigger_unregister(struct iio_trigger *trig_info);

If you don't see these, then there is something going wrong with the
preprocessor guards (the things at the beginning of the .h files that look
like "#ifndef X #define X"). The next step would be to find out why, but I'm
not sure how to proceed. You could remove the guard (including thebalancing
#endif) plus the include of ../trigger.h in hid-sensor-trigger.c itself and
see if that helps. Perhaps simpler would be to change the name of the guard
macro. However, if this is the case then it appears that something is going
wrong in the kernel build setup, which is very puzzling.

On the other hand, if you do see these definitions, then something even
weirder is going wrong. Try to just compile the file (move it to a .c file and
run cc-c on it). If that produces no errors then the problem is likely that
there is a kernel compile flag that is somehow producing the errors, but I
can't imagine which flag it is. However, you might be able to proceed by
moving the .o file to the right place and continuing.

peter

PS: I forgot one of the things that needs to be done to compile the drivers:

2.5/ Copy the updated hid-sensor-ids.h to the kernel includes (you may have
to adjust the path to where your kernel includes are)
sudo cp /usr/src/kernels/uname -r/include/linux/hid-sensor-ids.h
/usr/src/kernels/uname -r/include/linux/hid-sensor-ids.h.orig
sudo cp hid-sensor-ids.h /usr/src/kernels/uname -r/include/linux/hid-sensor-ids.h

On 02/25/2014 11:53 PM, sirkonst wrote:

With |ccflags-y := -H| I get http://pastebin.com/WnrcVqkC.


Reply to this email directly or view it on GitHub
#2 (comment).

from yoga-laptop.

sirkonst avatar sirkonst commented on May 21, 2024

I did as you said (diff for Makefile http://pastebin.com/vJZmtfhq). But I didn't see "a strange error message about a wrong format" after run make and hid-sensor-trigger.o was not created.... I didn't see any new files in folder.

PS: Why in a repo for sensors/drivers contains *.ko files?

from yoga-laptop.

pfps avatar pfps commented on May 21, 2024

On 02/27/2014 11:19 PM, sirkonst wrote:

I did as you said (diff for Makefile http://pastebin.com/vJZmtfhq). But I
didn't see "a strange error message about a wrong format" after run make and
hid-sensor-trigger.o was not created.... I didn't see any new files in folder.

PS: Why in a repo for sensors/drivers contains *.ko files?


Reply to this email directly or view it on GitHub
#2 (comment).

Hmm. The -E flag should have directed the compiler to not create an object
file but to instead just run the preprocessor. What that does is to put the
output of the preprocessor where the object file is expected, causing the next
step of the process to fail with a message complaining about seeing the wrong
sort of file.

One problem with debugging this issue is that compiling kernel modules
requires quite a few special options, thus the strange way of running some
things.

How about having just hid-sensor-trigger.o in the obj-m macro? That should
provide a cleaner setup.

Oooh. Maybe nothing happened because make couldn't detect that anything was
needed. Try a make clean first.

peter

PS: Yes, I shouldn't have included the .ko files. I'll do an update to
remove them.

from yoga-laptop.

or1426 avatar or1426 commented on May 21, 2024

I just ran against exactly this issue (running default arch kernel). It appears that the "CONFIG_IIO_TRIGGER" macro is undefined and that most of trigger.h is wrapped in an #ifdef for this macro (adding "-D CONFIG_IIO_TRIGGER=1" to ccflags-y lets the compilation get a bit further although obviously this isn't a solution).

As far as I can tell this is because of "# CONFIG_IIO is not set" on line 5615 in this file. I'm currently looking at enabling iio support either by compiling a custom kernel or a module.

I am a bit surprised by (read sceptical of) this because (at least some of) iio support seems to be classed as staging in the kernel so this page would suggest that fedora shouldn't have it either (I've been unable to find the config file for fedora to check). pfps did you compile your kernel manually with this option, add a module or did it come by default?

from yoga-laptop.

pfps avatar pfps commented on May 21, 2024

IIO was turned on for Fedora 20 a while ago.

peter

On 04/04/2014 02:55 PM, or1426 wrote:

I just ran against exactly this issue (running default arch kernel). It
appears that the "CONFIG_IIO_TRIGGER" macro is undefined and that most of
trigger.h is wrapped in an #ifdef for this macro (adding "-D
CONFIG_IIO_TRIGGER=1" to ccflags-y lets the compilation get a bit further).

As far as I can tell this is because of "# CONFIG_IIO is not set" in this
file
https://projects.archlinux.org/svntogit/packages.git/tree/trunk/config.x86_64?h=packages/linux.
I'm currently looking at enabling iio support either by compiling a custom
kernel or a module.

I am a bit surprised by this because iio support seems to be classed as
staging in the kernel so this page
https://fedoraproject.org/wiki/KernelStagingPolicy would suggest that
fedora shouldn't have it. pfps did you compile your kernel manually with
this option or did it come by default?


Reply to this email directly or view it on GitHub
#2 (comment).

from yoga-laptop.

jordirelats avatar jordirelats commented on May 21, 2024

I'm using opensuse 13.1 and I have the same problem, I can not make the driver.

My know how is very limited, and it is dificult to me to understand what is write above.

Do you manage to make work on opensuse?

Jordi

from yoga-laptop.

pfps avatar pfps commented on May 21, 2024

Without some error log I can't determine what the problem is.

If you are seeing the same problem as or1426 then your distribution doesn't have the IIO subsystem, and you would have to create a custom version of the kernel with that turned on.

from yoga-laptop.

or1426 avatar or1426 commented on May 21, 2024

jordirelats: Its probably possible to build and install a custom kernel on opensuse. It was a fairly painless process on arch. Keeping it updated was annoying though so your best bet (what I'm doing at the moment) is probably to dual boot fedora for when you want to try this stuff out.

from yoga-laptop.

jordirelats avatar jordirelats commented on May 21, 2024

Thankyou

I don't have enougth skills to do that, I just want to know if some body has found a easier way to do that on opensuse.

And other option is to change distrubution to Fedora or Ubuntu

Jordi

from yoga-laptop.

pfps avatar pfps commented on May 21, 2024

I suppose that one way forward for you is to talk to the people in charge of
opensuse to see whether IIO can be turned on for it.

peter

On 05/14/2014 08:08 AM, jordirelats wrote:

Thankyou

I don't have enougth skills to do that, I just want to know if some body has
found a easier way to do that on opensuse.

And other option is to change distrubution to Fedora or Ubuntu

Jordi


Reply to this email directly or view it on GitHub
#2 (comment).

from yoga-laptop.

leoc avatar leoc commented on May 21, 2024

I am about to compile a custom kernel on my Archlinux system. As I am
not very experienced with this matter. If I may ask here, where can I
find information on enabling and configuring IIO correctly?

I set CONFIG_IIO=y, compiled and booted. Still when trying to make
the sensor drivers, it seems like CONFIG_IIO_TRIGGER is undefined.
When defining it via ccflags-y, it seems like
CONFIG_IIO_CONSUMERS_PER_TRIGGER is undefined.
So my kernel was compiled without IIO, no?

EDIT: I am about to recompile with CONFIG_IIO_TRIGGER=y and hope that will declare everything needed. 👍

from yoga-laptop.

pfps avatar pfps commented on May 21, 2024

This is beyond my expertise, but it does look like the IIO system is not
totally configured in your system.

I didn't have to do this, as Fedora 20 has the IIO system set up.

peter

On 06/02/2014 10:47 AM, Arthur Leonard Andersen wrote:

I am about to compile a custom kernel on my Archlinux system. As I am
not very experienced with this matter. If I may ask here, where can I
find information on enabling and configuring IIO correctly?

I set |CONFIG_IIO=y|, compiled and booted. Still when trying to make
the sensor drivers, it seems like |CONFIG_IIO_TRIGGER| is undefined.
When defining it via ccflags-y, it seems like
|CONFIG_IIO_CONSUMERS_PER_TRIGGER| is undefined.
So my kernel was compiled without IIO, no?


Reply to this email directly or view it on GitHub
#2 (comment).

from yoga-laptop.

leoc avatar leoc commented on May 21, 2024

Ok. Thanks. Maybe @or1426 can give a hint? I compiled via Arch Build System and added

CONFIG_IIO=y
CONFIG_IIO_TRIGGER=y
CONFIG_IIO_BUFFER=y
CONFIG_IIO_BUFFER_CB=y
CONFIG_IIO_KFIFO_BUF=m
CONFIG_IIO_TRIGGERED_BUFFER=m

But maybe I am mistaken completely.

from yoga-laptop.

or1426 avatar or1426 commented on May 21, 2024

I'm in the middle of exams at the moment so haven't looked at this stuff for a while. That said I advise dual booting Fedora as the solution. Kernel updates aren't exactly infrequent (especially on arch) and keeping a custom configuration up to date looses it's appeal fairly rapidly (unless you know a better way than recompiling the custom kernel every time the main one gets updated).

from yoga-laptop.

leoc avatar leoc commented on May 21, 2024

Alright, thanks! I got it compiling correctly. Somehow my config was not recognized. Now I used xconfig for creating a configuration and finally it worked.

I think about an automatically generated PKGBUILD for the AUR, whenever a new kernel gets released for builds with the ABS. Then I can use packer -Syyu to keep my system up to date.
In theory this approach sounds painless. 👍

from yoga-laptop.

Related Issues (20)

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.