LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer
User Name
Password
Linux - Embedded & Single-board computer This forum is for the discussion of Linux on both embedded devices and single-board computers (such as the Raspberry Pi, BeagleBoard and PandaBoard). Discussions involving Arduino, plug computers and other micro-controller like devices are also welcome.

Notices


Reply
  Search this Thread
Old 01-20-2018, 09:25 AM   #1
vegeta1in
LQ Newbie
 
Registered: Jan 2018
Posts: 5

Rep: Reputation: Disabled
"Back-porting" silead GSL1680 touchscreen driver on custom linux board(Emcraft BSP)


Hi all,

I am working on a project with a custom linux board(https://www.emcraft.com/products/777) and I am looking to integrate a touch-screen device with it(based on silead gsl1680). I referred to this patch https://patchwork.kernel.org/patch/9172645/ and did the following things with a hope to compile the code with the custom TS.

1) add silead_gsl1680.txt in -> /Documentation/devicetree/bindings/input/touchscreen
2) change Kconfig found in -> drivers/input/touchscreen/Kconfig b/drivers/input/touchscreen/Kconfig
3) change makefile in -> drivers/input/touchscreen/Makefile b/drivers/input/touchscreen/Makefile
4) add silead.c in -> /drivers/input/touchscreen/silead.c b/drivers/input/touchscreen/silead.c
5) Also added the relevant information in the .kernel file ==> CONFIG_TOUCHSCREEN_SILEAD=y and commented out the goodix config.


However, I get an error saying
Code:
drivers/input/touchscreen/silead.c:79:32: error: field 'prop' has incomplete type
  struct touchscreen_properties prop;
                                ^
drivers/input/touchscreen/silead.c: In function 'silead_ts_request_input_dev':
drivers/input/touchscreen/silead.c:106:2: error: too many arguments to function 'touchscreen_parse_properties'
  touchscreen_parse_properties(data->input, true, &data->prop);
I asked this question to the BSP vendor and he said that apparently the driver is not compatible with the Emcraft kernel version, so I would have to make them manually compatible("backporting").
How do I go about doing that?

Also, my LCD vendor has provided another set of .c and .h files for this particular LCD screen, but after putting them in my linux tree, I get an error saying

Code:
fatal error: linux/earlysuspend.h: No such file or directory. Compilation terminated
I am not sure how to go about this stuff. Any pointers would be very much appreciated.

Thanks

Last edited by vegeta1in; 01-20-2018 at 09:32 PM.
 
Old 01-21-2018, 05:58 AM   #2
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,623

Rep: Reputation: 208Reputation: 208Reputation: 208
To help you it will be useful to know which version of the kernel you're on right now and which version the driver did work with. The reason is that the internal kernel interfaces do change and drivers needs to adapt. Those included in the mainline are modified each time the interface changes. Those that are not.. well.. that's exactly your case.

With the first code example, you have an error about touchscreen_parse_properties. In he latest kernels it has the following parameters:
Code:
void touchscreen_parse_properties(struct input_dev *input, bool multitouch,
				  struct touchscreen_properties *prop);
But in 4.4 it was:
Code:
void touchscreen_parse_properties(struct input_dev *dev, bool multitouch);
It seems to me that your kernel is closer to 4.4 than to 4.15. It means that you should remove the prop parameter and check how to pass the data to the right function so that the end result is the same.

If you want to compare code between different kernel versions you can use sites like: https://elixir.free-electrons.com/linux/
 
Old 01-22-2018, 02:59 AM   #3
vegeta1in
LQ Newbie
 
Registered: Jan 2018
Posts: 5

Original Poster
Rep: Reputation: Disabled
Hi Mara,

Thanks a lot for the reply. I see. The version I am using right now is => 4.5.0
I didn't quite get what you mean by "which version the driver did work with", but I did use the source-code in the current linux kernel source tree from git-hub (which is 4.15.0) for compiling. No surprises it didn't compile.

I checked the repository and silead.c does not exist for v4.5.0, and I am not too confident of changing the device driver source file itself since I have absolutely no experience in doing so. But if that is the only way, I will have to go for it. Is there any easier way?

Thanks again!
 
Old 01-22-2018, 05:24 PM   #4
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,623

Rep: Reputation: 208Reputation: 208Reputation: 208
Is this the same driver as: https://lkml.org/lkml/2015/8/25/738

This is a post from 2015 so way before your 4.5 kernel. Your ideal solution would be to find the version that it was for 4.5 (if there are no differences in functionalities).

What I can see is that it was added in 4.8. If you go from there, you have three versions to go. It should be way easier than from 4.15.

Other option is to do the modifications. The driver isn't big so it shouldn't be very hard. However, the first option may be easier if you're starting with kernel programming.
 
1 members found this post helpful.
Old 01-22-2018, 05:43 PM   #5
vegeta1in
LQ Newbie
 
Registered: Jan 2018
Posts: 5

Original Poster
Rep: Reputation: Disabled
I am absolutely ecstatic!
I used the driver you shared in the link and the code just compiled! Well that's a step forward(or at least feels like it at the moment). Not sure if it will work with my touchscreen however, it is something I will try out soon.

I too tried getting the driver for 4.5, but couldn't find one in the 4.5 version on github => https://github.com/torvalds/linux/tags?after=v4.6-rc7

Is there any other place I should look for, for the driver belonging to the 4.5 kernel?
Also, the above driver just compiled, but is there any potential pitfall I should be aware of? Is it recommended to get the driver meant for v4.5?

Thanks a zillion!
 
Old 01-24-2018, 04:49 PM   #6
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,623

Rep: Reputation: 208Reputation: 208Reputation: 208
To answer your questions in an order

The driver did exist before 4.8. However, until that time it wasn't included in the official kernel. There have been submissions of it on the LKML (lkml.org, the linux kernel mailing list) and you can find them in the mailing list archive.

The version you have in 4.8 got through a review so I'd probably stick to it for now. You can look what the modifications were from 4.8 to 4.15 using git log on the driver file. You may want to backport some of the modification maybe if they are related to the features you need or fix bugs you'll run into. Just trying the driver you have looks like a good first step however.

What the risk may be? Normally there should be none. This is a pretty small change in kernel versions. Differences happen when kernel internal interfaces change. It might be that the touchscreen one didn't change much between 4.5 and 4.8. I find it probable. If there are important changes, the code simply does not compile or it gives warnings (in a very big majority of cases!). If you have no warnings when compiling it, it should be fine (beware of warning about assignments of wrong type, for example, after backporting a driver).
 
1 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] BSP porting Question from 2.6.17 to 2.6.39 prophEt666 Linux - Embedded & Single-board computer 7 09-26-2016 03:02 PM
BSP porting guide from 2.6.17 to 2.6.39 prophEt666 Linux - Kernel 0 09-23-2016 11:00 PM
EP440XS board BSP question linuxwang Linux - Newbie 1 09-23-2009 02:33 PM
UART driver porting from 2.4.20 to 2.6.10 for freescale imx21ADS21 board. AshishVyas Linux - Newbie 1 05-15-2008 07:30 AM
Compiling Embedded (BSP) Linux for EP-8248 Board jasonj Linux - General 0 11-13-2007 07:27 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer

All times are GMT -5. The time now is 12:31 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration