From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751935AbcBNJsT (ORCPT ); Sun, 14 Feb 2016 04:48:19 -0500 Received: from szxga03-in.huawei.com ([119.145.14.66]:7045 "EHLO szxga03-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751846AbcBNJsQ (ORCPT ); Sun, 14 Feb 2016 04:48:16 -0500 Reply-To: Subject: Re: [RFC PATCH] SPI/ACPI: DesignWare: Add ACPI support for Designware SPI driver References: <1454656280-130658-1-git-send-email-qiujiang@huawei.com> To: Andy Shevchenko CC: Mark Brown , linux-spi , "linux-acpi@vger.kernel.org" , "linux-kernel@vger.kernel.org" , , , From: Jiang Qiu Message-ID: <56C04D43.1040604@huawei.com> Date: Sun, 14 Feb 2016 17:47:47 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.74.160.152] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020204.56C04D53.0054,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2013-05-26 15:14:31, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 426e48ccdc54e9378a98391b9a5bca51 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Andy, Sorry for late relpy because Chinese new year holiday. See my replies below. Best Regards Jiang 在 2016/2/5 23:55, Andy Shevchenko 写道: > On Fri, Feb 5, 2016 at 9:11 AM, qiujiang wrote: >> This patch added ACPI support for DesignWare SPI mmio driver. It >> was based the corresponding DT driver and compatible for this two >> way. This patch has been tested on Hisilicon D02 board. It relies >> on the GPIO patchset. > My comments below. As Mark mentioned, I want to ask you how to use this spi-dw-mmio driver for ACPI binding? Dose it need any other extra patchset? > >> @@ -84,8 +87,6 @@ static int dw_spi_mmio_probe(struct platform_device *pdev) >> dws->num_cs = num_cs; >> >> if (pdev->dev.of_node) { >> - int i; >> - >> for (i = 0; i < dws->num_cs; i++) { >> int cs_gpio = of_get_named_gpio(pdev->dev.of_node, >> "cs-gpios", i); > It seems the driver was never validated with more than one chip select. > Perhaps someone has to switch to use of_spi_register_master() here. of_spi_register_master() will be executed in the spi_register_master(), but it just saved the cs_gpios to the spi_master and not used it any more. >> @@ -104,6 +105,18 @@ static int dw_spi_mmio_probe(struct platform_device *pdev) >> } >> } >> >> + if (ACPI_COMPANION(&pdev->dev)) { >> + for (i = 0; i < dws->num_cs; i++) { >> + snprintf(propname, sizeof(propname), "cs%d", i); >> + gpiod = devm_gpiod_get(&pdev->dev, >> + propname, GPIOD_ASIS); >> + if (IS_ERR(gpiod)) { >> + dev_err(&pdev->dev, "Get gpio desc failed!\n"); >> + return PTR_ERR(gpiod); >> + } >> + } >> + } > Like Mark noticed there is also same issue. Do you indeed check the > configuration with different chip select signals? As a spi master driver, it seems that multi-chip select must be supported, so this check is necessary, I think. >