[PATCH] tty: serial: omap: use mctrl_gpio helpers

2015-05-22 Thread yegorslists
From: Yegor Yefremov yegorsli...@googlemail.com

This patch permits to use GPIOs to control the CTS/RTS/DTR/DSR/DCD/RI
signals.

Signed-off-by: Yegor Yefremov yegorsli...@googlemail.com
---
 .../devicetree/bindings/serial/omap_serial.txt |9 +
 drivers/tty/serial/Kconfig |1 +
 drivers/tty/serial/omap-serial.c   |  168 +++-
 3 files changed, 171 insertions(+), 7 deletions(-)

diff --git a/Documentation/devicetree/bindings/serial/omap_serial.txt 
b/Documentation/devicetree/bindings/serial/omap_serial.txt
index 54c2a15..10fcba8 100644
--- a/Documentation/devicetree/bindings/serial/omap_serial.txt
+++ b/Documentation/devicetree/bindings/serial/omap_serial.txt
@@ -16,6 +16,9 @@ Optional properties:
 - dmas : DMA specifier, consisting of a phandle to the DMA controller
  node and a DMA channel number.
 - dma-names : rx for receive channel, tx for transmit channel.
+- {rts,cts,dtr,dsr,rng,dcd}-gpios: specify a GPIO for RTS/CTS/DTR/DSR/RI/DCD
+  line respectively. It will use specified PIO instead of the peripheral
+  function pin for the UART feature. If unsure, don't specify this property.
 
 Example:
 
@@ -27,4 +30,10 @@ Example:
 dma-names = tx, rx;
 ti,hwmods = uart4;
 clock-frequency = 4800;
+cts-gpios = gpio3 5 GPIO_ACTIVE_LOW;
+rts-gpios = gpio3 6 GPIO_ACTIVE_LOW;
+dtr-gpios = gpio1 12 GPIO_ACTIVE_LOW;
+dsr-gpios = gpio1 13 GPIO_ACTIVE_LOW;
+dcd-gpios = gpio1 14 GPIO_ACTIVE_LOW;
+rng-gpios = gpio1 15 GPIO_ACTIVE_LOW;
 };
diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig
index f8120c1..bbe0e06 100644
--- a/drivers/tty/serial/Kconfig
+++ b/drivers/tty/serial/Kconfig
@@ -1106,6 +1106,7 @@ config SERIAL_OMAP
tristate OMAP serial port support
depends on ARCH_OMAP2PLUS
select SERIAL_CORE
+   select SERIAL_MCTRL_GPIO
help
  If you have a machine based on an Texas Instruments OMAP CPU you
  can enable its onboard serial ports by enabling this option.
diff --git a/drivers/tty/serial/omap-serial.c b/drivers/tty/serial/omap-serial.c
index 7f49172..42751b0 100644
--- a/drivers/tty/serial/omap-serial.c
+++ b/drivers/tty/serial/omap-serial.c
@@ -43,9 +43,13 @@
 #include linux/gpio.h
 #include linux/of_gpio.h
 #include linux/platform_data/serial-omap.h
+#include linux/gpio/consumer.h
+#include linux/err.h
 
 #include dt-bindings/gpio/gpio.h
 
+#include serial_mctrl_gpio.h
+
 #define OMAP_MAX_HSUART_PORTS  10
 
 #define UART_BUILD_REVISION(x, y)  (((x)  8) | (y))
@@ -164,6 +168,9 @@ struct uart_omap_port {
u32 features;
 
int rts_gpio;
+   struct mctrl_gpios  *gpios;
+   int gpio_irq[UART_GPIO_MAX];
+   boolms_irq_enabled;
 
struct pm_qos_request   pm_qos_request;
u32 latency;
@@ -301,6 +308,27 @@ static void serial_omap_enable_ms(struct uart_port *port)
dev_dbg(up-port.dev, serial_omap_enable_ms+%d\n, up-port.line);
 
pm_runtime_get_sync(up-dev);
+
+   /*
+   * Interrupt should not be enabled twice
+   */
+   if (up-ms_irq_enabled)
+   return;
+
+   up-ms_irq_enabled = true;
+
+   if (up-gpio_irq[UART_GPIO_CTS] = 0)
+   enable_irq(up-gpio_irq[UART_GPIO_CTS]);
+
+   if (up-gpio_irq[UART_GPIO_DSR] = 0)
+   enable_irq(up-gpio_irq[UART_GPIO_DSR]);
+
+   if (up-gpio_irq[UART_GPIO_RI] = 0)
+   enable_irq(up-gpio_irq[UART_GPIO_RI]);
+
+   if (up-gpio_irq[UART_GPIO_DCD] = 0)
+   enable_irq(up-gpio_irq[UART_GPIO_DCD]);
+
up-ier |= UART_IER_MSI;
serial_out(up, UART_IER, up-ier);
pm_runtime_mark_last_busy(up-dev);
@@ -317,6 +345,11 @@ static void serial_omap_stop_tx(struct uart_port *port)
/* Handle RS-485 */
if (port-rs485.flags  SER_RS485_ENABLED) {
if (up-scr  OMAP_UART_SCR_TX_EMPTY) {
+   struct gpio_desc *rts_gpiod;
+
+   rts_gpiod = mctrl_gpio_to_gpiod(up-gpios,
+   UART_GPIO_RTS);
+
/* THR interrupt is fired when both TX FIFO and TX
 * shift register are empty. This means there's nothing
 * left to transmit now, so make sure the THR interrupt
@@ -328,11 +361,11 @@ static void serial_omap_stop_tx(struct uart_port *port)
serial_out(up, UART_OMAP_SCR, up-scr);
res = (port-rs485.flags  SER_RS485_RTS_AFTER_SEND) ?
1 : 0;
-   if (gpio_get_value(up-rts_gpio) != res) {
+   if 

[PATCH] ARM: dts: am33xx: fix DMA support for the second USB interface

2014-04-28 Thread yegorslists
From: Yegor Yefremov yegorsli...@googlemail.com

This patch creates unique DMA channels for the second USB
interface, otherwise the second USB interface is not usable
at all.

Signed-off-by: Yegor Yefremov yegorsli...@googlemail.com
---
 arch/arm/boot/dts/am33xx.dtsi |   12 ++--
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/arch/arm/boot/dts/am33xx.dtsi b/arch/arm/boot/dts/am33xx.dtsi
index 07f283c..e04cbbc 100644
--- a/arch/arm/boot/dts/am33xx.dtsi
+++ b/arch/arm/boot/dts/am33xx.dtsi
@@ -548,12 +548,12 @@
cppi41dma 26 1 cppi41dma 27 1
cppi41dma 28 1 cppi41dma 29 1;
dma-names =
-   rx1, rx2, rx3, rx4, rx5, 
rx6, rx7,
-   rx8, rx9, rx10, rx11, rx12, 
rx13,
-   rx14, rx15,
-   tx1, tx2, tx3, tx4, tx5, 
tx6, tx7,
-   tx8, tx9, tx10, tx11, tx12, 
tx13,
-   tx14, tx15;
+   rx16, rx17, rx18, rx19, rx20, 
rx21, rx22,
+   rx23, rx24, rx25, rx26, rx27, 
rx28,
+   rx29, rx30,
+   tx16, tx17, tx18, tx19, tx20, 
tx21, tx22,
+   tx23, tx24, tx25, tx26, tx27, 
tx28,
+   tx29, tx30;
};
 
cppi41dma: dma-controller@47402000 {
-- 
1.7.7

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v3] gpio: omap: implement get_direction

2014-04-24 Thread yegorslists
From: Yegor Yefremov yegorsli...@googlemail.com

This patch implements gpio_chip's get_direction() routine, that
lets other drivers get particular GPIOs direction using
struct gpio_desc.

Signed-off-by: Yegor Yefremov yegorsli...@googlemail.com
Acked-by: Javier Martinez Canillas jav...@dowhile0.org
---
Changes:
v3: get rid of _get_gpio_direction() (Linus Walleij)
v2: rework return value calculation
 drivers/gpio/gpio-omap.c |   17 +
 1 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c
index 19b886c..62c12e4 100644
--- a/drivers/gpio/gpio-omap.c
+++ b/drivers/gpio/gpio-omap.c
@@ -27,6 +27,7 @@
 #include linux/irqdomain.h
 #include linux/irqchip/chained_irq.h
 #include linux/gpio.h
+#include linux/bitops.h
 #include linux/platform_data/gpio-omap.h
 
 #define OFF_MODE   1
@@ -936,6 +937,21 @@ static inline void mpuio_init(struct gpio_bank *bank)
 
 /*-*/
 
+static int gpio_get_direction(struct gpio_chip *chip, unsigned offset)
+{
+   struct gpio_bank *bank;
+   unsigned long flags;
+   void __iomem *reg;
+   int dir;
+
+   bank = container_of(chip, struct gpio_bank, chip);
+   reg = bank-base + bank-regs-direction;
+   spin_lock_irqsave(bank-lock, flags);
+   dir = !!(readl_relaxed(reg)  BIT(offset));
+   spin_unlock_irqrestore(bank-lock, flags);
+   return dir;
+}
+
 static int gpio_input(struct gpio_chip *chip, unsigned offset)
 {
struct gpio_bank *bank;
@@ -1092,6 +1108,7 @@ static void omap_gpio_chip_init(struct gpio_bank *bank)
 */
bank-chip.request = omap_gpio_request;
bank-chip.free = omap_gpio_free;
+   bank-chip.get_direction = gpio_get_direction;
bank-chip.direction_input = gpio_input;
bank-chip.get = gpio_get;
bank-chip.direction_output = gpio_output;
-- 
1.7.7

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


omap-serial: use mctrl_gpio helpers

2014-04-24 Thread yegorslists
This patch is based on Richard Genoud' patch adding generic GPIO support [1]
and my patch adding get_direction() functionality to OMAP's GPIO driver [2].

So far RTS/DTR are working both as modem control outputs and RTS as RS-485 
2-wire controller.

CTS/DSR/DSR/RI are generating interrupts.

Richard, Greg, what is the status of [1]? It seems like it will be available in 
3.16 first?

TODO:

1. remove rts_gpio from uart_omap_port
2. perhaps add rts_gpiod to uart_omap_port to avoid numerous invocations of

rts_gpiod = mctrl_gpio_to_gpiod(up-gpios, UART_GPIO_RTS);
3. add device tree documentation 

Yegor

[1] http://comments.gmane.org/gmane.linux.serial/13967
[2] http://www.spinics.net/lists/arm-kernel/msg325162.html

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[RFC] tty: serial: omap: use mctrl_gpio helpers

2014-04-24 Thread yegorslists
From: Yegor Yefremov yegorsli...@googlemail.com

This patch permits to use GPIOs to control the CTS/RTS/DTR/DSR/DCD/RI
signals.

Signed-off-by: Yegor Yefremov yegorsli...@googlemail.com
---
 drivers/tty/serial/Kconfig   |1 +
 drivers/tty/serial/omap-serial.c |  168 --
 2 files changed, 162 insertions(+), 7 deletions(-)

diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig
index 6e748dc..3eeaa09 100644
--- a/drivers/tty/serial/Kconfig
+++ b/drivers/tty/serial/Kconfig
@@ -1088,6 +1088,7 @@ config SERIAL_OMAP
tristate OMAP serial port support
depends on ARCH_OMAP2PLUS
select SERIAL_CORE
+   select SERIAL_MCTRL_GPIO
help
  If you have a machine based on an Texas Instruments OMAP CPU you
  can enable its onboard serial ports by enabling this option.
diff --git a/drivers/tty/serial/omap-serial.c b/drivers/tty/serial/omap-serial.c
index 08b6b94..87dcad7 100644
--- a/drivers/tty/serial/omap-serial.c
+++ b/drivers/tty/serial/omap-serial.c
@@ -43,9 +43,13 @@
 #include linux/gpio.h
 #include linux/of_gpio.h
 #include linux/platform_data/serial-omap.h
+#include linux/gpio/consumer.h
+#include linux/err.h
 
 #include dt-bindings/gpio/gpio.h
 
+#include serial_mctrl_gpio.h
+
 #define OMAP_MAX_HSUART_PORTS  6
 
 #define UART_BUILD_REVISION(x, y)  (((x)  8) | (y))
@@ -169,6 +173,9 @@ struct uart_omap_port {
 
struct serial_rs485 rs485;
int rts_gpio;
+   struct mctrl_gpios  *gpios;
+   int gpio_irq[UART_GPIO_MAX];
+   boolms_irq_enabled;
 
struct pm_qos_request   pm_qos_request;
u32 latency;
@@ -294,6 +301,27 @@ static void serial_omap_enable_ms(struct uart_port *port)
dev_dbg(up-port.dev, serial_omap_enable_ms+%d\n, up-port.line);
 
pm_runtime_get_sync(up-dev);
+
+   /*
+   * Interrupt should not be enabled twice
+   */
+   if (up-ms_irq_enabled)
+   return;
+
+   up-ms_irq_enabled = true;
+
+   if (up-gpio_irq[UART_GPIO_CTS] = 0)
+   enable_irq(up-gpio_irq[UART_GPIO_CTS]);
+
+   if (up-gpio_irq[UART_GPIO_DSR] = 0)
+   enable_irq(up-gpio_irq[UART_GPIO_DSR]);
+
+   if (up-gpio_irq[UART_GPIO_RI] = 0)
+   enable_irq(up-gpio_irq[UART_GPIO_RI]);
+
+   if (up-gpio_irq[UART_GPIO_DCD] = 0)
+   enable_irq(up-gpio_irq[UART_GPIO_DCD]);
+
up-ier |= UART_IER_MSI;
serial_out(up, UART_IER, up-ier);
pm_runtime_mark_last_busy(up-dev);
@@ -310,6 +338,10 @@ static void serial_omap_stop_tx(struct uart_port *port)
/* Handle RS-485 */
if (up-rs485.flags  SER_RS485_ENABLED) {
if (up-scr  OMAP_UART_SCR_TX_EMPTY) {
+   struct gpio_desc *rts_gpiod;
+
+   rts_gpiod = mctrl_gpio_to_gpiod(up-gpios, 
UART_GPIO_RTS);
+
/* THR interrupt is fired when both TX FIFO and TX
 * shift register are empty. This means there's nothing
 * left to transmit now, so make sure the THR interrupt
@@ -320,10 +352,10 @@ static void serial_omap_stop_tx(struct uart_port *port)
up-scr = ~OMAP_UART_SCR_TX_EMPTY;
serial_out(up, UART_OMAP_SCR, up-scr);
res = (up-rs485.flags  SER_RS485_RTS_AFTER_SEND) ? 1 
: 0;
-   if (gpio_get_value(up-rts_gpio) != res) {
+   if (gpiod_get_value(rts_gpiod) != res) {
if (up-rs485.delay_rts_after_send  0)
mdelay(up-rs485.delay_rts_after_send);
-   gpio_set_value(up-rts_gpio, res);
+   gpiod_set_value(rts_gpiod, res);
}
} else {
/* We're asked to stop, but there's still stuff in the
@@ -425,14 +457,18 @@ static void serial_omap_start_tx(struct uart_port *port)
 
/* Handle RS-485 */
if (up-rs485.flags  SER_RS485_ENABLED) {
+   struct gpio_desc *rts_gpiod;
+
+   rts_gpiod = mctrl_gpio_to_gpiod(up-gpios, UART_GPIO_RTS);
+
/* Fire THR interrupts when FIFO is below trigger level */
up-scr = ~OMAP_UART_SCR_TX_EMPTY;
serial_out(up, UART_OMAP_SCR, up-scr);
 
/* if rts not already enabled */
res = (up-rs485.flags  SER_RS485_RTS_ON_SEND) ? 1 : 0;
-   if (gpio_get_value(up-rts_gpio) != res) {
-   gpio_set_value(up-rts_gpio, res);
+   if (gpiod_get_value(rts_gpiod) != res) {
+   gpiod_set_value(rts_gpiod, res);
if (up-rs485.delay_rts_before_send  0)
mdelay(up-rs485.delay_rts_before_send);
}

[PATCH] gpio: omap: implement get_direction

2014-04-22 Thread yegorslists
From: Yegor Yefremov yegorsli...@googlemail.com

This patch implements gpio_chip's get_direction() routine, that
lets other drivers get particular GPIOs direction using
struct gpio_desc.

Signed-off-by: Yegor Yefremov yegorsli...@googlemail.com
---
 drivers/gpio/gpio-omap.c |   28 
 1 files changed, 28 insertions(+), 0 deletions(-)

diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c
index 19b886c..b55bf7b 100644
--- a/drivers/gpio/gpio-omap.c
+++ b/drivers/gpio/gpio-omap.c
@@ -102,6 +102,20 @@ static int omap_gpio_to_irq(struct gpio_chip *chip, 
unsigned offset)
return irq_find_mapping(bank-domain, offset);
 }
 
+static int _get_gpio_direction(struct gpio_bank *bank, int gpio)
+{
+   void __iomem *reg = bank-base;
+   u32 l;
+   u32 mask = 1  gpio;
+
+   reg += bank-regs-direction;
+   l = readl_relaxed(reg);
+   if (l  mask)
+   return 1;
+
+   return 0;
+}
+
 static void _set_gpio_direction(struct gpio_bank *bank, int gpio, int is_input)
 {
void __iomem *reg = bank-base;
@@ -936,6 +950,19 @@ static inline void mpuio_init(struct gpio_bank *bank)
 
 /*-*/
 
+static int gpio_get_direction(struct gpio_chip *chip, unsigned offset)
+{
+   struct gpio_bank *bank;
+   unsigned long flags;
+   int dir;
+
+   bank = container_of(chip, struct gpio_bank, chip);
+   spin_lock_irqsave(bank-lock, flags);
+   dir = _get_gpio_direction(bank, offset);
+   spin_unlock_irqrestore(bank-lock, flags);
+   return dir;
+}
+
 static int gpio_input(struct gpio_chip *chip, unsigned offset)
 {
struct gpio_bank *bank;
@@ -1092,6 +1119,7 @@ static void omap_gpio_chip_init(struct gpio_bank *bank)
 */
bank-chip.request = omap_gpio_request;
bank-chip.free = omap_gpio_free;
+   bank-chip.get_direction = gpio_get_direction;
bank-chip.direction_input = gpio_input;
bank-chip.get = gpio_get;
bank-chip.direction_output = gpio_output;
-- 
1.7.7

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2] gpio: omap: implement get_direction

2014-04-22 Thread yegorslists
From: Yegor Yefremov yegorsli...@googlemail.com

This patch implements gpio_chip's get_direction() routine, that
lets other drivers get particular GPIOs direction using
struct gpio_desc.

Signed-off-by: Yegor Yefremov yegorsli...@googlemail.com
Acked-by: Javier Martinez Canillas jav...@dowhile0.org
---
Changes:
v2: rework return value calculation

 drivers/gpio/gpio-omap.c |   25 +
 1 files changed, 25 insertions(+), 0 deletions(-)

diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c
index 19b886c..fadc45e 100644
--- a/drivers/gpio/gpio-omap.c
+++ b/drivers/gpio/gpio-omap.c
@@ -102,6 +102,17 @@ static int omap_gpio_to_irq(struct gpio_chip *chip, 
unsigned offset)
return irq_find_mapping(bank-domain, offset);
 }
 
+static int _get_gpio_direction(struct gpio_bank *bank, int gpio)
+{
+   void __iomem *reg = bank-base;
+   u32 l;
+
+   reg += bank-regs-direction;
+   l = (readl_relaxed(reg)  gpio);
+
+   return (l  0x0001);
+}
+
 static void _set_gpio_direction(struct gpio_bank *bank, int gpio, int is_input)
 {
void __iomem *reg = bank-base;
@@ -936,6 +947,19 @@ static inline void mpuio_init(struct gpio_bank *bank)
 
 /*-*/
 
+static int gpio_get_direction(struct gpio_chip *chip, unsigned offset)
+{
+   struct gpio_bank *bank;
+   unsigned long flags;
+   int dir;
+
+   bank = container_of(chip, struct gpio_bank, chip);
+   spin_lock_irqsave(bank-lock, flags);
+   dir = _get_gpio_direction(bank, offset);
+   spin_unlock_irqrestore(bank-lock, flags);
+   return dir;
+}
+
 static int gpio_input(struct gpio_chip *chip, unsigned offset)
 {
struct gpio_bank *bank;
@@ -1092,6 +1116,7 @@ static void omap_gpio_chip_init(struct gpio_bank *bank)
 */
bank-chip.request = omap_gpio_request;
bank-chip.free = omap_gpio_free;
+   bank-chip.get_direction = gpio_get_direction;
bank-chip.direction_input = gpio_input;
bank-chip.get = gpio_get;
bank-chip.direction_output = gpio_output;
-- 
1.7.7

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] regulator: tps65910: fix interrupt documentation link

2014-03-10 Thread yegorslists
From: Yegor Yefremov yegorsli...@googlemail.com

Signed-off-by: Yegor Yefremov yegorsli...@googlemail.com
---
 Documentation/devicetree/bindings/mfd/tps65910.txt |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/Documentation/devicetree/bindings/mfd/tps65910.txt 
b/Documentation/devicetree/bindings/mfd/tps65910.txt
index b4bd98a..38833e6 100644
--- a/Documentation/devicetree/bindings/mfd/tps65910.txt
+++ b/Documentation/devicetree/bindings/mfd/tps65910.txt
@@ -11,7 +11,7 @@ Required properties:
 - #interrupt-cells: the number of cells to describe an IRQ, this should be 2.
   The first cell is the IRQ number.
   The second cell is the flags, encoded as the trigger masks from
-  Documentation/devicetree/bindings/interrupts.txt
+  Documentation/devicetree/bindings/interrupt-controller/interrupts.txt
 - regulators: This is the list of child nodes that specify the regulator
   initialization data for defined regulators. Not all regulators for the given
   device need to be present. The definition for each of these nodes is defined
-- 
1.7.7

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] ARM: dts: am335x-evmsk: enable DMA controller for USB

2014-03-10 Thread yegorslists
From: Yegor Yefremov yegorsli...@googlemail.com

Signed-off-by: Yegor Yefremov yegorsli...@googlemail.com
---
 arch/arm/boot/dts/am335x-evmsk.dts |4 
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/arch/arm/boot/dts/am335x-evmsk.dts 
b/arch/arm/boot/dts/am335x-evmsk.dts
index fa19271..ec08f6f 100644
--- a/arch/arm/boot/dts/am335x-evmsk.dts
+++ b/arch/arm/boot/dts/am335x-evmsk.dts
@@ -384,6 +384,10 @@
status = okay;
dr_mode = host;
};
+
+   dma-controller@07402000  {
+   status = okay;
+   };
 };
 
 epwmss2 {
-- 
1.7.7

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] ARM: dts: am335x-evmsk: enable USB1

2014-02-27 Thread yegorslists
From: Yegor Yefremov yegorsli...@googlemail.com

Enable second USB channel and set it into 'host' mode.

Signed-off-by: Yegor Yefremov yegorsli...@googlemail.com
---
 arch/arm/boot/dts/am335x-evmsk.dts |9 +
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/arch/arm/boot/dts/am335x-evmsk.dts 
b/arch/arm/boot/dts/am335x-evmsk.dts
index 486880b..40a66bd 100644
--- a/arch/arm/boot/dts/am335x-evmsk.dts
+++ b/arch/arm/boot/dts/am335x-evmsk.dts
@@ -342,9 +342,18 @@
status = okay;
};
 
+   usb-phy@47401b00 {
+   status = okay;
+   };
+
usb@47401000 {
status = okay;
};
+
+   usb@47401800 {
+   status = okay;
+   dr_mode = host;
+   };
 };
 
 epwmss2 {
-- 
1.7.7

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2] usb: musb: fix clock naming

2013-05-28 Thread yegorslists
From: Yegor Yefremov yegorsli...@googlemail.com

'ick' was changed to 'hsotgusb_ick'
'fck' was changed to 'hsotgusb_fck'

Signed-off-by: Jan Luebbe j...@pengutronix.de
Signed-off-by: Yegor Yefremov yegorsli...@googlemail.com
---
v2: CC linux-usb mailing list

 drivers/usb/musb/am35x.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/musb/am35x.c b/drivers/usb/musb/am35x.c
index 2231850..92b5b23 100644
--- a/drivers/usb/musb/am35x.c
+++ b/drivers/usb/musb/am35x.c
@@ -477,14 +477,14 @@ static int am35x_probe(struct platform_device *pdev)
goto err1;
}
 
-   phy_clk = clk_get(pdev-dev, fck);
+   phy_clk = clk_get(pdev-dev, hsotgusb_ick);
if (IS_ERR(phy_clk)) {
dev_err(pdev-dev, failed to get PHY clock\n);
ret = PTR_ERR(phy_clk);
goto err3;
}
 
-   clk = clk_get(pdev-dev, ick);
+   clk = clk_get(pdev-dev, hsotgusb_fck);
if (IS_ERR(clk)) {
dev_err(pdev-dev, failed to get clock\n);
ret = PTR_ERR(clk);
-- 
1.7.7

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] usb: musb: fix clock naming

2013-05-17 Thread yegorslists
From: Yegor Yefremov yegorsli...@googlemail.com

'ick' was changed to 'hsotgusb_ick'
'fck' was changed to 'hsotgusb_fck'

Signed-off-by: Jan Luebbe j...@pengutronix.de
Signed-off-by: Yegor Yefremov yegorsli...@googlemail.com
---
 drivers/usb/musb/am35x.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/musb/am35x.c b/drivers/usb/musb/am35x.c
index 2231850..92b5b23 100644
--- a/drivers/usb/musb/am35x.c
+++ b/drivers/usb/musb/am35x.c
@@ -477,14 +477,14 @@ static int am35x_probe(struct platform_device *pdev)
goto err1;
}
 
-   phy_clk = clk_get(pdev-dev, fck);
+   phy_clk = clk_get(pdev-dev, hsotgusb_ick);
if (IS_ERR(phy_clk)) {
dev_err(pdev-dev, failed to get PHY clock\n);
ret = PTR_ERR(phy_clk);
goto err3;
}
 
-   clk = clk_get(pdev-dev, ick);
+   clk = clk_get(pdev-dev, hsotgusb_fck);
if (IS_ERR(clk)) {
dev_err(pdev-dev, failed to get clock\n);
ret = PTR_ERR(clk);
-- 
1.7.7

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] broken musb on am35xx

2013-05-17 Thread yegorslists

The ick and fck clock names nave been changed. This patch updates these names. 
Please see this discussion for reference:

https://patchwork.kernel.org/patch/1231671/

Yegor
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2] arm: make FORCE_MAX_ZONEORDER configurable for TI AM33XX

2012-09-25 Thread yegorslists
From: Yegor Yefremov yegorsli...@googlemail.com

FORCE_MAX_ZONEORDER of 12 is needed to allocation more than 4MB
of consistent DMA memory (da8xx frame buffer driver).

Signed-off-by: Dejan Gacnik dejan.gac...@gmail.com
Signed-off-by: Yegor Yefremov yegorsli...@googlemail.com
---
Changes:
v2: fix SA breakage

 arch/arm/Kconfig |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 2f88d8d..b5f242e 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -1766,8 +1766,8 @@ config HW_PERF_EVENTS
 source mm/Kconfig
 
 config FORCE_MAX_ZONEORDER
-   int Maximum zone order if ARCH_SHMOBILE
-   range 11 64 if ARCH_SHMOBILE
+   int Maximum zone order if ARCH_SHMOBILE || SOC_AM33XX
+   range 11 64 if ARCH_SHMOBILE || SOC_AM33XX
default 9 if SA
default 11
help
-- 
1.7.7

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] arm: increase FORCE_MAX_ZONEORDER for TI AM33XX

2012-09-25 Thread yegorslists
From: Yegor Yefremov yegorsli...@googlemail.com

FORCE_MAX_ZONEORDER of 12 is needed to allocation more than 4MB
of consistent DMA memory (da8xx frame buffer driver).

Signed-off-by: Dejan Gacnik dejan.gac...@gmail.com
Signed-off-by: Yegor Yefremov yegorsli...@googlemail.com
---
 arch/arm/Kconfig |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 2f88d8d..06d489e 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -1768,6 +1768,7 @@ source mm/Kconfig
 config FORCE_MAX_ZONEORDER
int Maximum zone order if ARCH_SHMOBILE
range 11 64 if ARCH_SHMOBILE
+   default 12 if SOC_AM33XX
default 9 if SA
default 11
help
-- 
1.7.7

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2] da8xx-fb: add missing FB_BLANK operations

2012-07-06 Thread yegorslists
From: Yegor Yefremov yegorsli...@googlemail.com

add FB_BLANK_NORMAL, FB_BLANK_VSYNC_SUSPEND and FB_BLANK_HSYNC_SUSPEND
modes (copy drivers/video/omap2/omapfb/omapfb-main.c implementation).
Otherwise X-server will complain about invalid parameter.

Signed-off-by: Yegor Yefremov yegorsli...@googlemail.com
---
v2: add linux-fbdev as recipient 

 drivers/video/da8xx-fb.c |3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/drivers/video/da8xx-fb.c b/drivers/video/da8xx-fb.c
index 47118c7..8d745bf 100644
--- a/drivers/video/da8xx-fb.c
+++ b/drivers/video/da8xx-fb.c
@@ -1026,6 +1026,9 @@ static int cfb_blank(int blank, struct fb_info *info)
 
lcd_enable_raster();
break;
+   case FB_BLANK_NORMAL:
+   case FB_BLANK_VSYNC_SUSPEND:
+   case FB_BLANK_HSYNC_SUSPEND:
case FB_BLANK_POWERDOWN:
if (par-panel_power_ctrl)
par-panel_power_ctrl(0);
-- 
1.7.7

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] arm: make FORCE_MAX_ZONEORDER configurable for TI AM33XX

2012-07-03 Thread yegorslists
From: Yegor Yefremov yegorsli...@googlemail.com

FORCE_MAX_ZONEORDER of 12 is needed to allocation more than 4MB
of consistent DMA memory (da8xx frame buffer driver).

Signed-off-by: Dejan Gacnik dejan.gac...@gmail.com
Signed-off-by: Yegor Yefremov yegorsli...@googlemail.com
---
 arch/arm/Kconfig |5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index e876819..ff14c1e 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -1725,8 +1725,9 @@ config HW_PERF_EVENTS
 source mm/Kconfig
 
 config FORCE_MAX_ZONEORDER
-   int Maximum zone order if ARCH_SHMOBILE
-   range 11 64 if ARCH_SHMOBILE
+   int Maximum zone order
+   depends on ARCH_SHMOBILE || SOC_AM33XX
+   range 11 64 if ARCH_SHMOBILE || SOC_AM33XX
default 9 if SA
default 11
help
-- 
1.7.7

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] da8xx-fb: add missing FB_BLANK operations

2012-07-02 Thread yegorslists
From: Yegor Yefremov yegorsli...@googlemail.com

add FB_BLANK_NORMAL, FB_BLANK_VSYNC_SUSPEND and FB_BLANK_HSYNC_SUSPEND
modes (copy drivers/video/omap2/omapfb/omapfb-main.c implementation).
Otherwise X-server will complain about invalid parameter.

Signed-off-by: Yegor Yefremov yegorsli...@googlemail.com
---
 drivers/video/da8xx-fb.c |3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/drivers/video/da8xx-fb.c b/drivers/video/da8xx-fb.c
index 29577bf..9879edc 100644
--- a/drivers/video/da8xx-fb.c
+++ b/drivers/video/da8xx-fb.c
@@ -987,6 +987,9 @@ static int cfb_blank(int blank, struct fb_info *info)
 
lcd_enable_raster();
break;
+   case FB_BLANK_NORMAL:
+   case FB_BLANK_VSYNC_SUSPEND:
+   case FB_BLANK_HSYNC_SUSPEND:
case FB_BLANK_POWERDOWN:
if (par-panel_power_ctrl)
par-panel_power_ctrl(0);
-- 
1.7.7

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2] GPMC: add ECC control definitions

2012-03-08 Thread yegorslists
From: Yegor Yefremov yegorsli...@googlemail.com

Signed-off-by: Yegor Yefremov yegorsli...@googlemail.com
---
v2: READ and WRITE will be configured in the same way, so change the cases 
accordingly
 arch/arm/mach-omap2/gpmc.c |   30 +++---
 1 files changed, 23 insertions(+), 7 deletions(-)

diff --git a/arch/arm/mach-omap2/gpmc.c b/arch/arm/mach-omap2/gpmc.c
index 00d5108..212018d 100644
--- a/arch/arm/mach-omap2/gpmc.c
+++ b/arch/arm/mach-omap2/gpmc.c
@@ -50,6 +50,19 @@
 #define GPMC_ECC_SIZE_CONFIG   0x1fc
 #define GPMC_ECC1_RESULT0x200
 
+/* GPMC ECC control settings */
+#define GPMC_ECC_CTRL_ECCCLEAR 0x100
+#define GPMC_ECC_CTRL_ECCDISABLE   0x000
+#define GPMC_ECC_CTRL_ECCREG1  0x001
+#define GPMC_ECC_CTRL_ECCREG2  0x002
+#define GPMC_ECC_CTRL_ECCREG3  0x003
+#define GPMC_ECC_CTRL_ECCREG4  0x004
+#define GPMC_ECC_CTRL_ECCREG5  0x005
+#define GPMC_ECC_CTRL_ECCREG6  0x006
+#define GPMC_ECC_CTRL_ECCREG7  0x007
+#define GPMC_ECC_CTRL_ECCREG8  0x008
+#define GPMC_ECC_CTRL_ECCREG9  0x009
+
 #define GPMC_CS0_OFFSET0x60
 #define GPMC_CS_SIZE   0x30
 
@@ -861,8 +874,9 @@ int gpmc_enable_hwecc(int cs, int mode, int dev_width, int 
ecc_size)
gpmc_ecc_used = cs;
 
/* clear ecc and enable bits */
-   val = ((0x00018) | 0x0001);
-   gpmc_write_reg(GPMC_ECC_CONTROL, val);
+   gpmc_write_reg(GPMC_ECC_CONTROL,
+   GPMC_ECC_CTRL_ECCCLEAR |
+   GPMC_ECC_CTRL_ECCREG1);
 
/* program ecc and result sizes */
val = ecc_size  1) - 1)  22) | (0x000F));
@@ -870,13 +884,15 @@ int gpmc_enable_hwecc(int cs, int mode, int dev_width, 
int ecc_size)
 
switch (mode) {
case GPMC_ECC_READ:
-   gpmc_write_reg(GPMC_ECC_CONTROL, 0x101);
+   case GPMC_ECC_WRITE:
+   gpmc_write_reg(GPMC_ECC_CONTROL,
+   GPMC_ECC_CTRL_ECCCLEAR |
+   GPMC_ECC_CTRL_ECCREG1);
break;
case GPMC_ECC_READSYN:
-gpmc_write_reg(GPMC_ECC_CONTROL, 0x100);
-   break;
-   case GPMC_ECC_WRITE:
-   gpmc_write_reg(GPMC_ECC_CONTROL, 0x101);
+   gpmc_write_reg(GPMC_ECC_CONTROL,
+   GPMC_ECC_CTRL_ECCCLEAR |
+   GPMC_ECC_CTRL_ECCDISABLE);
break;
default:
printk(KERN_INFO Error: Unrecognized Mode[%d]!\n, mode);
-- 
1.7.7

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] OMAPDSS: add Innolux AT080TN52 display support

2012-02-08 Thread yegorslists
From: Yegor Yefremov yegorsli...@googlemail.com

This patch adds support for Innolux AT080TN52 800x600 panel.
Tested with AM3517 based board.

Signed-off-by: Yegor Yefremov yegorsli...@googlemail.com
---
 drivers/video/omap2/displays/panel-generic-dpi.c |   23 ++
 1 files changed, 23 insertions(+), 0 deletions(-)

diff --git a/drivers/video/omap2/displays/panel-generic-dpi.c 
b/drivers/video/omap2/displays/panel-generic-dpi.c
index 28b9a6d..30fe4df 100644
--- a/drivers/video/omap2/displays/panel-generic-dpi.c
+++ b/drivers/video/omap2/displays/panel-generic-dpi.c
@@ -363,6 +363,29 @@ static struct panel_config generic_dpi_panels[] = {
 
.name   = ortustech_com43h4m10xtc,
},
+
+   /* Innolux AT080TN52 */
+   {
+   {
+   .x_res = 800,
+   .y_res = 600,
+
+   .pixel_clock= 41142,
+
+   .hsw= 20,
+   .hfp= 210,
+   .hbp= 46,
+
+   .vsw= 10,
+   .vfp= 12,
+   .vbp= 23,
+   },
+   .acb= 0x0,
+   .config = OMAP_DSS_LCD_TFT | OMAP_DSS_LCD_IVS |
+ OMAP_DSS_LCD_IHS | OMAP_DSS_LCD_IEO,
+
+   .name   = innolux_at080tn52,
+   },
 };
 
 struct panel_drv_data {
-- 
1.7.1.1

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html