On Fri, Feb 5, 2016 at 9:11 AM, qiujiang <qiujiang@xxxxxxxxxx> wrote:As Mark mentioned, I want to ask you how to use this spi-dw-mmio driver for
This patch added ACPI support for DesignWare SPI mmio driver. ItMy comments below.
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.
of_spi_register_master() will be executed in the spi_register_master(), but it just saved the
@@ -84,8 +87,6 @@ static int dw_spi_mmio_probe(struct platform_device *pdev)It seems the driver was never validated with more than one chip select.
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);
Perhaps someone has to switch to use of_spi_register_master() here.
As a spi master driver, it seems that multi-chip select must be supported, so this check is@@ -104,6 +105,18 @@ static int dw_spi_mmio_probe(struct platform_device *pdev)Like Mark noticed there is also same issue. Do you indeed check the
}
}
+ 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);
+ }
+ }
+ }
configuration with different chip select signals?