mmc: mmc_spi: Set up polling even if voltage-ranges is not present

When voltage-ranges property is not present the driver assumes that
it is 3.3v (3.2v..3.4v). But at the same time it disallows polling.

Fix that by dropping the comparison to 0 when no property is provided.

While at it, mark voltage-ranges property optional as it was initially.

Fixes: 9c43df5791 ("mmc_spi: Add support for OpenFirmware bindings")
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20210419112459.25241-3-andriy.shevchenko@linux.intel.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
This commit is contained in:
Andy Shevchenko 2021-04-19 14:24:56 +03:00 committed by Ulf Hansson
parent 6dab809bb5
commit 6c857ccf4e
2 changed files with 4 additions and 4 deletions

View File

@ -5,11 +5,11 @@ by mmc.txt and the properties used by the mmc_spi driver.
Required properties: Required properties:
- spi-max-frequency : maximum frequency for this device (Hz). - spi-max-frequency : maximum frequency for this device (Hz).
- voltage-ranges : two cells are required, first cell specifies minimum
slot voltage (mV), second cell specifies maximum slot voltage (mV).
Several ranges could be specified.
Optional properties: Optional properties:
- voltage-ranges : two cells are required, first cell specifies minimum
slot voltage (mV), second cell specifies maximum slot voltage (mV).
Several ranges could be specified. If not provided, 3.2v..3.4v is assumed.
- gpios : may specify GPIOs in this order: Card-Detect GPIO, - gpios : may specify GPIOs in this order: Card-Detect GPIO,
Write-Protect GPIO. Note that this does not follow the Write-Protect GPIO. Note that this does not follow the
binding from mmc.txt, for historical reasons. binding from mmc.txt, for historical reasons.

View File

@ -66,7 +66,7 @@ struct mmc_spi_platform_data *mmc_spi_get_pdata(struct spi_device *spi)
if (!oms) if (!oms)
return NULL; return NULL;
if (mmc_of_parse_voltage(mmc, &oms->pdata.ocr_mask) <= 0) if (mmc_of_parse_voltage(mmc, &oms->pdata.ocr_mask) < 0)
goto err_ocr; goto err_ocr;
oms->detect_irq = irq_of_parse_and_map(np, 0); oms->detect_irq = irq_of_parse_and_map(np, 0);