Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp2919346pxb; Mon, 4 Apr 2022 02:54:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxkaeGJXpbV9zXgU6w/hUqh75Ff/7cQWwVFgErY0aSj4wBw/MhjvxGiOQ7/AXVFMKezpc/M X-Received: by 2002:a17:907:8a23:b0:6e7:e874:629e with SMTP id sc35-20020a1709078a2300b006e7e874629emr4771037ejc.274.1649066072611; Mon, 04 Apr 2022 02:54:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649066072; cv=none; d=google.com; s=arc-20160816; b=cC7YTrXzd5HBCmLryn2TAwKtyZ5o2r3IxA05kLO/EOJnLmWZ52XCXhppTustj57sTP YwzgTuyJsgerSmQlK8toDkWnmFlyflBMCslxivt0urI2hhCGo0ue38qX3Tc3LBpWbNfh xF0uMcKRlAlTJoL7YvdPN8toNjYJ6Vv3Y4KUr6omgqg3d7FP3B7MvpVlDmB23h58m0Ny rW6fx4M8dQZNepPGKG2TtElXrIanqnyotjc2HJcWzbDRJUvNIdYqsA7VgOKYAPT9EPpc XZRDZ68PCQGDbPYqk3Rxva9JiCZizvIH11Ov8p/TbL9/ose4Q+YtKmYNfaGfquTWqY9E jg3w== 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=NA2/fAuYD6yeMfHBkD7vmbwGSezmms+aqMiFDZsCW31kK4iTDiUzetHVI8JKbZDEmD B72RJDlXpDXRvCGR7BfqYXy37hPJMkgctxaRZwPSxbvSXBGq+WZiSvSaaq+poxKhUnVp ynUDks865sLLLREtr2DgyUt9gqOL+jB7VjvZyyvWndRJO8EtlHmZ7ZcIGmYeHcgOf/Hw qlW5HH+0RncRt/hvaesc3n9ODSH5RZFVFihrQ4UBe2J7cYKbM2c+m7xf2TikIGe8adg0 U+4sF2GECqU92acdGx6aQ6oauFhA3zSrY5b49APn/R5+EebSXazglpCGFVTnbR5xeboq t+Hw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=jat0lQdm; 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 m1-20020a170906720100b006e0db7cb13esi4554065ejk.468.2022.04.04.02.54.07; Mon, 04 Apr 2022 02:54:32 -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=jat0lQdm; 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 S1359387AbiDCQMW (ORCPT + 99 others); Sun, 3 Apr 2022 12:12:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47380 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1359361AbiDCQMM (ORCPT ); Sun, 3 Apr 2022 12:12:12 -0400 Received: from mail-ed1-x533.google.com (mail-ed1-x533.google.com [IPv6:2a00:1450:4864:20::533]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6B76C2656C for ; Sun, 3 Apr 2022 09:10:16 -0700 (PDT) Received: by mail-ed1-x533.google.com with SMTP id w18so2099149edi.13 for ; Sun, 03 Apr 2022 09:10:16 -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=jat0lQdm52wwDg35BRb5L+8nm59997TipvzzKI5U6EjUYX77r5sTCbvkZayFkxAOCZ WAInrj3s+FmISyd1yLFWu2dSjimET8Xaqv+IT4iNXmeOeSYChSMn6CVikS/Knq9edU0q jZFJ6oNBK/hPaoQ7SW2JwUA2CNs0rG3wUyhAo= 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=SQaOERxu1wNplGInrt/MPR1lDnE/h89xPTlXS0IH8aNLtghK2C4d/ZnRwbD6k0lzqZ 2xDzE8CKr9l+T6MzNMjhhnRlEPGjnV8A/UTfxVYMxMorfG4mT4K3ufAbw0ziS7yyWlu+ tyEPjaGBPTblByjdh7oh4yMGseNguW/7lhCMKfwl5YFtNYJV8y33B23gbV83IxoGHXrO ykcnbOJWsyR/R3ssdNDS+CmryWwSPkFL8KS88ngBx7Cq41viQZl1o3ecD7N1h7WF1EV3 8J9NbHo3CrcSXkHyBJJ2+14BA+3glVDwa1mB+J4nLXbsSEWv7N3HHowKlJg8ayNnFR3y cRxA== X-Gm-Message-State: AOAM533mJPzXO9ASDADD4DBpgVKJ9UYKF0bshn5JN2lEL3sDUmr/0i9C KrxFOZJTdtVRW6whh/oQkHSdG8/NuhZYmg== X-Received: by 2002:a05:6402:348b:b0:419:172c:e2aa with SMTP id v11-20020a056402348b00b00419172ce2aamr29411793edc.261.1649002214776; Sun, 03 Apr 2022 09:10:14 -0700 (PDT) Received: from dario-ThinkPad-T14s-Gen-2i.homenet.telecomitalia.it (host-87-0-15-73.retail.telecomitalia.it. [87.0.15.73]) by smtp.gmail.com with ESMTPSA id do8-20020a170906c10800b006dfe2af50d8sm3350119ejc.121.2022.04.03.09.10.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 03 Apr 2022 09:10:14 -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: [PATCH v4 4/6] Input: edt-ft5x06 - show model name by sysfs Date: Sun, 3 Apr 2022 18:09:37 +0200 Message-Id: <20220403160939.541621-5-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220403160939.541621-1-dario.binacchi@amarulasolutions.com> References: <20220403160939.541621-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=unavailable 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