Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp937241pxb; Fri, 22 Apr 2022 14:49:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyOIT/cryoT3f1hpQYpeLCVYMBJbDbK7yLSrtkWTymt+G2Ip1X5YmOW/LMNByKURsEIymLp X-Received: by 2002:a17:902:edd1:b0:158:8318:b51e with SMTP id q17-20020a170902edd100b001588318b51emr6491166plk.89.1650664144010; Fri, 22 Apr 2022 14:49:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650664144; cv=none; d=google.com; s=arc-20160816; b=wX+KinGytdl7e8cVxTy7bNWJQ35WHs1H9Bu22hGn0Y0B9MZjFLNLje68cSSjoxsEpc gyNm01kDAe8sXjFRXxlcJQZxcFLGCbkRRM6PjuATQ6rWeswLYApQ8er2DKdU7nxkT+NO EMgzzhlo6Trh+Y9//ogK4qd1ihl0+KhhnN1j4+EUvt+oO+V6rKe6MIe0mBwMPvMLT/E7 UBqWlR4xJNQL76Xkpd0+Dnme/HAx517u4GANk36McK66Y2DAEphfXJ0hZAn5QYPXXfla DOXBaXAPAk07Rw8UC5s/6n3tJxcYU5wYtVIHeYOOLVJYCfIZWSJuRjUSiy5o91CuJQHu DPGQ== 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=JxjvANyepuUvCukUlqVab/u+TaTml3d1t2D6FcOIcyl4IIwZKqm3gMICh8s/jBqEFj NpTMftC2wc6FqyEk914Gozl+iFQNrpSTN5Fm1lvNLndZ9cWu7szX87RhFaVWgMo3z+gX rNY+6jZGBc0G/DuxL4qd3cAHrQqvl4PP7V3DG9w/pe18ooxMx8cZa/Jy4CY7iyTrgOxc l6FOBqR3+YBZ5cakXDdcvzqsfKYkHMcpus5TxwOtJua5t+PThLjIf7Ui/Xgjky+WLzGR GwL+JmpmH05JBeHrdfxL/x5WZW55F8W8oHXA1J5VbDI/wNOwPbLgkSsSHjZ1T35NVp9n Dfsg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=ka0bSzqe; 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 l8-20020a635708000000b003817672f2d4si9743225pgb.316.2022.04.22.14.49.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Apr 2022 14:49:03 -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=ka0bSzqe; 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 A5F04206C00; Fri, 22 Apr 2022 12:56:30 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1391707AbiDUTEg (ORCPT + 99 others); Thu, 21 Apr 2022 15:04:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47288 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1386191AbiDUTEf (ORCPT ); Thu, 21 Apr 2022 15:04:35 -0400 Received: from mail-ej1-x634.google.com (mail-ej1-x634.google.com [IPv6:2a00:1450:4864:20::634]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2928C49924 for ; Thu, 21 Apr 2022 12:01:45 -0700 (PDT) Received: by mail-ej1-x634.google.com with SMTP id y10so11871466ejw.8 for ; Thu, 21 Apr 2022 12:01:45 -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=ka0bSzqelK6lJUthcRpFwJgtlNk/odO7kgggb5rUBc+F9MxHrAiagKn17SvGC6jvkl BTE5CZ+DkTc2VSfuLv8wBIWTDffVF0jwMdBKR7zX4NT7PHstkijKl8PQtxkOShOghHUz bzl8LWmOaNwYy0ryHBX5rA1mezy5nnM/gyp+o= 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=ngX1GX89L4MKUD2nnuTe/Sb5OYrzI7Exfmw+xLW8P11fbNtn3hfS2S+M8Gax7ab/JV 3y7Q1/QKoMVgWDoSVpY1haM0HDTZdI1lnryBsiBmGo3YuweFvUNiul5NsE2QRKPThy2R RA63/Hlr8FSxLez9PF4UpVeQyRzzBqMjZNip3XttZ2ooZ8E1t8wwg/+lwSwzNf3nYj90 gWVjlwHpKjGgO+G0qh+QM7rvYlpAabSzIS8y+9HlfiqZFo9zEFec+idKvdTC3pjnvTua FJiPXuvgmAbBZBffeRO9KMB1vN/MyOWwL0zj3/jksxz1ltKC+mvjWw1ob5brP5cxXTqt GvYQ== X-Gm-Message-State: AOAM532/DpsFcZzZYu2uzOHhUuI9MYRH6K4Wpz78u5UmKWdfLpfrhwkp nW6uekjX+J+gueZg6uW/kvm7SnExieB7BQ== X-Received: by 2002:a17:906:2bcb:b0:6e7:f655:3b96 with SMTP id n11-20020a1709062bcb00b006e7f6553b96mr801376ejg.175.1650567703496; Thu, 21 Apr 2022 12:01:43 -0700 (PDT) Received: from dario-ThinkPad-T14s-Gen-2i.amarulasolutions.com (host-87-0-15-73.retail.telecomitalia.it. [87.0.15.73]) by smtp.gmail.com with ESMTPSA id s11-20020a170906284b00b006e108693850sm7975142ejc.28.2022.04.21.12.00.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Apr 2022 12:01:04 -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, 21 Apr 2022 21:00:01 +0200 Message-Id: <20220421190003.3228699-5-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220421190003.3228699-1-dario.binacchi@amarulasolutions.com> References: <20220421190003.3228699-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 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