spi: zynq-qspi: Dont write more than requested bytes to rxbuf

In case of dual parallel odd byte transfer, write even bytes and
read bytes accordingly but write only the requested number of bytes to rxbuf.
Otherwise any user data adjacent to rxbuf might be corrupted.
Improve related comments.

Signed-off-by: Harini Katakam <harinik@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
drm: adv7511: Fix use after free

We need to use the free the old edid buffer not the new one.

Reported-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
DRM: adv7511: Properly initialize dpms_mode and status

Set dpms_mode to DRM_MODE_DPMS_OFF and status to connector_status_disconnected
to make sure that they match the state of the chip. This fixes an issue where
the monitor was incorrectly reported as disconnected during cold boot.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
DRM: adv7511: Avoid uneccessary disconnected events

Only insert a delayed disconnected event when we transition from connected to
connect. If we transition from disconnected to connected there is no need for
this since the system will already assume that the monitor was disconnected.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
drm: adv7511: Add the rgb format flag to adv7511_link_config

Add the rgb format boolean flag to struct adv7511_link_config. This was in
the drm encoder driver, but having it in the adv7511 driver would remove
direct dependency. The flag is copied to the struct adv7511 to be used for
the transmitter configuration.

Signed-off-by: Hyun Kwon <hyunk@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
drm: adv7511: Configure adv7511 with default values

This patch adds adv7511_set_default_config() which configures adv7511 device
with default values. This configuration can be overwritten with custom values
when client driver calls adv7511_set_config() explicitly.

Signed-off-by: Hyun Kwon <hyunk@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
drm: xilinx: encoder: Remove dependency on adv7511

The previous adv7511 patch moves the dependency code to inside the adv7511
driver. This makes the xilinx encoder more generic to have other encoders.
Do not call encoder_sfuncs->set_config() when a mode is set, as the adv7511
driver handles it internally.

Signed-off-by: Hyun Kwon <hyunk@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
drm: adv7511: Add adv7511_encoder_mode_valid() function

Add adv7511_encoder_mode_valid() function. This valid check code was
implemented in the drm connector driver, but this check should be done in
the adv7511 driver.

Signed-off-by: Hyun Kwon <hyunk@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
drm: xilinx: connector: Call the encoder slave's mode_valid() function

Call the mode valid function of the encoder slave, and let the encoder
slave driver check validity of given mode.

Signed-off-by: Hyun Kwon <hyunk@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
drm: xylon: connector: Call the encoder slave's mode_valid() function

Call the mode valid function of the necoder slave, and let the encoder
slave driver check validity of given mode.

Signed-off-by: Hyun Kwon <hyunk@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
drm: platform encoder driver support

Add struct drm_platform_encoder_driver. This structure can be used for
the encoder slave drivers on a platform bus. The i2c specific assumption
better be removed, and other drm encoder slave interfaces would be updated
to be more generic.

Signed-off-by: Hyun Kwon <hyunk@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
drm: xilinx: encoder: Change the name 'i2c_slave' to 'i2c_slv'

This is needed to improve consistency of naming when 'platform_slv' will
be added, as the name is long.

Signed-off-by: Hyun Kwon <hyunk@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
drm: xilinx: encoder: Support encoder slaves on a platform bus

The Xilinx display pipeline can have encoder slaves on a platform bus,
so encoder slaves on a platform bus support is added in addition to
i2c encoder slaves.

Signed-off-by: Hyun Kwon <hyunk@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
drm: xilinx: encoder: Initialize the drm encoder before the encoder slave

drm_encoder_init() and drm_encoder_helper_add() need to be called before
initializing the encoder slave. The encoder slave can generate interrupts
right after initalization, which may result in error from not initialized
drm device.

Signed-off-by: Hyun Kwon <hyunk@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
drm: xilinx: Add the 'xlnx' prefix to dt properties

Add the 'xlnx' prefix to Xilinx IP core specific properties.

Signed-off-by: Hyun Kwon <hyunk@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Documentation: devicetree: bindings: drm: xilinx: Add 'xlnx' prefix

Add 'xlnx' prefix to Xilinx IP core specific properties.

Signed-off-by: Hyun Kwon <hyunk@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
drm: xilinx: connector: Configure the type from DT property

The connector can be either HDMI or DisplayPort depending on which encoder
slave is used. Add the struct xilinx_drm_connector_type to have supported
connector types, and decide the type based on DT.

Signed-off-by: Hyun Kwon <hyunk@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Documentation: devicetree: bindings: drm: xilinx: Add the connector type

Add the connector type property in the node. User can specify the type of
connector to use, and the value is used to initialize the drm connector in
the connector driver.

Signed-off-by: Hyun Kwon <hyunk@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
drm: xilinx: drv: Remove explicit call of destroy functions

drm_mode_config_cleanup() clean up drm objects, so no need to call destroy
functions in the error exit.

Signed-off-by: Hyun Kwon <hyunk@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
drm: xilinx: drv: Fix the format descriptor

Fix the Xilinx RGB format to be 24 bit RGB format, and add one more descriptor
for XRGB format with 24 bit depth and 32 bit pixel.

Signed-off-by: Hyun Kwon <hyunk@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>