Compact initialization of mpu6050 driver.#36
Conversation
| // ---------------------------------------------------------------------------- | ||
| // Reading data from I2C2 device to the static mpu6050_data structure | ||
| // ---------------------------------------------------------------------------- | ||
| static int mpu6050_read_data(void); |
There was a problem hiding this comment.
Statics should not be exported in headers
There was a problem hiding this comment.
Without it have error of compilation like:
error: static declaration of ‘function’ follows non-static declaration static int function()
| }; | ||
| }; | ||
|
|
||
| &am33xx_pinmux { |
There was a problem hiding this comment.
Please tell, why so massive changes in dtsi?
There was a problem hiding this comment.
I use the kernel version 4.14, please see beagleboard/linux@82d75af
There was a problem hiding this comment.
And it lead to issues to be fixed in "Remove wrong copy/past from am335x-bone-common.dtsi"
Anyway, if some commit is not yet merged, it is needed to rebase and modify it instead of adding a patch on top.
37093c4 to
d7458ad
Compare
d7458ad to
e0a6e40
Compare
- use one class structure for all internal files - use one show function for all class files - use dtsi file from 4.14 kernel branch - cdev device added - use kthread_run to read i2c data - use timer callback to allow reading i2c data - use wait_for_completion to sync timer with thread - use spin_lock_irqsave to lock read/write data area Signed-off-by: oleksii-kogutenko <oleksii.kogutenko@gmail.com>
e0a6e40 to
33198da
Compare
an1kh
left a comment
There was a problem hiding this comment.
Without it have error of compilation like:
error: static declaration of ‘function’ follows non-static declaration static int function()
Please fix this issue. Looks like both header and source should not have "static".
Everything else if fine.
Maybe finding which parameter to show need improvement: switch from if-else to some pointer logic. But current implementation is OK. Keep it.
Compact initialization of mpu6050 driver.
Signed-off-by: oleksii-kogutenko oleksii.kogutenko@gmail.com