Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp1070806pxb; Wed, 1 Sep 2021 16:49:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxSCScHq41qAHSn+00nLVJQitLt67Oy6iCypYDOYSbfU3IXDfKOTYYrzuZsZMhUbZvKXBjM X-Received: by 2002:a17:907:7601:: with SMTP id jx1mr461119ejc.69.1630540180203; Wed, 01 Sep 2021 16:49:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630540180; cv=none; d=google.com; s=arc-20160816; b=If6ZEwGuqjrZsNPHwHC8aAMvbL9ICjeWM28GKqLvnCHhXq85coXGu6GNdRHHeKacHK YlqYOJj/qw511n2aA1gOLm7BexbfpOi/fxiwmuPeAZKYWXkKBqW7IG34hX3cFyM0YzPm LdfK3SYN6l2NLMgwn9HylEYehcjXOhLfWONN5gdFSII9VWe9qHjWqztjfg1omHuY2r2t pKxTvx1ZVru8SSutcGCt5kK83lzsWiQhg1x0PbDlXkt/qSnROqZKwJ35FxgSCO2uphQS rbMAfb1TEQumZpHgtWDq3NnSEeXOt1cyeDMpQqb9ubQfu3PTckMDzcdFNdjDfjHbJFYw lhXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:to:from:dkim-signature; bh=PL6tMWt+pDh+s6ofmXVwfU83Mqm7g1Pf+LEmUoSo0nE=; b=qAaL4r1UTbD4KVIPBSqh85+jtl1vLyh9+RgjVAoIyF/KVGP5e7E3p5PdqCMNAHCQAw g5Ly75zeNsFo4gk09JmklUP134xtXPgkt+wA7qMl7TcRfGuCNq2dHS3NcW6O9QfnWH8p yR5YLdJJZi7ffrLEL7P+uwPfPPzvECWmjwzaEMIQg0z6LX3l8io6EpjAVU8t5ttjk+3V 5N80NkycJUT9bkarAI7HUDQwwnmZZbOBWbF2fnujmC9FrCio+m9LfoHWWn4CYnbc61lY o0uRLziPQYMtNOSsKtjkHvr2cM68j1UNhIdQ6V9Grw13ySCXE6bYPkbYhN8hoFddGeWe sCdA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=MFVo1MlX; 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 ji10si1621ejc.746.2021.09.01.16.49.15; Wed, 01 Sep 2021 16:49:40 -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=MFVo1MlX; 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 S1344530AbhIATXt (ORCPT + 99 others); Wed, 1 Sep 2021 15:23:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42040 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230380AbhIATXt (ORCPT ); Wed, 1 Sep 2021 15:23:49 -0400 Received: from mail-qt1-x836.google.com (mail-qt1-x836.google.com [IPv6:2607:f8b0:4864:20::836]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 406EFC061575; Wed, 1 Sep 2021 12:22:52 -0700 (PDT) Received: by mail-qt1-x836.google.com with SMTP id u21so679896qtw.8; Wed, 01 Sep 2021 12:22:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id; bh=PL6tMWt+pDh+s6ofmXVwfU83Mqm7g1Pf+LEmUoSo0nE=; b=MFVo1MlXgegFbdtBSOiETpNBYM4IQQ/Ff6X+rjs+Eq58fO4mf/Wiv7Uc/yKVIBUC1K lJW/NI5xXpeGODwGLYcAdon+jVqkQ1r42UdxA1KbptUsVNA43gXmXxs+YvFUxdBwvbar cABlqJnFaD4QOS5iAD8SnCGsFv/cNJ53rKRT2lPBie9Rd5inQpVaKl2H58XqBPDJ4m1T 5r0ab2Etts14Nh7oH0G4m3Ut312Jq8jweEha4XlVMyxYqiF0K9iOBs8QqmTOpDEnMCab TeZYgyMJYdBFsqIYgVM8WeMjTzphLSP77L5kvfsvTL9o88EWNN7qA+PGRE1sdD5cONcb +ZlA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id; bh=PL6tMWt+pDh+s6ofmXVwfU83Mqm7g1Pf+LEmUoSo0nE=; b=d2aO3NrO4Dx5DYY0xU9XqXCcv+fEtp11GB9DUJGbTyvyJ4LQuUZPUnsbhUXgINbFn4 jzPootoLi8UH2B47rEgnJEkA+NRTN2+V44oeZCFAg/0sfwKPi/m3NewQhrGQdrIVtN9S k8l8Zz2j+Cjp7pJVR7nwhelfUamOhAzvf+G9OAkt+R4s+fK9um9SGnJAOWwoOTNexuQq 78Uv/hojNbh7C6q06HA7YRwNidyBQvlzposQ6bdX1SikO2h/H7647Yr3OxBBe9eQW9qq Z80VDvceiYSosEwmh9gZoWRn4GcZWapn1hPiP1nSJjOWM07pVIJx0juEYedFN2Yz5ZG3 5d3w== X-Gm-Message-State: AOAM532cvdHN2UmluiqCbNzGuK4uVJAqRCZ6PuhLmXgZ2HrxLXwesMCG 85gKKStJlAUUdyoUbDMOiFOlO8oS9ZU/7g== X-Received: by 2002:ac8:7483:: with SMTP id v3mr974432qtq.113.1630524171397; Wed, 01 Sep 2021 12:22:51 -0700 (PDT) Received: from localhost.localdomain ([2804:14c:3b96:107a:e5b5:6e20:b715:596c]) by smtp.gmail.com with ESMTPSA id w18sm436883qto.91.2021.09.01.12.22.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Sep 2021 12:22:51 -0700 (PDT) From: Rogerio Pimentel To: dmitry.torokhov@gmail.com, rpimentel.silva@gmail.com, hansemro@outlook.com, marex@denx.de, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] Input: ili210x - Set the device name according to the device model Date: Wed, 1 Sep 2021 16:22:29 -0300 Message-Id: <20210901192229.29864-1-rpimentel.silva@gmail.com> X-Mailer: git-send-email 2.17.1 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Adding the device model into the device name is useful when applications need to set different parameters according to the touchscreen being used, e.g. X11 calibration points. Signed-off-by: Rogerio Pimentel --- drivers/input/touchscreen/ili210x.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) 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", + id->name); + input->name = model_name; input->id.bustype = BUS_I2C; /* Multi touch */ @@ -487,10 +494,10 @@ static int ili210x_i2c_probe(struct i2c_client *client, } static const struct i2c_device_id ili210x_i2c_id[] = { - { "ili210x", (long)&ili210x_chip }, - { "ili2117", (long)&ili211x_chip }, - { "ili2120", (long)&ili212x_chip }, - { "ili251x", (long)&ili251x_chip }, + { .name = "ili210x", (long)&ili210x_chip }, + { .name = "ili2117", (long)&ili211x_chip }, + { .name = "ili2120", (long)&ili212x_chip }, + { .name = "ili251x", (long)&ili251x_chip }, { } }; MODULE_DEVICE_TABLE(i2c, ili210x_i2c_id); -- 2.17.1