Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp6008569pxb; Mon, 14 Feb 2022 13:02:08 -0800 (PST) X-Google-Smtp-Source: ABdhPJwEJoZFTB8L7CFRgoI8yi/JoNqDEeXufQ0vt+tRV2OEppYmYVQtq3inCMf02dA83xBIFpI3 X-Received: by 2002:a05:6a00:894:: with SMTP id q20mr514097pfj.79.1644872528399; Mon, 14 Feb 2022 13:02:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644872528; cv=none; d=google.com; s=arc-20160816; b=DLaLd6wEf5MVEpnYwymuWGs49qTJYbEhlBf94RQUoU33k2TYzjWtC5GAcqqKT42hCN vod2bP75fEszP5uOFOXrmQU6CWlNiW/7KGz3pXAOF1HAab1E045AizJ+sI1gbBqnfxTe SqHrkeKoey4Bz+mj/EFym13tJx92d/5+QkE6jp+5vmlyP4Ef6cAjij+10F/U3x2v6wXD UrhHa2Hnlif1eXqGKrLIHB7N5AcPHZM5Z1STKOEuazWtBUBLW1n1ii0/xLTu1IPxzkQ9 Hi9yeGh+HEWnW2d7w56Vd6BJSzpcXYTCkSyr/Th7uY71+QOAAF5djw/zQJNkBNT2Ssog 8hdA== 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=S/AsjkW3t1KrHMKTVETxff67/Nhsqoh6KaKB0r1nIHg=; b=z+k0o4XtTbjfPxuUlGGqX8QZE6A2+pencWStcy728SRBfHRxcvAuJ68Ms3/42zwE4N fbnMeP8Cd8ZNK+sx4UZMY/8qmcdsaA5LMKj1mArdqR4+0140gRXPUj4/tAu+f8XpsQni MrccGHn110Fity67vbTExV1CY8C1jC89yeZzhfJWw071CCSDN05F0hBJGp6lrBRO6uX5 fpjFvv7cvZF/Y1E3PXxCzu2IsE50KRpnB6qiUmTfEKYgpvehdSPCAB5xpwI84TC6zyaC A3X/2XXqiqS6HvKglckutZfT02VXb+Q9uJXxvA9igCR4ezA8o9tGhTF/20fgwfDBBY46 8vXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=OhSfpnRD; 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 Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id c8si839151pgq.293.2022.02.14.13.02.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Feb 2022 13:02:08 -0800 (PST) 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=OhSfpnRD; 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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id AD076134DF9; Mon, 14 Feb 2022 12:24:10 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237326AbiBMRQQ (ORCPT + 99 others); Sun, 13 Feb 2022 12:16:16 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:38398 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237332AbiBMRQP (ORCPT ); Sun, 13 Feb 2022 12:16:15 -0500 Received: from mail-ed1-x536.google.com (mail-ed1-x536.google.com [IPv6:2a00:1450:4864:20::536]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 418D3593BE for ; Sun, 13 Feb 2022 09:16:09 -0800 (PST) Received: by mail-ed1-x536.google.com with SMTP id y17so21900906edd.10 for ; Sun, 13 Feb 2022 09:16:09 -0800 (PST) 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=S/AsjkW3t1KrHMKTVETxff67/Nhsqoh6KaKB0r1nIHg=; b=OhSfpnRD1YPDchKrwVRFJJYXMk6u5meI3NMZMrYecw0xMUGolwUHGc4TvGAdcbOxKk ElDkIIplEyEzpiVNPQaVGtjMFbS8/eGfUDk04HDOMtV+4vMuXoQbryADR3Qh1cnUiCf9 h4uoxj3FF1vTgabKpTjPExR5YPRqDhykRrgRA= 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=S/AsjkW3t1KrHMKTVETxff67/Nhsqoh6KaKB0r1nIHg=; b=Wyg1K1Sor6RyoSsSTUeRmlgL2gHJ7lOboMc4dq6ULqR3QiJl3ZyvbzghOwWd92ZSGT DKou6PJaJXVOKhUU2fVlFqSuejZle/iKK1kMzNPRZ9AMgT87cOtTkAGPnJSHSZlWmNmU scFnUAZ8th9OP+Ix2gS8Yn8dZoDa+hNMu9hREEpFoNHWUckUBJRBLsTy7qnliUNULgnz dwRAG5HoCLKRL3N96yfIrQ2u6NyjWz8PSK0le6ZyvqznPnxUFnI//28hfoziOUy3j8cE 5+F6mOsOyDkmhMbLpxSKx5h9nSG41Aba5PT88U2H+BcYPOAtqILbK86HVtuNnPzkj3r9 7yug== X-Gm-Message-State: AOAM530LEkUEE151vcKJ5T9OGoiHzQZQ1wXkRLFyuRI3rMLseSfSpwnM t8JwxKI/BqIBpD4b7RogcVyKrEBUY0gk1w== X-Received: by 2002:a05:6402:2947:: with SMTP id ed7mr11924581edb.141.1644772567637; Sun, 13 Feb 2022 09:16:07 -0800 (PST) Received: from dario-ThinkPad-T14s-Gen-2i.homenet.telecomitalia.it (host-82-52-8-210.retail.telecomitalia.it. [82.52.8.210]) by smtp.gmail.com with ESMTPSA id o10sm6598878ejj.6.2022.02.13.09.16.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Feb 2022 09:16:07 -0800 (PST) From: Dario Binacchi To: linux-kernel@vger.kernel.org Cc: Dario Binacchi , Michael Trimarchi , Dmitry Torokhov , Marco Felsch , Oliver Graute , Stephan Gerhold , linux-input@vger.kernel.org Subject: [PATCH 4/6] Input: edt-ft5x06 - show model name by sysfs Date: Sun, 13 Feb 2022 18:15:30 +0100 Message-Id: <20220213171532.346270-5-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220213171532.346270-1-dario.binacchi@amarulasolutions.com> References: <20220213171532.346270-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 --- 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 b3e492cfc41c..eb1231d1c0b4 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