Received: by 10.192.165.156 with SMTP id m28csp47978imm; Tue, 10 Apr 2018 16:07:16 -0700 (PDT) X-Google-Smtp-Source: AIpwx4//ANSCrYzZNqWwPd9nf75NerMVFhcDlE0dtQM20BtekC2lTmX1Dai0FO2diipAg1BvDIT8 X-Received: by 10.101.78.134 with SMTP id b6mr1592401pgs.392.1523401636432; Tue, 10 Apr 2018 16:07:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523401636; cv=none; d=google.com; s=arc-20160816; b=gls88aXDsm4aF1+Mo3tsYEwYuR5CRZr98pDaSnYHoUAQByVFrvxNzpvlQ6ZQ1ETAAF 6wjhoO7JvyqZ6zalwF/DmSNJuyLv7g+nXX4hx2SvY1YZL+gvhWaFuX8ikDWzL2FmtEXe 2WRnZUUzAWys7vx0PThkyIxgvq59Fsx6H88yRKqI8amrOj0986iYLT2bSYhlxs07R9eT ORcWm0mpOTsVblrAS4zaWbpTYlHJ0HQuBgRIqe1Ia1xvCm1wRhicvf4hejP7RRsu+3TD UKN3j3lL7b+ytPgTi5IYCS6s40syeqHw/fQ2FiClvouz5V8igjaWsjQIOmfyKK3TSIFs tZgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=VjDOYlGL2aHi130T9m/R6eEOPjit+HJ38YMC5sP9kDU=; b=UZW6OMtghZl7gfm2gmZdiEW8nd4YkPpvkT3vEXZbkHu+eTYFyOb+DfmEfBLe0/avt+ GJV1L8Jg6RqnYBds4e4rekEOoQyYuj/gRhQLKog2SQAtCf7VABCqGvPkwq/WK3cwZZsL yrBwTmKwMjE3CpXYY3+ZC1LNGA+IuwiMSsCa/F75FXOK59/3UQ9W4SHQPdJ2XFPtVeUr wcmscpmpADf/VWIyvqxzo0jAQkCnqLGsQ21eDWQnIFIHgIyppysvo/5VZDO6dC9BhVXc fTpjwakIrRn58dINYEbWiZqSA+dquaatBQf+kDLevLSgObbBaP0TY5dXCpSUVQYFU+bP Uxng== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o33-v6si3477175plb.369.2018.04.10.16.06.39; Tue, 10 Apr 2018 16:07:16 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755542AbeDJWf0 (ORCPT + 99 others); Tue, 10 Apr 2018 18:35:26 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:42114 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932238AbeDJWfX (ORCPT ); Tue, 10 Apr 2018 18:35:23 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 07AA3DDF; Tue, 10 Apr 2018 22:35:22 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Andrea Adami , Robert Jarzmik , Daniel Thompson , Lee Jones , Sasha Levin Subject: [PATCH 4.14 041/138] backlight: tdo24m: Fix the SPI CS between transfers Date: Wed, 11 Apr 2018 00:23:51 +0200 Message-Id: <20180410212906.828064031@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180410212902.121524696@linuxfoundation.org> References: <20180410212902.121524696@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Robert Jarzmik [ Upstream commit 2023b0524a6310e9ea80daf085f51c71bff9289f ] Currently the LCD display (TD035S) on the cm-x300 platform is broken and remains blank. The TD0245S specification requires that the chipselect is toggled between commands sent to the panel. This was also the purpose of the former patch of commit f64dcac0b124 ("backlight: tdo24m: ensure chip select changes between transfers"). Unfortunately, the "cs_change" field of a SPI transfer is misleading. Its true meaning is that for a SPI message holding multiple transfers, the chip select is toggled between each transfer, but for the last transfer it remains asserted. In this driver, all the SPI messages contain exactly one transfer, which means that each transfer is the last of its message, and as a consequence the chip select is never toggled. Actually, there was a second bug hidding the first one, hence the problem was not seen until v4.6. This problem was fixed by commit a52db659c79c ("spi: pxa2xx: Fix cs_change management") for PXA based boards. This fix makes the TD035S work again on a cm-x300 board. The same applies to other PXA boards, ie. corgi and tosa. Fixes: a52db659c79c ("spi: pxa2xx: Fix cs_change management") Reported-by: Andrea Adami Signed-off-by: Robert Jarzmik Acked-by: Daniel Thompson Signed-off-by: Lee Jones Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/video/backlight/corgi_lcd.c | 2 +- drivers/video/backlight/tdo24m.c | 2 +- drivers/video/backlight/tosa_lcd.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) --- a/drivers/video/backlight/corgi_lcd.c +++ b/drivers/video/backlight/corgi_lcd.c @@ -177,7 +177,7 @@ static int corgi_ssp_lcdtg_send(struct c struct spi_message msg; struct spi_transfer xfer = { .len = 1, - .cs_change = 1, + .cs_change = 0, .tx_buf = lcd->buf, }; --- a/drivers/video/backlight/tdo24m.c +++ b/drivers/video/backlight/tdo24m.c @@ -369,7 +369,7 @@ static int tdo24m_probe(struct spi_devic spi_message_init(m); - x->cs_change = 1; + x->cs_change = 0; x->tx_buf = &lcd->buf[0]; spi_message_add_tail(x, m); --- a/drivers/video/backlight/tosa_lcd.c +++ b/drivers/video/backlight/tosa_lcd.c @@ -49,7 +49,7 @@ static int tosa_tg_send(struct spi_devic struct spi_message msg; struct spi_transfer xfer = { .len = 1, - .cs_change = 1, + .cs_change = 0, .tx_buf = buf, };