Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp4460803ybb; Tue, 7 Apr 2020 07:58:18 -0700 (PDT) X-Google-Smtp-Source: APiQypLkwbsQR4Y31nGUuFDfXyAnrf1Rjn5zsi2BVoL8ooyerqh4QwBdJI1FR/xJx36ilumotGif X-Received: by 2002:a9d:404b:: with SMTP id o11mr1945346oti.120.1586271498237; Tue, 07 Apr 2020 07:58:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586271498; cv=none; d=google.com; s=arc-20160816; b=GafZpuVRW8oi/9MnAcvguU42rk+N9c+zxJVNIoMRpbY0g4zyxhTIjRuL4zVQNCWVPX Sm+gIQSH5/P01rhl5RW752vh3hLjpmHaw43v3NPld9qOfDDeZDPX7FoUq9XcY7oWBHbw CQp+2T3gbwRIsXfCqWGQG5tJly+WGEsMg8Bnc+VTBAqbvBl4WdaDiiIMXU4+NS4JN41C XxtW4fp2ho4CPN27UItXNwDGmXf35Oc8S6bkfzP9BYlii6b65DfK6af5mi9miynmZnVK ybx5y+rtfgJVlYKMqmm/pbUPL4xMAt4ghlolg7vD43pXf4ZGDlHu1ppX8IF5tXZ36zyU FCaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=nRvaZx0CW/m/jWE2uVOD/eMgFMwO805CIg6iMnzrwfQ=; b=aLVyslfvgsb69MJoOMY8vvTEKoEvAoDibZbHzlnU4k7goXx+Y8WJ0dUEex7MDNl8xK dY840A2GBZkCEhzohTAU6gMdBx2iOghY2OpPXl0eXClBD23hYh0xqf1lLB2WY01pRxuh tCC4m+PBRGVZXjtMUyQ4JgNXnKfVN2S1BF8KePA8Yaql55mnmGYt5uu8Oemdo3hMKfw4 yZepECfJYRKPhtElZ0TLvb1AmXju0zfd6vVJn6iduav74l6VMwzIIjmhsl+WdSUdvgf0 YUF3V247NP92BqvxCvy2vC0seiAzvgK+dyH0jAH2ZOxcwaNDIOVY+DE26ZhmXnaVQi1f A1dQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Rh5ZIXJ4; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z13si1208749oix.27.2020.04.07.07.58.05; Tue, 07 Apr 2020 07:58:18 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Rh5ZIXJ4; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729276AbgDGO41 (ORCPT + 99 others); Tue, 7 Apr 2020 10:56:27 -0400 Received: from mail-lf1-f65.google.com ([209.85.167.65]:37634 "EHLO mail-lf1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728855AbgDGO41 (ORCPT ); Tue, 7 Apr 2020 10:56:27 -0400 Received: by mail-lf1-f65.google.com with SMTP id t11so2631148lfe.4; Tue, 07 Apr 2020 07:56:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=nRvaZx0CW/m/jWE2uVOD/eMgFMwO805CIg6iMnzrwfQ=; b=Rh5ZIXJ4BX4A7nfqy6jJldrDXLrwYgycJ/H8JLJWXCvAnXodELRZ53RFkm3+Z2xHbJ +fc7dcYqOpaccDSskefX0R8SR+7kgNP0e/WcCD0m+uSJuyoDTBupMrxxiIE6Xg91UPZJ In2jU3YBFxtRnMXmd9taBho56WrB9B+YkfrtAKmG9uvfdr98S6nPAQFtVuGuwhGbWxgZ b9ppQzm8pAZ+ziRGQ9ykxstpzeQsZo+q5NQE0TZ75vkJl4JgsURr5d34oIWtkZw7exDe SFsNWrGYN7V5KJTCOYTiQZ0+g37mbSy1fc2F3ak3X0qePEU3Pd1TqcT7tKJzFL++5J3F zJ8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=nRvaZx0CW/m/jWE2uVOD/eMgFMwO805CIg6iMnzrwfQ=; b=gEir9mjeJuRcgvH8SFiFtqNEWM9yBF1HQz4L8qSCvD7Y0ZGT58b0byPZMLfw6Y9qCm LM6zK1aGfb4Ct2uBHYCtAT6v+fFBAGxlDFirtde8sfHfuxGkvqRXCAB9bEq36oSpDWGf eB7iggNrW3PXgnQS/Z5znF9LBC4OvA66GpU2+Jh1SLUp1l/fH85yue/W9e8BqZ7YlLjj icA9W6G1ql8n+9kOmfKElBmVFgztMjcl1OTcou6vlaT7de6Mr6TI2000mLteYj8OxLZW tnmpEbh3n46AC5C+/5AflZ9OuALibKpB5HgApbk763fcDKabZxdj70Rpsp0PcLdN9pqx 6+zA== X-Gm-Message-State: AGi0PuZtNq9XD/Oaa1iaK7snIRLrHnabP5HRCYTjRllWc92aNni78rwA tNKAV9TtcmqlYWs38VgegfTt4QzR X-Received: by 2002:ac2:4d07:: with SMTP id r7mr736918lfi.14.1586271384280; Tue, 07 Apr 2020 07:56:24 -0700 (PDT) Received: from [192.168.2.145] (ppp91-78-208-152.pppoe.mtu-net.ru. [91.78.208.152]) by smtp.googlemail.com with ESMTPSA id x29sm10512013lfn.64.2020.04.07.07.56.23 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 07 Apr 2020 07:56:23 -0700 (PDT) Subject: Re: [PATCH v10 20/55] Input: atmel_mxt_ts - handle cfg filename via pdata/sysfs To: Jiada Wang , nick@shmanahar.org, dmitry.torokhov@gmail.com, jikos@kernel.org, benjamin.tissoires@redhat.com, bsz@semihalf.com Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, erosca@de.adit-jv.com, Andrew_Gabbasov@mentor.com References: <20200331105051.58896-1-jiada_wang@mentor.com> <20200331105051.58896-21-jiada_wang@mentor.com> From: Dmitry Osipenko Message-ID: Date: Tue, 7 Apr 2020 17:56:22 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 MIME-Version: 1.0 In-Reply-To: <20200331105051.58896-21-jiada_wang@mentor.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 31.03.2020 13:50, Jiada Wang пишет: > From: Nick Dyer > > There may be multiple maXTouch chips on a single device which will require > different configuration files. Add a platform data value for the > configuration filename. > > Add sysfs entry to write configuration file if the platform data is not > set. > > Split out the object initialisation code from mxt_initialize() into > mxt_configure_objects() to allow this. > > Signed-off-by: Nick Dyer > Acked-by: Yufeng Shen > (cherry picked from ndyer/linux/for-upstream commit 71a2a4d1954460b949a16b607f72bafab294ca79) > [gdavis: Resolve forward port conflicts due to applying upstream > commit 96a938aa214e ("Input: atmel_mxt_ts - remove platform > data support").] > Signed-off-by: George G. Davis > [gdavis: Squash fix from Vladimir Zapolskiy: > - Input: atmel_mxt_ts - fix error paths in mxt_configure_objects()] > Signed-off-by: Vladimir Zapolskiy > [jiada: Separate Documentation/ portion change to another commit > Rename mxt_update_cfg_store to update_cfg_store > Replace DEVICE_ATTR with DEVICE_ATTR_WO] > Signed-off-by: Jiada Wang > --- > drivers/input/touchscreen/atmel_mxt_ts.c | 109 +++++++++++++++++++---- > 1 file changed, 94 insertions(+), 15 deletions(-) > > diff --git a/drivers/input/touchscreen/atmel_mxt_ts.c b/drivers/input/touchscreen/atmel_mxt_ts.c > index 720574417219..d1865250f492 100644 > --- a/drivers/input/touchscreen/atmel_mxt_ts.c > +++ b/drivers/input/touchscreen/atmel_mxt_ts.c > @@ -34,7 +34,6 @@ > #include > > /* Configuration file */ > -#define MXT_CFG_NAME "maxtouch.cfg" > #define MXT_CFG_MAGIC "OBP_RAW V1" ... > static void mxt_input_sync(struct mxt_data *data) > { > - input_mt_report_pointer_emulation(data->input_dev, > - data->t19_num_keys); > - input_sync(data->input_dev); > + if (data->input_dev) { > + input_mt_report_pointer_emulation(data->input_dev, > + data->t19_num_keys); > + input_sync(data->input_dev); > + } > } Looks like this hunk shouldn't belong to this patch. ... > + if (data->pcfg_name) > + mxt_update_file_name(&data->client->dev, > + &data->cfg_name, > + data->pcfg_name, > + strlen(data->pcfg_name)); This looks wrong to me because I think the cfg_name should fall back to "maxtouch.cfg" if atmel,cfg_name isn't specified in device-tree, otherwise this commit may break devices that use an older device-tree.