Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp1334485iof; Tue, 7 Jun 2022 03:36:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxXYgcZ1TrCZdzcTNpWyPsDIYmK/hAJrYWIzbRTMK9VU5rwpLDn5Zki2oYfPKuLOa4H+dLg X-Received: by 2002:a17:907:7b8a:b0:707:59d4:14a3 with SMTP id ne10-20020a1709077b8a00b0070759d414a3mr25713245ejc.51.1654598216389; Tue, 07 Jun 2022 03:36:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654598216; cv=none; d=google.com; s=arc-20160816; b=auILHZupdp0QbU4+V6+iajbckCG+6aZjyrev0JD9PeAKjdN+aewyffq+nyo+gP6j0o ODv0tUzjeD2UYrdi2GE9H1mV2+pnF0Y0zIOGC6eoZbYrxG7YcPqqmDwKy1MkWnUgVgPq q/Z3+qvNaytsvRXiLHHkimInn8Je6Xzlca1CzicUpv55H1a3VDSS49VP2ZqpszyCh597 1TAc7byGMQf0rMY65hIJ8LIJUUEhh2Zl3t7pSZQZVOh0/96kpk5+15JELc6lv9rBiLam kdC6+17i/RzgLSaiMNxhFuCswlMEHkaiBLgtVpCMfnTHx9qbQ9TepRWa6Z6QZ5QdZ3LR OuEQ== 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=POF2Vm7YyvwNQ0M3h2VKoYKjNf1CUJrgUYZObbEQQRjiSMkSqvSycB1R47z+SjAuZJ SBF8C1Dm1k9Jo9w5KPv3SkM7+MckGdvqpdqOLBMdqgpq5fOONjsN/nJJVe/HqL4TBwRz PXG9EW3zJCGKhrMRJixqv4LhTDpaU/ITOtbdrYAmA0dc/kEEXPEPOBCM0QvmGa6ixkXt Cs/AFPpHkci7vMKtKOzUDdgbOw3q/aMGuYOK+jNf1tsTDyVI+sd2unoNo8ZR9QqXFiZQ FD68FmCXAUr5wfcSY6O9fR3LefM1yyT89yezvZT0u0tMFdoPUSQg6zJuaMieo93K47Ig Zz9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=kIbaL330; 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 t10-20020a17090616ca00b006fed02b6307si16850683ejd.44.2022.06.07.03.36.30; Tue, 07 Jun 2022 03:36:56 -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=kIbaL330; 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 S240363AbiFGJ4e (ORCPT + 99 others); Tue, 7 Jun 2022 05:56:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40050 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240336AbiFGJ4P (ORCPT ); Tue, 7 Jun 2022 05:56:15 -0400 Received: from mail-wr1-x42b.google.com (mail-wr1-x42b.google.com [IPv6:2a00:1450:4864:20::42b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5386CE77C5 for ; Tue, 7 Jun 2022 02:56:13 -0700 (PDT) Received: by mail-wr1-x42b.google.com with SMTP id x17so23383943wrg.6 for ; Tue, 07 Jun 2022 02:56:13 -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=kIbaL3300jIhHXnjE4TUkzvN0aDpxTdjXOfBc8eQ9P8NML1oCAcaCraQFv2cmkhCwe xolxDgKM2SYwGu//bLBxIQEY+R1qd+cBPF+xdHHhdXwgS8MgCtadhKJHMFVbErA3ntqo DxwLOuLslmfoQo4HsR6k2fHnh0AvXDDy59Ua0= 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=1qDBieoWZ7XMXVlxwrsBhMF9T34efcrMiMS1R93/gE96edaCjv9Un/8t6oac/vF4ko xLoVV2tgHY9rLXfJonDvWbPxsojsW8M36+KPoyXgMNhEoBOKu96xMB88x5IgXgTNAyk9 uYfYSoRkgkgE9ofJVXDhS7ioZPjcOBV8FB1Emw+UAdjIY9rz/9U4y1uH8zr0A+VxGo3y MK3PIYNXJ8mfV4snFj4v/tJdPA/ltMDkKQ1mCJ8HLzQcx1x7f/megD46tJ5i9MRGuWgl CVY8Wtn+HyjgjcjxxzbcS0RQoGrVw3ti6fpPRdUd3d6NGUhlFiKL3c6+FkhZJugeNRrt lO+w== X-Gm-Message-State: AOAM532EwaqyAgWV8hxCzJdh8eCupSw2BqI1yJFSAIHjJNqao7RIHW1R PKRmLhQLbcV6W5PjplhTC9keceIuq/pm+w== X-Received: by 2002:a5d:6c61:0:b0:210:7277:774c with SMTP id r1-20020a5d6c61000000b002107277774cmr26694747wrz.212.1654595771585; Tue, 07 Jun 2022 02:56:11 -0700 (PDT) Received: from dario-ThinkPad-T14s-Gen-2i.pdxnet.pdxeng.ch (mob-5-90-137-51.net.vodafone.it. [5.90.137.51]) by smtp.gmail.com with ESMTPSA id b12-20020a5d4b8c000000b0020feb9c44c2sm17693546wrt.20.2022.06.07.02.56.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 02:56:11 -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, 7 Jun 2022 11:55:54 +0200 Message-Id: <20220607095556.1034338-5-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220607095556.1034338-1-dario.binacchi@amarulasolutions.com> References: <20220607095556.1034338-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