Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp4805067iob; Mon, 9 May 2022 01:57:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxCwqfAYdrQiLr+FStAd19sTAgttiKsYoP2aNmWXzOe1SnWdaJRNw7xoNYZN5WIRqJZjwv6 X-Received: by 2002:a17:90b:38c7:b0:1dc:77aa:e3d5 with SMTP id nn7-20020a17090b38c700b001dc77aae3d5mr24972514pjb.51.1652086655692; Mon, 09 May 2022 01:57:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652086655; cv=none; d=google.com; s=arc-20160816; b=Ynb2lgTSa+gd2tBo5TQQHhw4plR11q6DYjHXt/XAditkf+XExjg4JA/7Tbv3bTDGn+ IcblSEaCP95XccIWBV63m0eNVAuF3uYLrC+Ls1MtjiZ8tFNPw60N2PjYHXBSAwrCLTm0 Y3vO9zs17uNvwpE6QXx8WGpceyp4lx6yRJ/b4TurVxM6YL+cQg6x48HAbkUZLBjmXqky A1MrAi/EOl9j1NdejCgS4nXNpflS0Z3og3xc/S2LCTCwPMw7kMcSO3lhFuIyKSr6wz9y 0MWumkaaZiSraAdnKTi+ZDf+8FIeChZtCNt4jWiYY/e5GzYvZ0Wt4a8twI8CEsM15nol jZIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=b85JvDSGn8w4tr7JpVbjtxkbsu1O4D+F+hX3OsbfqCs=; b=iywnrThnqvIc+501GORM2oekrB7ASA0lG4xv3UeczUeS+8CMxokn/jPacf5wt8b3vN jC+UDlxx5o/ew3oqgBy13961xYP+8BEiKL2DNt6MMEgPjJ+tLa8sxCIQBUoRzsrx7F2C RYWa+xZva5lwXljm0rC2WLBzcaPb+Iv5CxNG8cooeJ2s7xhu8D9+2CF/qX1Hw9AJ8fkZ Wc5FgU/zZmuGAZevKcKZiQN/wXbx2El4bRe+eLbQL3KoghtBZwwyWgQyiArpJZD9Us1J 2KFklA1VJ+d428rg9i/Dc8ucOvBNkTnxMbYzohsYMy8aXd9mbJa6yMZoBMecpOE8N1lt MBMA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=anjXQPAz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id g4-20020a656cc4000000b003c69e8eb047si6070228pgw.140.2022.05.09.01.57.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 May 2022 01:57:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=anjXQPAz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 4E39B1DB586; Mon, 9 May 2022 01:44:29 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1381544AbiEEQA5 (ORCPT + 99 others); Thu, 5 May 2022 12:00:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48300 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1381478AbiEEQA1 (ORCPT ); Thu, 5 May 2022 12:00:27 -0400 Received: from mail-ej1-x631.google.com (mail-ej1-x631.google.com [IPv6:2a00:1450:4864:20::631]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3CB4256FB5 for ; Thu, 5 May 2022 08:56:47 -0700 (PDT) Received: by mail-ej1-x631.google.com with SMTP id gh6so9626230ejb.0 for ; Thu, 05 May 2022 08:56:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=b85JvDSGn8w4tr7JpVbjtxkbsu1O4D+F+hX3OsbfqCs=; b=anjXQPAzHgfLeiJhnxLOhpmVM0ix3W0HpeI5dndfdG63W5yw4GjLwSLrD0KT6+ZwIG +A1Fc/eghyrW1Z8sN56/fkklP6EHByA9XgSVZyLeVBD0IF4FdpqTn5GgdsOpbBIewJWv lfsXvmN+cRJJhVbrdyYSVrgM2M4QFaq9oDVss= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=b85JvDSGn8w4tr7JpVbjtxkbsu1O4D+F+hX3OsbfqCs=; b=JJiRmjwovDRd9nSRz76/yKCBn8TaA2WsUSOMG4hT9NUZ9jzXaHWwiYD4zlAR4eMWHU cOOGWRyJXxjL2ytVV0Y49NN+fqGLYnFbrv/BouP+YsXzCWBG+mjNg4aL6j0WTPIW9q+K J6aGYfgDvEUqS1iMuKIY5hWYzA+O/1FcG17+0/pxfdl0IhdnM/eOBkHc6Xk4bHLdMI4Y 6VWdntDkT+Zk0mzCfh1q7FTdUiTVQt+WPXCAEf5/xXH0cq1OVY9+hzTGVPt4vtFl7skq ohyU0rSZdaJhq9IbGbGbRYNztiaS4RiFhnGJ8b4TnSMxqYhp5cc4mxSzprqTBJsft86+ vRvw== X-Gm-Message-State: AOAM533PTUYoa5xYPzQxcXe4fkSHNzX8D1HBvz1mVzyQMcVYHgCjInkO eaXjv9h+hFH/M3hxfXikSymIFFGENEzyrQ== X-Received: by 2002:a17:907:d9e:b0:6f4:2983:c371 with SMTP id go30-20020a1709070d9e00b006f42983c371mr24154521ejc.558.1651766205542; Thu, 05 May 2022 08:56:45 -0700 (PDT) Received: from dario-ThinkPad-T14s-Gen-2i.pdxnet.pdxeng.ch (host-87-0-15-73.retail.telecomitalia.it. [87.0.15.73]) by smtp.gmail.com with ESMTPSA id a4-20020aa7d904000000b0042617ba6385sm1009328edr.15.2022.05.05.08.56.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 May 2022 08:56:45 -0700 (PDT) From: Dario Binacchi To: linux-kernel@vger.kernel.org Cc: Dario Binacchi , Michael Trimarchi , Oliver Graute , Dmitry Torokhov , Stephan Gerhold , linux-input@vger.kernel.org Subject: [RESEND PATCH v4 4/6] Input: edt-ft5x06 - show model name by sysfs Date: Thu, 5 May 2022 17:56:33 +0200 Message-Id: <20220505155635.419653-5-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220505155635.419653-1-dario.binacchi@amarulasolutions.com> References: <20220505155635.419653-1-dario.binacchi@amarulasolutions.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The model name was printed only if debug mode was enabled. Now you can always get it from sysfs. Co-developed-by: Michael Trimarchi Signed-off-by: Michael Trimarchi Signed-off-by: Dario Binacchi Acked-by: Oliver Graute --- (no changes since v1) drivers/input/touchscreen/edt-ft5x06.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/input/touchscreen/edt-ft5x06.c b/drivers/input/touchscreen/edt-ft5x06.c index 843e8b0522f7..89157deebfcb 100644 --- a/drivers/input/touchscreen/edt-ft5x06.c +++ b/drivers/input/touchscreen/edt-ft5x06.c @@ -529,6 +529,17 @@ static EDT_ATTR(threshold, S_IWUSR | S_IRUGO, WORK_REGISTER_THRESHOLD, static EDT_ATTR(report_rate, S_IWUSR | S_IRUGO, WORK_REGISTER_REPORT_RATE, M12_REGISTER_REPORT_RATE, NO_REGISTER, 0, 255); +static ssize_t model_show(struct device *dev, struct device_attribute *attr, + char *buf) +{ + struct i2c_client *client = to_i2c_client(dev); + struct edt_ft5x06_ts_data *tsdata = i2c_get_clientdata(client); + + return scnprintf(buf, PAGE_SIZE, "%s\n", tsdata->name); +} + +static DEVICE_ATTR_RO(model); + static struct attribute *edt_ft5x06_attrs[] = { &edt_ft5x06_attr_gain.dattr.attr, &edt_ft5x06_attr_offset.dattr.attr, @@ -536,6 +547,7 @@ static struct attribute *edt_ft5x06_attrs[] = { &edt_ft5x06_attr_offset_y.dattr.attr, &edt_ft5x06_attr_threshold.dattr.attr, &edt_ft5x06_attr_report_rate.dattr.attr, + &dev_attr_model.attr, NULL }; -- 2.32.0