Skip to content
Snippets Groups Projects
Commit 84807922 authored by Jagan Teki's avatar Jagan Teki
Browse files

spi: omap3: Skip set_mode, set_speed from claim


set_mode, set_seed functions has separate function pointers
in dm_spi_ops, so use them in relevent one instead of
calling from claim_bus.

Signed-off-by: default avatarJagan Teki <jagan@amarulasolutions.com>
parent 15927aef
Branches
Tags
No related merge requests found
...@@ -456,9 +456,6 @@ static void _omap3_spi_claim_bus(struct omap3_spi_priv *priv) ...@@ -456,9 +456,6 @@ static void _omap3_spi_claim_bus(struct omap3_spi_priv *priv)
conf |= OMAP3_MCSPI_MODULCTRL_SINGLE; conf |= OMAP3_MCSPI_MODULCTRL_SINGLE;
writel(conf, &priv->regs->modulctrl); writel(conf, &priv->regs->modulctrl);
_omap3_spi_set_mode(priv);
_omap3_spi_set_speed(priv);
} }
#ifndef CONFIG_DM_SPI #ifndef CONFIG_DM_SPI
...@@ -594,8 +591,6 @@ static int omap3_spi_claim_bus(struct udevice *dev) ...@@ -594,8 +591,6 @@ static int omap3_spi_claim_bus(struct udevice *dev)
struct dm_spi_slave_platdata *slave_plat = dev_get_parent_platdata(dev); struct dm_spi_slave_platdata *slave_plat = dev_get_parent_platdata(dev);
priv->cs = slave_plat->cs; priv->cs = slave_plat->cs;
priv->mode = slave_plat->mode;
priv->freq = slave_plat->max_hz;
_omap3_spi_claim_bus(priv); _omap3_spi_claim_bus(priv);
return 0; return 0;
...@@ -652,11 +647,27 @@ static int omap3_spi_xfer(struct udevice *dev, unsigned int bitlen, ...@@ -652,11 +647,27 @@ static int omap3_spi_xfer(struct udevice *dev, unsigned int bitlen,
static int omap3_spi_set_speed(struct udevice *bus, unsigned int speed) static int omap3_spi_set_speed(struct udevice *bus, unsigned int speed)
{ {
struct udevice *bus = dev->parent;
struct omap3_spi_priv *priv = dev_get_priv(bus);
struct dm_spi_slave_platdata *slave_plat = dev_get_parent_platdata(dev);
priv->cs = slave_plat->cs;
priv->freq = slave_plat->max_hz;
_omap3_spi_set_speed(priv);
return 0; return 0;
} }
static int omap3_spi_set_mode(struct udevice *bus, uint mode) static int omap3_spi_set_mode(struct udevice *bus, uint mode)
{ {
struct udevice *bus = dev->parent;
struct omap3_spi_priv *priv = dev_get_priv(bus);
struct dm_spi_slave_platdata *slave_plat = dev_get_parent_platdata(dev);
priv->cs = slave_plat->cs;
priv->mode = slave_plat->mode;
_omap3_spi_set_mode(priv);
return 0; return 0;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment