gpio: make gpiod_direction_output take a logical value

The documentation was not clear about whether
gpio_direction_output should take a logical value or the physical
level on the output line, i.e. whether the ACTIVE_LOW status
would be taken into account.

This converts gpiod_direction_output to use the logical level
and adds a new gpiod_direction_output_raw for the raw value.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Reviewed-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>

This backports commit ef70bbe1aaa612f75360e5df5952fddec50b7ca9 from
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
i2c: pca954x: Use the descriptor-based GPIO API

The ID-based GPIO API pushes handling of GPIO polarity to drivers.
Simplify the driver by switching to the descriptor-based GPIO API.

This also fixes a mismatch between the pca954x DT bindings that document
a "reset-gpios" property and the driver that requests a "reset-gpio"
property.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
i2c: pca954x: Fix compilation without CONFIG_GPIOLIB

The pca954x driver recently switched to the GPIO descriptor API without
including the correct <linux/gpio/consumer.h> header. This breaks
compilation without CONFIG_GPIOLIB.

drivers/i2c/muxes/i2c-mux-pca954x.c: In function ‘pca954x_probe’:
drivers/i2c/muxes/i2c-mux-pca954x.c:204:2: error: implicit declaration
of function ‘devm_gpiod_get’ [-Werror=implicit-function-declaration]
  gpio = devm_gpiod_get(&client->dev, "reset");
  ^
drivers/i2c/muxes/i2c-mux-pca954x.c:204:7: warning: assignment makes
pointer from integer without a cast [enabled by default]
  gpio = devm_gpiod_get(&client->dev, "reset");
       ^
drivers/i2c/muxes/i2c-mux-pca954x.c:206:3: error: implicit declaration
of function ‘gpiod_direction_output’
[-Werror=implicit-function-declaration]
   gpiod_direction_output(gpio, 0);
   ^
cc1: some warnings being treated as errors
make[3]: *** [drivers/i2c/muxes/i2c-mux-pca954x.o] Error 1

Fix it by including the right header.

Reported-by: Jim Davis <jim.epost@gmail.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Jean Delvare <jdelvare@suse.de>
Reviewed-by: Jingoo Han <jg1.han@samsung.com>
drm: adv7511: Add regcache_mark_dirty() in probe()

Mark the register cache as dirty in probe(), otherwise the regcache doesn't
get synced properly in adv7511_encoder_dpms(). This results in some issue,
such as output format mismatch between adv7511 and some monitor.

Signed-off-by: Hyun Kwon <hyunk@xilinx.com>
Revert "media: xilinx: dma: Workaround for bytesperline"

This reverts commit b4859c939e1febb638e23accc1c3a66b72e10ccc.
Zynq Base TRD LogiCVC DRM integration requires programming
bytesperline field i.e stride is not same as width.
So we need to get rid of this workaround and send mplayer
fix to its mailing list.

Signed-off-by: Radhey Shyam Pandey <radheys@xilinx.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
media: xilinx: Added DMA error handling

Validate dma tx descriptor returned from
dmaengine_prep_slave_single() and reports
error if any.
Next dequeue operation fails with -ENODEV

Signed-off-by: Radhey Shyam Pandey <radheys@xilinx.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
media: xilinx: Fix error handling

Fix error handling in xvip_graph_dma_init()
Avoid multiple free of vb2 dma context

Signed-off-by: Radhey Shyam Pandey <radheys@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
media: xilinx: Reordered mutexes initialization

Moved mutexes initialization up and modified error handling
for media_entity_init.

Signed-off-by: Radhey Shyam Pandey <radheys@xilinx.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
media: xilinx: Set format description in enum_fmt

Add a description field to the xvip_video_format structure and use it to
fill the format description during format enumeration.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
media: xilinx: vipp: Add devicetree bindings documentation

Add devicetree bindings documentation for the Xilinx Video IP pipeline driver.

Signed-off-by: Hyun Kwon <hyunk@xilinx.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
[HACK] media: xilinx: Apply TPG reset on stop.

Added hack to apply TPG reset on
pipeline stop.
In current setup both vdma and TPG
are resetted. Since vdma is synced
with SOF of TPG ideally we shouldnt
need a reset.
It needs to be fixed!

Signed-off-by: Radhey Shyam Pandey <radheys@xilinx.com>
[HACK] media: xilinx: Fix VTC timing for 1080p.

Temporary fix for programming VTC timing
generator.
TODO:
Need to explore if we can extract kernel
timing info and program it generically for
the other resolutions.

Signed-off-by: Radhey Shyam Pandey <radheys@xilinx.com>
v4l: xilinx: Add HLS core driver

Follow Up Flag: Follow up
Flag Status: Flagged

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
[HACK] v4l: xilinx: Program HLS filter coefficients.

Program filter coefficients for now till
we get v4l2 user plugin implemented.

Signed-off-by: Radhey Shyam Pandey <radheys@xilinx.com>
zynq: config: add vdf defconfig

enable sobel driver
zynq: dt: add devicetrees for base trd and vdf designs