Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp5423353pxu; Thu, 22 Oct 2020 01:42:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwyO3YZ6Hz4zu3sIkMhh7Sw5E1Xjcn/czU9/uGaEOlVaIs4GW8ATr/zsT5Xwx1/EkkqIhe9 X-Received: by 2002:a17:906:141b:: with SMTP id p27mr1289972ejc.205.1603356174484; Thu, 22 Oct 2020 01:42:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603356174; cv=none; d=google.com; s=arc-20160816; b=IaqCnB3L1hHB68ALU+6GUY0DnYSwcVzG0EgIFLqIdnzGOObTDVaCODU9nUOo87+hAI hG2mRyJIrO8s9KT1ODFB7lsXpkMdoRY4U5VPVi9mi2s717biRyie7sh9U9dcDb+yWI2v xhpzLb2lZQ2hKOwgtcKrxR3dBofIfUQqTb+hGlfL/u5elOIq4495/NK+btW/lez3j46g 1Ai88jneMKE9QUGbwXLqeG0T3lfmnsBJ4XGevnfO8Go7idLuwQ6kgqy6LbezhcC7vSdW lcZA1zjUrAQ46hjhY7bzRyYKQ2LC387NjkIfUMBA2bcsqxrilJDKBuEofbnsV3IWz8N/ 25fg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=c0lFtQn5Ek6kHHepNfH2DxyZ4ZOcPh8aJypYwBcp2Ys=; b=c5NOEpX/i9sG1yIa4BPcCg2+TYUPtvvt32L4z5fELuRyFV7wJVG5qUnAxjSzmIzYkN WmGHIeE3XqaFNkYp/lv47wPVgT0lvDbSzmprxJ119xvMuzgpAq5Axx73JAFtI7SFaAun 98WRy0Bq3olg8XZgeIpodioXCaRWjHiU+LLaRQjdc+2oJLNzQr/wJe/H0PVprTvNfKb7 mo1HmVctIRtGLpeJ4+rK4BMWMfcsyUxGdVNTxJP8rKBHBEaIyruFj6wGdBRxUlpiS+s8 OEuLImfkIpxbIHeWOAjp92VGwxY4gWFXbhpIfI/UB+36cjVoZAvdSZpa0Kb41lNe4iK6 jCAA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r6si427944eji.73.2020.10.22.01.42.32; Thu, 22 Oct 2020 01:42:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2504409AbgJVGyI convert rfc822-to-8bit (ORCPT + 99 others); Thu, 22 Oct 2020 02:54:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47614 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2504386AbgJVGyH (ORCPT ); Thu, 22 Oct 2020 02:54:07 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9DF7BC0613CE for ; Wed, 21 Oct 2020 23:54:06 -0700 (PDT) Received: from pty.hi.pengutronix.de ([2001:67c:670:100:1d::c5]) by metis.ext.pengutronix.de with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kVUU7-0001Cq-2W; Thu, 22 Oct 2020 08:54:03 +0200 Received: from ore by pty.hi.pengutronix.de with local (Exim 4.89) (envelope-from ) id 1kVUU6-00068g-8g; Thu, 22 Oct 2020 08:54:02 +0200 Date: Thu, 22 Oct 2020 08:54:02 +0200 From: Oleksij Rempel To: Dmitry Torokhov Cc: "Ardelean, Alexandru" , David Jander , "linux-kernel@vger.kernel.org" , "kernel@pengutronix.de" , "linux-input@vger.kernel.org" Subject: Re: [PATCH v1] Input: ads7846: do not overwrite spi->mode flags set by spi framework Message-ID: <20201022065402.x7hlp2zncmnjyum7@pengutronix.de> References: <20201021090434.16387-1-o.rempel@pengutronix.de> <20201021105614.tc3jnv5g62hvl5vg@pengutronix.de> <20201021182757.GA444962@dtor-ws> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8BIT In-Reply-To: <20201021182757.GA444962@dtor-ws> X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-IRC: #ptxdist @freenode X-Accept-Language: de,en X-Accept-Content-Type: text/plain X-Uptime: 08:49:54 up 341 days, 22:08, 380 users, load average: 0.07, 0.07, 0.01 User-Agent: NeoMutt/20170113 (1.7.2) X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c5 X-SA-Exim-Mail-From: ore@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 21, 2020 at 11:27:57AM -0700, Dmitry Torokhov wrote: > On Wed, Oct 21, 2020 at 12:56:14PM +0200, Oleksij Rempel wrote: > > > > As you can see, I would need to configure my dts with spi-cs-high flag, > > even if the hardware is actually ACTIVE_LOW. If I will go this way, I > > would risk a regression as soon as this issue is fixed. > > > > Since the spi framework is already parsing devicetree and set all needed > > flags, I assume it is wrong to blindly drop all this flags in the > > driver. > > Yes, but I wonder if the devices can only work in mode 0 we should be > doing: > > spi->mode &= ~SPI_MODE_MASK; // to be defined as 0x03 in spi.h > spi->mode |= SPI_MODE_0; > > as we can't simply "or" mode value as is Why not? This values are taken from device tree. If some developer decided to add them, then driver should take it over. Even if this values will break the functionality. Other properties of this driver will break the functionality too of this driver too, so why should we silently filter only set of this bits? > (well, mode 0 is kind of working, but just on accident). Good question, will be probably a good reason to measure it. > Thanks. > > -- > Dmitry > > Regards, Oleksij -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |