From 04c79cbd5f8f773aa7823feec6e77862e7e6426f Mon Sep 17 00:00:00 2001 From: Dirk Behme Date: Mon, 15 Jul 2013 15:58:27 +0200 Subject: mxc_gpio: Correct the GPIO handling in gpio_direction_output() Setting the direction and an output value should be done by First, set the desired output value. Then, switch to output. If this is done in the inverse order, like at the moment, there can be a glitch on the GPIO line while switching first the old output value and aftwards the new one. Fix this by inverting the order of the direction/set_value calls. Signed-off-by: Dirk Behme Acked-by: Stefano Babic --- drivers/gpio/mxc_gpio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers') diff --git a/drivers/gpio/mxc_gpio.c b/drivers/gpio/mxc_gpio.c index a3880641f0a..1d820d4c3ef 100644 --- a/drivers/gpio/mxc_gpio.c +++ b/drivers/gpio/mxc_gpio.c @@ -143,10 +143,10 @@ int gpio_direction_input(unsigned gpio) int gpio_direction_output(unsigned gpio, int value) { - int ret = mxc_gpio_direction(gpio, MXC_GPIO_DIRECTION_OUT); + int ret = gpio_set_value(gpio, value); if (ret < 0) return ret; - return gpio_set_value(gpio, value); + return mxc_gpio_direction(gpio, MXC_GPIO_DIRECTION_OUT); } -- cgit v1.3.1 From 4acb4d391f005c0c72f7b84041b3884e4260a5a4 Mon Sep 17 00:00:00 2001 From: Eric Nelson Date: Fri, 26 Jul 2013 17:53:45 -0700 Subject: mxc_ipuv3: fix memory alignment of framebuffer The frame-buffer on i.MX boards needs to be aligned for DMA. Signed-off-by: Eric Nelson --- drivers/video/mxc_ipuv3_fb.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'drivers') diff --git a/drivers/video/mxc_ipuv3_fb.c b/drivers/video/mxc_ipuv3_fb.c index ace226cecec..d922d5d099a 100644 --- a/drivers/video/mxc_ipuv3_fb.c +++ b/drivers/video/mxc_ipuv3_fb.c @@ -415,8 +415,9 @@ static int mxcfb_map_video_memory(struct fb_info *fbi) fbi->fix.smem_len = fbi->var.yres_virtual * fbi->fix.line_length; } - - fbi->screen_base = (char *)malloc(fbi->fix.smem_len); + fbi->fix.smem_len = roundup(fbi->fix.smem_len, ARCH_DMA_MINALIGN); + fbi->screen_base = (char *)memalign(ARCH_DMA_MINALIGN, + fbi->fix.smem_len); fbi->fix.smem_start = (unsigned long)fbi->screen_base; if (fbi->screen_base == 0) { puts("Unable to allocate framebuffer memory\n"); -- cgit v1.3.1