spi: pxa2xx: Make LPSS SPI general register optional
authorJarkko Nikula <jarkko.nikula@linux.intel.com>
Thu, 4 Jun 2015 13:55:12 +0000 (16:55 +0300)
committerMark Brown <broonie@kernel.org>
Fri, 5 Jun 2015 10:40:45 +0000 (11:40 +0100)
General register located in LPSS SPI private register space is not found in
upcoming Intel LPSS platforms. Access it conditionally depending is it
defined in configuration.

Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-pxa2xx.c

index 3fec31dbf9721e0216091e96e2049b620dcaf14f..f97cd42fbc227d770f0f6d225aceedb088905849 100644 (file)
@@ -245,9 +245,13 @@ static void lpss_ssp_setup(struct driver_data *drv_data)
        if (drv_data->master_info->enable_dma) {
                __lpss_ssp_write_priv(drv_data, config->reg_ssp, 1);
 
-               value = __lpss_ssp_read_priv(drv_data, config->reg_general);
-               value |= GENERAL_REG_RXTO_HOLDOFF_DISABLE;
-               __lpss_ssp_write_priv(drv_data, config->reg_general, value);
+               if (config->reg_general >= 0) {
+                       value = __lpss_ssp_read_priv(drv_data,
+                                                    config->reg_general);
+                       value |= GENERAL_REG_RXTO_HOLDOFF_DISABLE;
+                       __lpss_ssp_write_priv(drv_data,
+                                             config->reg_general, value);
+               }
        }
 }