spi: mxc_spi: Fix chipselect on DM_SPI driver uclass
CS GPIO activation low/high is determinated by the device tree so we don't need to take in accoung in cs_activate and cs_deactivate Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com> Reviewed-by: Peng Fan <peng.fan@nxp.com> Reviewed-by: Jagan Teki <jagan@openedev.com>
This commit is contained in:
parent
618e8e20c2
commit
34ad749141
|
|
@ -60,7 +60,7 @@ static inline struct mxc_spi_slave *to_mxc_spi_slave(struct spi_slave *slave)
|
||||||
static void mxc_spi_cs_activate(struct mxc_spi_slave *mxcs)
|
static void mxc_spi_cs_activate(struct mxc_spi_slave *mxcs)
|
||||||
{
|
{
|
||||||
if (CONFIG_IS_ENABLED(DM_SPI)) {
|
if (CONFIG_IS_ENABLED(DM_SPI)) {
|
||||||
dm_gpio_set_value(&mxcs->ss, mxcs->ss_pol);
|
dm_gpio_set_value(&mxcs->ss, 1);
|
||||||
} else {
|
} else {
|
||||||
if (mxcs->gpio > 0)
|
if (mxcs->gpio > 0)
|
||||||
gpio_set_value(mxcs->gpio, mxcs->ss_pol);
|
gpio_set_value(mxcs->gpio, mxcs->ss_pol);
|
||||||
|
|
@ -70,7 +70,7 @@ static void mxc_spi_cs_activate(struct mxc_spi_slave *mxcs)
|
||||||
static void mxc_spi_cs_deactivate(struct mxc_spi_slave *mxcs)
|
static void mxc_spi_cs_deactivate(struct mxc_spi_slave *mxcs)
|
||||||
{
|
{
|
||||||
if (CONFIG_IS_ENABLED(DM_SPI)) {
|
if (CONFIG_IS_ENABLED(DM_SPI)) {
|
||||||
dm_gpio_set_value(&mxcs->ss, !(mxcs->ss_pol));
|
dm_gpio_set_value(&mxcs->ss, 0);
|
||||||
} else {
|
} else {
|
||||||
if (mxcs->gpio > 0)
|
if (mxcs->gpio > 0)
|
||||||
gpio_set_value(mxcs->gpio, !(mxcs->ss_pol));
|
gpio_set_value(mxcs->gpio, !(mxcs->ss_pol));
|
||||||
|
|
@ -508,7 +508,7 @@ static int mxc_spi_probe(struct udevice *bus)
|
||||||
if (plat->base == FDT_ADDR_T_NONE)
|
if (plat->base == FDT_ADDR_T_NONE)
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
|
|
||||||
ret = dm_gpio_set_value(&plat->ss, !(mxcs->ss_pol));
|
ret = dm_gpio_set_value(&plat->ss, 0);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
dev_err(bus, "Setting cs error\n");
|
dev_err(bus, "Setting cs error\n");
|
||||||
return ret;
|
return ret;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue