Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp346474pxb; Thu, 2 Sep 2021 05:42:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzKq0SEU4EAmyNhy22/3JagW6G4o4PZx7BRmaHknpD0G3DwtH/py1oF5ZH75VuqMtByQTRb X-Received: by 2002:a17:907:1c01:: with SMTP id nc1mr3548282ejc.504.1630586557346; Thu, 02 Sep 2021 05:42:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630586557; cv=none; d=google.com; s=arc-20160816; b=LICNLyavms6N1YQ5gQAW7+ZBB3xBRKO8JOX2QMMlSbsALJB92rLPnW2r9gkT2bvrGA z/3o+OHM+6HrdbJoCH6GVb5AFQQRazy5buUoosGerEtBX7Lx3aqyP//m4wd1UHLw1OKi qacOqVuCa138vzL3Xp1fwCFpEOlzhIvfWpm6TbLX1/N3GX4He2EM77dKVp/GNQRfMEVj yB1ve5lL7z81yqngz6ojVsqULdHUokyBSJkvcQPveuiSBNK4ic1eKfAe6wuOidwiCGSa rNJcgWH5hfitwr6b5F8SqarWPPAPdtLPNRp8KDjIsk9WIzaKB6IT5UPCyYw6GurwIA6O fxUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=csJI04gD3zaIbD2bwDlVjNA1ZtD/B7+S6sqXXeIBark=; b=dOG1bZ9hrv99pYQv5dy6qJBCdgBCv3rbfHgXp7VbxAIXVWNIGMoPhv06GzAZr6Rana RH36s0rJBVGr4XogwFiE1L/vGsvO1revBSdXNrsGdVi/HaIHf1X1FGsepPwdHO7/Si4u PL41Fk6qVKy8KbtHe1dEdqNkOJ8ZAlX0IXTa6+py2Aqkrn0MOC1t0PJLSaNgi3LfvuRk 8eefd7NLi93Tx/IUzIvpjbhwYh5+RIjocSZayqaL+Q3aG9rqFSWuVW8wVbTV3RBIRdqg T107pYOR9hw+Mzktfyor66XhtUCqdrlhT60OeKmrwcQQ6OelukpoXV9vN8YCDTVTindF XqzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Ms0uIm39; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b26si1977124eds.500.2021.09.02.05.42.06; Thu, 02 Sep 2021 05:42:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Ms0uIm39; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344474AbhIBMkd (ORCPT + 99 others); Thu, 2 Sep 2021 08:40:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51312 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234098AbhIBMkc (ORCPT ); Thu, 2 Sep 2021 08:40:32 -0400 Received: from mail-wr1-x436.google.com (mail-wr1-x436.google.com [IPv6:2a00:1450:4864:20::436]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6AC76C061575; Thu, 2 Sep 2021 05:39:33 -0700 (PDT) Received: by mail-wr1-x436.google.com with SMTP id n5so2663335wro.12; Thu, 02 Sep 2021 05:39:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=csJI04gD3zaIbD2bwDlVjNA1ZtD/B7+S6sqXXeIBark=; b=Ms0uIm39URlPnIU7XBTUH0zhkU1enB8aBLgjRSwhb9I5CpeEDb9LCv3+rRh88Xk5IP unAe4xOQbBG6CgtO5iZqQ/LrhzBVf4WgaGTfN/bOdwDz25s7HFIkbN511xYILeaZdmCg SueO1/o6j9TdiXUL3OgwSGgOMsjHVjbnOdt7U87ZvY+cr9kQIyBQEOTigmDyhICt21gQ axRjG8bA2wYa/J6ILvFwInqJA5b7UwpknNQ8OMgNKpoUQVRMqIKx3Gwx5P9CK74qg9KF HALFAhl5LiChxLzn+MEPqdQPNW8vEjYc1vs3sh8k3FoJrmSyOZBhTLdsMWV+jWxEa3cC GoVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=csJI04gD3zaIbD2bwDlVjNA1ZtD/B7+S6sqXXeIBark=; b=Sbow6F8am/p1AJJYk8nOCg2Vz/tPzc3McHAFNY2ewhecyUvCJruzohKaMM84mzTb8r RUqHeG+cI6K36axckgBpkGtpso4f0eDpwU7iCoxci/YvhVOWdO4ruDydUF+3lYFNUWfo DjyXCdE8xgWvIxvaiit4qOuuCz7SIkJvjPaeGKJ62fJpyA+TVe/Vf31LC0us9FP3+UZc 8Mr0EUn9tD/pNYNWg+pb9c1b4QGemw7z4dFh/9nJadpiOErtt7RNN95XabdlK1AJLgsq Hpibyom+QQOPH4PeMWkci6sXHNCrNmnM1P2yWwKisR+FL0OaD2p1w/zCo0I39EwA+xUe ozxg== X-Gm-Message-State: AOAM533I36lRWO4mGBKIyPV1xB8TMDKzUpAcaejt94LzlYR/xsnjkBSN O5OZS+wGZzuIKY3P5kLFntJh5HoMIlNe9XxbkISySZMy+7ELPSHs X-Received: by 2002:adf:804a:: with SMTP id 68mr3520579wrk.236.1630586371541; Thu, 02 Sep 2021 05:39:31 -0700 (PDT) MIME-Version: 1.0 References: <20210901192229.29864-1-rpimentel.silva@gmail.com> <4e8ad91c-2554-4b8f-94db-aa5add5f524d@denx.de> In-Reply-To: From: Rogerio Pimentel Date: Thu, 2 Sep 2021 09:39:20 -0300 Message-ID: Subject: Re: [PATCH] Input: ili210x - Set the device name according to the device model To: Marek Vasut Cc: dmitry.torokhov@gmail.com, hansemro@outlook.com, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 1, 2021 at 5:48 PM Marek Vasut wrote: > > On 9/1/21 10:27 PM, Rogerio Pimentel wrote: > > On Wed, Sep 1, 2021 at 4:46 PM Marek Vasut wrote: > >> > >> On 9/1/21 9:22 PM, Rogerio Pimentel wrote: > >> > >> [...] > >> > >>> diff --git a/drivers/input/touchscreen/ili210x.c b/drivers/input/touchscreen/ili210x.c > >>> index 30576a5f2f04..ca7af4a6f588 100644 > >>> --- a/drivers/input/touchscreen/ili210x.c > >>> +++ b/drivers/input/touchscreen/ili210x.c > >>> @@ -19,6 +19,8 @@ > >>> #define ILI251X_DATA_SIZE1 31 > >>> #define ILI251X_DATA_SIZE2 20 > >>> > >>> +#define ILI_NAME_LEN 27 > >>> + > >>> /* Touchscreen commands */ > >>> #define REG_TOUCHDATA 0x10 > >>> #define REG_PANEL_INFO 0x20 > >>> @@ -394,6 +396,7 @@ static int ili210x_i2c_probe(struct i2c_client *client, > >>> struct input_dev *input; > >>> int error; > >>> unsigned int max_xy; > >>> + char *model_name; > >>> > >>> dev_dbg(dev, "Probing for ILI210X I2C Touschreen driver"); > >>> > >>> @@ -440,7 +443,11 @@ static int ili210x_i2c_probe(struct i2c_client *client, > >>> i2c_set_clientdata(client, priv); > >>> > >>> /* Setup input device */ > >>> - input->name = "ILI210x Touchscreen"; > >>> + input->name = "Ilitek Touchscreen"; > >>> + model_name = (char *)input->name; > >>> + snprintf(model_name, ILI_NAME_LEN, "Ilitek %s Touchscreen", > >> > >> Which ilitek devices do you have available exactly ? > >> > >> There is a firmware interface which does report the device type, but I > >> don't know whether it works on all the ilitek touchscreen devices. If it > >> does, then it could be used here to pull the type from the firmware and > >> then use this instead > >> > >> snprintf(model_name, ILI_NAME_LEN, "Ilitek ILI%04x Touchscreen", type); > >> > >> Try this command against the touch controller, it sends it command 0x61 > >> and reads two bytes of the reply: > >> i2ctransfer -f -y 1 w1@0x41 0x61 r2 > >> 0x10 0x25 # <---- on ILI2510 it reports 0x25 0x10 in reverse > > > > Thanks for the comments and suggestions. I'll make the changes and send V2. > > Can you tell which ILI2xxx touch controller you have exactly ? Now I have only the ILI2511. Will also have to support ILI2510 and ILI2118. > Can you share the output of the 'i2ctransfer' (from i2c-tools) command > above ? # i2ctransfer -f -y 3 w1@0x41 0x61 r2 0x11 0x25