serial: bcm283x_mu: Remove support for post-init disabling
authorAlexander Graf <agraf@suse.de>
Thu, 25 Jan 2018 11:05:44 +0000 (12:05 +0100)
committerTom Rini <trini@konsulko.com>
Sun, 28 Jan 2018 17:27:33 +0000 (12:27 -0500)
We are switching to a model where a serial device doesn't even get probed when
it's not muxed properly, so we don't need device specific disabling
functionality anymore.

Signed-off-by: Alexander Graf <agraf@suse.de>
drivers/serial/serial_bcm283x_mu.c
include/dm/platform_data/serial_bcm283x_mu.h

index 41c26b3d931530e990c139d8eddc00cf931e6fb8..7ce990b9b82ffacf8eb53f0ce51133ba85b03068 100644 (file)
@@ -59,7 +59,7 @@ static int bcm283x_mu_serial_setbrg(struct udevice *dev, int baudrate)
        struct bcm283x_mu_regs *regs = priv->regs;
        u32 divider;
 
-       if (plat->disabled || plat->skip_init)
+       if (plat->skip_init)
                return 0;
 
        divider = plat->clock / (baudrate * 8);
@@ -75,9 +75,6 @@ static int bcm283x_mu_serial_probe(struct udevice *dev)
        struct bcm283x_mu_serial_platdata *plat = dev_get_platdata(dev);
        struct bcm283x_mu_priv *priv = dev_get_priv(dev);
 
-       if (plat->disabled)
-               return -ENODEV;
-
        priv->regs = (struct bcm283x_mu_regs *)plat->base;
 
        return 0;
@@ -85,14 +82,10 @@ static int bcm283x_mu_serial_probe(struct udevice *dev)
 
 static int bcm283x_mu_serial_getc(struct udevice *dev)
 {
-       struct bcm283x_mu_serial_platdata *plat = dev_get_platdata(dev);
        struct bcm283x_mu_priv *priv = dev_get_priv(dev);
        struct bcm283x_mu_regs *regs = priv->regs;
        u32 data;
 
-       if (plat->disabled)
-               return -EAGAIN;
-
        /* Wait until there is data in the FIFO */
        if (!(readl(&regs->lsr) & BCM283X_MU_LSR_RX_READY))
                return -EAGAIN;
@@ -104,13 +97,9 @@ static int bcm283x_mu_serial_getc(struct udevice *dev)
 
 static int bcm283x_mu_serial_putc(struct udevice *dev, const char data)
 {
-       struct bcm283x_mu_serial_platdata *plat = dev_get_platdata(dev);
        struct bcm283x_mu_priv *priv = dev_get_priv(dev);
        struct bcm283x_mu_regs *regs = priv->regs;
 
-       if (plat->disabled)
-               return 0;
-
        /* Wait until there is space in the FIFO */
        if (!(readl(&regs->lsr) & BCM283X_MU_LSR_TX_EMPTY))
                return -EAGAIN;
@@ -123,14 +112,10 @@ static int bcm283x_mu_serial_putc(struct udevice *dev, const char data)
 
 static int bcm283x_mu_serial_pending(struct udevice *dev, bool input)
 {
-       struct bcm283x_mu_serial_platdata *plat = dev_get_platdata(dev);
        struct bcm283x_mu_priv *priv = dev_get_priv(dev);
        struct bcm283x_mu_regs *regs = priv->regs;
        unsigned int lsr;
 
-       if (plat->disabled)
-               return 0;
-
        lsr = readl(&regs->lsr);
 
        if (input) {
@@ -168,7 +153,6 @@ static int bcm283x_mu_serial_ofdata_to_platdata(struct udevice *dev)
                                     1);
        plat->skip_init = fdtdec_get_bool(gd->fdt_blob, dev_of_offset(dev),
                                          "skip-init");
-       plat->disabled = false;
        return 0;
 }
 #endif
index c47d3c0e60e9d29bb929fa3116f333ec79fea3da..57ae6adc0538ae6198c7218906c7579ade4569c4 100644 (file)
@@ -19,7 +19,6 @@ struct bcm283x_mu_serial_platdata {
        unsigned long base;
        unsigned int clock;
        bool skip_init;
-       bool disabled;
 };
 
 #endif