From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965727AbcAZMws (ORCPT ); Tue, 26 Jan 2016 07:52:48 -0500 Received: from mga04.intel.com ([192.55.52.120]:5842 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932339AbcAZMwp (ORCPT ); Tue, 26 Jan 2016 07:52:45 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,350,1449561600"; d="scan'208";a="898533395" Subject: Re: [PATCH 0/4] spi: pxa2xx: Chip select fixes for Intel Baytrail and Braswell To: Mika Westerberg , Mark Brown References: <1453807111-103111-1-git-send-email-mika.westerberg@linux.intel.com> Cc: Daniel Mack , Haojian Zhuang , Robert Jarzmik , Bastien Nocera , linux-spi@vger.kernel.org, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org From: Jarkko Nikula Message-ID: <56A76C17.5070309@linux.intel.com> Date: Tue, 26 Jan 2016 14:52:39 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Icedove/38.5.0 MIME-Version: 1.0 In-Reply-To: <1453807111-103111-1-git-send-email-mika.westerberg@linux.intel.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 01/26/2016 01:18 PM, Mika Westerberg wrote: > It turns out that in Windows SPI drivers are responsible for handling ACPI > DeviceSelection field themselves. Furthermore there has been separate > drivers for big core and atom SPI host controllers. For atom (including > Baytrail and Braswell) the driver starts DeviceSelection from 1 instead of 0 > as expected by the Linux SPI core. > > As an example Microsoft Surface 3 has touch screen connected to SPI bus > described in ACPI DSDT like this: > > Scope (_SB.PCI0.SPI1) > { > Device (NTRG) > { > Name (_HID, "MSHW0037") // _HID: Hardware ID > ... > Name (CRS1, ResourceTemplate () > { > SpiSerialBus (0x0001, // SPI DeviceSelection > PolarityLow, FourWireMode, 0x10, > ControllerInitiated, 0x007A1200, ClockPolarityLow, > ClockPhaseFirst, "\\_SB.PCI0.SPI1", > 0x00, ResourceConsumer, , > ) > > This fails to enumerate because ACPI DeviceSelection of 1 is greater than > number of chip selects the driver supports [1]. > > This series adds a new hook to struct spi_master ->fw_translate_cs() that > allows a driver to translate the chip select number from firmware to the > numbering scheme expected by the Linux SPI core and implement that for both > Baytrail and Braswell. > > In addition to that we add support for the second chip select found on > Braswell. > > [1] https://bugzilla.kernel.org/show_bug.cgi?id=104291 > > Mika Westerberg (4): > spi: Let drivers translate ACPI DeviceSelection to suitable Linux chip select > spi: pxa2xx: Translate ACPI DeviceSelection to Linux chip select on Baytrail > spi: pxa2xx: Move chip select control bits into lpss_config structure > spi: pxa2xx: Add support for both chip selects on Intel Braswell > > drivers/spi/spi-pxa2xx.c | 106 ++++++++++++++++++++++++++++++++++----------- > drivers/spi/spi.c | 19 +++++++- > include/linux/pxa2xx_ssp.h | 1 + > include/linux/spi/spi.h | 5 +++ > 4 files changed, 105 insertions(+), 26 deletions(-) > Reviewed-by: Jarkko Nikula