From mboxrd@z Thu Jan 1 00:00:00 1970 From: Hans de Goede Subject: Re: Auto-detecting touchscreen controller and dealing with hw configuration differences on q8 tablets Date: Mon, 20 Jun 2016 13:03:18 +0200 Message-ID: <17e69e9e-06be-dc4f-cd47-152f6290d2ec@redhat.com> References: <5E70AD96-4E8E-4430-AF99-0AA0FCF5F8E7@konsulko.com> Reply-To: hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable Return-path: Sender: linux-sunxi-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org In-Reply-To: <5E70AD96-4E8E-4430-AF99-0AA0FCF5F8E7-OWPKS81ov/FWk0Htik3J/w@public.gmane.org> List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , To: Pantelis Antoniou Cc: Maxime Ripard , Chen-Yu Tsai , "u-boot-0aAXYlwwYIKGBzrmiIFOJg@public.gmane.org" , devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org, linux-sunxi , Jelle van der Waa List-Id: devicetree@vger.kernel.org Hi, On 20-06-16 11:27, Pantelis Antoniou wrote: > Hi Hans, > > I=E2=80=99m going to commend only on the overlay related parts since I=E2= =80=99m not I > get all the nuances right. No problem and thanks for the answer anyways! >> On Jun 19, 2016, at 14:06 , Hans de Goede wrote: >> 2) Give the user some way to override the dts settings. >> >> Which after a somewhat long intro brings me to the actual purpose of thi= s thread, discuss >> how to best deal with this. I again see 2 options: >> >> 1) Put a disabled gsl1680 node in the dts file, have a q8_autodetect.c i= n u-boot >> which probes i2c and if it finds the gsl1680 nodes enables it, and patch= es in a best-effort >> default for which fw file to use. Allow the user to set a touchscreen_fw= u-boot env >> variable which will override this. Also allow the user to set a touchscr= een_inverted_x env >> variable to add inverted-x to the dt node for the gsl1680. >> > > That can work. The problem is that having anything requiring smarts in u-= boot always > leads to trouble with users. It all depends on your user=E2=80=99s techni= cal proficiency, if > they are comfortable tweaking things in u-boot it=E2=80=99s fine. If it= =E2=80=99s not, expect lots of > bricked boards when they mess up. > >> 2) Write an in kernel overlay manager which does auto-detect as describe= d by 1, and >> loads an overlay for the detected touchscreen controller, with module op= tions to allow >> specifying the fw-file, x-inversion, etc. >> >> One things which worries me about 2. is that we would need to have 2 ove= rlay files >> per fw-file, one regular config, one inverted-x, or is it possible for t= he overlay >> manager to modify an overlay before applying it ? >> > > Yes, it=E2=80=99s quite possible. You can even have stacked overlays. Ok, is there any example code how to change an overlay before applying it o= ut there, or if not can you point to the functions to use to do this ? Specifically my plan is to: 1) Have a single overlay for q8 tablets with gsl1680 tablets 2) Write an in kernel overlay manager which when it detects a gsl1680 touch= screen will pick a best-default firmware-file + matching resolution + swap-x-y bas= ed on which SoC (A13/A23/A33) the tablet is based on as well as the gsl1680's chi= p-id and will then "patch" this info into the overlay before applying it. This means being able to set / modify several string, int and bool dt properties= . 3) Offer a kernel-module option for the overlaymanager which will allows overriding the defaults for the firmware-filename, etc. This is also why I want to go with the patch approach instead of having multiple dt-overlay files. Thanks & Regards, Hans --=20 You received this message because you are subscribed to the Google Groups "= linux-sunxi" group. To unsubscribe from this group and stop receiving emails from it, send an e= mail to linux-sunxi+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/d/optout.