Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp3816887iog; Tue, 21 Jun 2022 06:36:27 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vQ0xwjhPwLcrgKnli+fUDi5CO0qwWtlRYUfwnXx/Ind2Zu2TmlmSiRauAssoT3ojSI1NOm X-Received: by 2002:a17:906:b048:b0:6fe:be4a:3ecf with SMTP id bj8-20020a170906b04800b006febe4a3ecfmr26148940ejb.104.1655818587505; Tue, 21 Jun 2022 06:36:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655818587; cv=none; d=google.com; s=arc-20160816; b=MfK05rw7rN7pQrjYoLSP9ld4NDyuugRX+i5AkoFm7GsWEqJ2epDPpreZcml6EZ1f7s aioIW5GqpEJHMDbPlUq2PYNwXndQccHcuIdQefnJTzQMD6Qc5qqdWbF8xPYgfsRhmYdD 3tWGepd/41tId4t2vu1r0a80RL5Kr/Ff7E0HdhWj3kLzcOfX7u/cdlJqOQbr9HKqEX/m e8BCxc1G/Rm9RhaphGtFDvNTc8LX2clpr6blu8IvrMjrTaCAYf0Lx9koVj/ksAY6hWFI jewwvjwbWhj2jLsx0OzPqsEn+44hNN5HxqX5v1sa0K9VDJoD8iDacGrlYv1PVcOuOHbq COOA== 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=qXbI4z4us1yF7p3AAEgz+9wMJLjqgnjFclujWvzHflZ7clD6YtflsVgHfruUrzexQ6 h/Ss1pPx1IawgdTjdWniZ9ri5E7dvLWUqJCsKiOiOxSGJCKSVNlRq7/wIxyoG/BPbBeK t9irZmLufgktL4HCvtNImNIRPCJnFvwE9K9QOgtBWXOgsmkA3AJ2CkYwMrhxhRqRj+SG 3jNdajylMFkGCNd58Pik5aJHxpMJUhWlud8GghfoM3aeApBS/L8huxtqa/q7fWGXt5Dv 2sW3lrzRVt2dmgWP+HC9K0GU719CaFlgAliOiQSAuuwDlY584tjwJlzvtd5/sGjbFnAj wFrA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=T09TgHVd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gs42-20020a1709072d2a00b00711cf82cc03si13430169ejc.830.2022.06.21.06.36.01; Tue, 21 Jun 2022 06:36:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=T09TgHVd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350568AbiFUMkD (ORCPT + 99 others); Tue, 21 Jun 2022 08:40:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40868 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350496AbiFUMjs (ORCPT ); Tue, 21 Jun 2022 08:39:48 -0400 Received: from mail-ed1-x531.google.com (mail-ed1-x531.google.com [IPv6:2a00:1450:4864:20::531]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1E66D1D33E for ; Tue, 21 Jun 2022 05:39:47 -0700 (PDT) Received: by mail-ed1-x531.google.com with SMTP id z19so2339074edb.11 for ; Tue, 21 Jun 2022 05:39:46 -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=T09TgHVdVJZmzUPSPlFfOkxGtvFLfz7rmFTqJydBgLkLmCznsPvZI8z/meS3GIC2JR 6C7bXfvH3fPLxkB6WtUZr0Sqb2BIooFp/gex5z2dU0IXfSA9QB5T2r+yGSwfY+x0PRy+ tqUHvyTWk50XH2CvqoIB023ycbrr0BUwIxvxg= 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=qQ/w7rgUOXwZe8JvS7k01/ZyVjT4tYl/PdGdmznFvwpC2KH5aWWT/23YuEvjswRZCs XUU4mltKSTDkTmkUKopvRPj+YIwt9c6PdB40cwhyW5EsBYAeNomeB49x9NduW0Yw2Ta9 mdoNvlbgl32LS170mpvAwrOioD6lg2R31rlUfxZ4rh1KPGL17qede09yyh0AxWosqGaI nGAxiTgoGpD8Ho29M9nkWoaqjTX6kCmCr4G7bDXcshHvZ9jfmKJIOX2wrOv5NX9r98yR vR4+RrXMuYWWzfPe7yz+bFVNyA8JXLxob4/S6hAGCgyq4XOVHjf3qVgxMWycj4Ogw9zu LDRw== X-Gm-Message-State: AJIora81f72ynRzc62TWUPwdtFDwZIMvanoTohL2Lq4S95ItGXmPvaLC qPrW+/EfVKSzOINupNyUCSTvp0mX0T9jmA== X-Received: by 2002:aa7:db8d:0:b0:42e:1cbc:5e28 with SMTP id u13-20020aa7db8d000000b0042e1cbc5e28mr34978873edt.366.1655815185253; Tue, 21 Jun 2022 05:39:45 -0700 (PDT) Received: from dario-ThinkPad-T14s-Gen-2i.homenet.telecomitalia.it (host-80-116-90-174.pool80116.interbusiness.it. [80.116.90.174]) by smtp.gmail.com with ESMTPSA id c19-20020aa7c753000000b004357063bf60sm8003945eds.41.2022.06.21.05.39.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Jun 2022 05:39:44 -0700 (PDT) From: Dario Binacchi To: linux-kernel@vger.kernel.org Cc: Dario Binacchi , Michael Trimarchi , Oliver Graute , Dmitry Torokhov , Marco Felsch , linux-input@vger.kernel.org Subject: [RESEND PATCH v4 4/6] Input: edt-ft5x06 - show model name by sysfs Date: Tue, 21 Jun 2022 14:39:35 +0200 Message-Id: <20220621123937.1330389-5-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220621123937.1330389-1-dario.binacchi@amarulasolutions.com> References: <20220621123937.1330389-1-dario.binacchi@amarulasolutions.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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