summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/i2c
AgeCommit message (Collapse)Author
2015-10-15Merge branch 'drm-tda998x-devel' of ↵Dave Airlie
git://ftp.arm.linux.org.uk/~rmk/linux-arm into drm-next * removes the now unused DRM slave encoder support, which all users have migrated away from, allowing us to simplify the code. * ensure all pending interrupts are processed together, rather than needing the handler to be re-entered each time. * use more HDMI helpers to setup the info frames. * fix EDID read handling by ensuring that we always wait the specified time before attempting to read the EDID, no matter where the EDID read request came from. * 'drm-tda998x-devel' of git://ftp.arm.linux.org.uk/~rmk/linux-arm: drm/i2c: tda998x: clean up after struct tda998x_priv2 removal drm/i2c: tda998x: kill struct tda998x_priv2 drm/i2c: tda998x: move connector into struct tda998x_priv drm/i2c: tda998x: remove encoder pointer drm/i2c: tda998x: remove DRM slave encoder support drm/i2c: tda998x: use more HDMI helpers drm/i2c: tda998x: handle all outstanding interrupts drm/i2c: tda998x: convert to u8/u16/u32 types drm/i2c: tda998x: re-implement "Fix EDID read timeout on HDMI connect" drm/i2c: tda998x: report whether we actually handled the IRQ drm/i2c: tda998x: remove useless NULL checks
2015-09-29drm/i2c: tda998x: clean up after struct tda998x_priv2 removalRussell King
We can now kill a number of glue functions which were sitting between the common tda998x code and the drm encoder/connector methods. This results in slightly cleaner code. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2015-09-29drm/i2c: tda998x: kill struct tda998x_priv2Russell King
Kill the redundant tda998x_priv2 structure now that its only member is the struct tda998x_priv. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2015-09-29drm/i2c: tda998x: move connector into struct tda998x_privRussell King
Move the DRM connector structure into struct tda998x_priv from the old struct tda998x_priv2. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2015-09-29drm/i2c: tda998x: remove encoder pointerRussell King
Remove the encoder pointer from struct tda998x_priv, moving the encoder itself from struct tda998x_priv2 here. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2015-09-29drm/i2c: tda998x: remove DRM slave encoder supportRussell King
Remove the DRM slave encoder compatibility from the TDA998x driver. We now use the component helpers to manage the binding of DRM sub-drivers. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2015-09-24Merge tag 'v4.3-rc2' into topic/drm-miscDaniel Vetter
Backmerge Linux 4.3-rc2 because of conflicts in the dp helper code between bugfixes and new code. Just adjacent lines really. On top of that there's a silent conflict in the new fsl-dcu driver merged into 4.3 and commit 844f9111f6f54f88eb2f0fac121b82ce77193866 Author: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Date: Wed Sep 2 10:42:40 2015 +0200 drm/atomic: Make prepare_fb/cleanup_fb only take state, v3. which Thierry Reding spotted and provided a fixup for. Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2015-09-15drm/i2c: tda998x: use more HDMI helpersRussell King
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2015-09-15drm/i2c: tda998x: handle all outstanding interruptsRussell King
As reading the interrupt registers clears the outstanding interrupts, we must process all received interrupts to avoid dropping any. Rearrange the code to achieve this, and properly check for a HPD interrupt from the CEC_RXSHPDINT register. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2015-09-15drm/i2c: tda998x: convert to u8/u16/u32 typesRussell King
C99 types are against the style of the Linux kernel. Convert to using Linus-friendly types. See https://lwn.net/Articles/113367/ for more information. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2015-09-15drm/i2c: tda998x: re-implement "Fix EDID read timeout on HDMI connect"Russell King
Commit 6833d26ef823 ("drm: tda998x: Fix EDID read timeout on HDMI connect") used a weak scheme to try and delay reading EDID on a HDMI connect event. It is weak because delaying the notification of a hotplug event does not stop userspace from trying to read the EDID within the 100ms delay. The solution provided here solves this issue: * When a HDMI connection event is detected, mark a blocking flag for EDID reads, and start a timer for the delay. * If an EDID read is attempted, and the blocking flag is set, wait for the blocking flag to clear. * When the timer expires, clear the blocking flag and wake any thread waiting for the EDID read. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2015-09-15drm/i2c: tda998x: report whether we actually handled the IRQRussell King
Rather than always reporting that the interrupt was handled, we should report whether we did handle the interrupt. Arrange to report IRQ_NONE for cases where we found nothing to do. This allows us to (eventually) recover from stuck-IRQ problems, rather than causing the kernel to solidly lock up. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2015-09-15drm/i2c: tda998x: remove useless NULL checksRussell King
There is no way 'priv' can be NULL in tda998x_irq_thread() - this can only happen if request_threaded_irq() was passed a NULL priv pointer, and we would have crashed long before then if that was the case. We also always ensure that priv->encoder is correctly setup, which must have been initialised prior to the interrupt being claimed, so we can remove this check as well. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2015-09-08drm/i2c/ch7006: Constify ch7006_tv_norms[] and ch7006_modes[]Ville Syrjälä
drivers/gpu/drm/i2c/ch7006.ko: -.text 5913 +.text 5897 -.rodata 664 +.rodata 7256 -.data 6992 +.data 416 Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-09-08drm: Constify TV mode namesVille Syrjälä
Make the mode names passed to drm_mode_create_tv_properties() const. drivers/gpu/drm/i2c/ch7006.ko: -.rodata 596 +.rodata 664 -.data 7064 +.data 6992 drivers/gpu/drm/nouveau/nouveau.ko: -.rodata 146808 +.rodata 146904 -.data 178624 +.data 178528 Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-08-30Merge remote-tracking branches 'asoc/topic/rcar', 'asoc/topic/reg-default', ↵Mark Brown
'asoc/topic/rl6231', 'asoc/topic/rockchip' and 'asoc/topic/rt286' into asoc-next
2015-08-07Merge branch 'drm-tda998x-fixes' of git://ftp.arm.linux.org.uk/~rmk/linux-armLinus Torvalds
Pull TDA998x i2c driver fixes from Russell King: "This fixes the double-checksumming of the AVI infoframe which was resulting in the checksum always being zero. It went unnoticed as none of my HDMI devices had a problem with this" [ Pulling directly from rmk since Dave Airlie is on vacation - Linus ] * 'drm-tda998x-fixes' of git://ftp.arm.linux.org.uk/~rmk/linux-arm: drm/i2c: tda998x: fix bad checksum of the HDMI AVI infoframe
2015-08-05drm/i2c: tda998x: fix bad checksum of the HDMI AVI infoframeJean-Francois Moine
The commit 8c7a075da9f7980cc95ffcd7e6621d4a87f20f40 "drm/i2c: tda998x: use drm_hdmi_avi_infoframe_from_display_mode()" also uses hdmi_avi_infoframe_pack() to create the AVI infoframe. This function sets the checksum of the frame and this breaks the second calculation of the checksum done in tda998x_write_if(). Fixes: 8c7a075da9f7980c ("drm/i2c: tda998x: use drm_hdmi_avi_infoframe_from_display_mode()") Signed-off-by: Jean-Francois Moine <moinejf@free.fr> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2015-07-16regmap: Use reg_sequence for multi_reg_write / register_patchNariman Poushin
Separate the functionality using sequences of register writes from the functions that take register defaults. This change renames the arguments in order to support the extension of reg_sequence to take an optional delay to be applied after any given register in a sequence is written. This avoids adding an int to all register defaults, which could substantially increase memory usage for regmaps with large default tables. This also updates all the clients of multi_reg_write/register_patch. Signed-off-by: Nariman Poushin <nariman@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-05-29Merge branch 'drm-tda998x-devel' of ↵Dave Airlie
git://ftp.arm.linux.org.uk/~rmk/linux-arm into drm-next warning fix for tda998x * 'drm-tda998x-devel' of git://ftp.arm.linux.org.uk/~rmk/linux-arm: drm/i2c: tda998x: fix compiler warning for ssize_t
2015-05-25drm: adv7511: Fix crash in IRQ handler when no encoder is associatedLaurent Pinchart
The ADV7511 is probed before its slave encoder init function associates it with an encoder. This creates a time window during which hot plug detection interrupts can occur with an encoder, resulting in a crash in the IRQ handler. Fix this by ignoring hot plug detection IRQs when no encoder is associated yet. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Acked-by: Lars-Peter Clausen <lars@metafoo.de>
2015-05-20drm/i2c: tda998x: fix compiler warning for ssize_tRussell King
Stephen Rothwell reports that he sees a compiler warning on x86_64: drivers/gpu/drm/i2c/tda998x_drv.c: In function 'tda998x_write_avi': drivers/gpu/drm/i2c/tda998x_drv.c:647:3: warning: format '%d' expects argument of type 'int', but argument 3 has type 'ssize_t' [-Wformat=] dev_err(&priv->hdmi->dev, "hdmi_avi_infoframe_pack() failed: %d\n", len); ^ Fix this by using the appropriate length modifier. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2015-05-15Merge branch 'drm-tda998x-devel' of ↵Dave Airlie
git://ftp.arm.linux.org.uk/~rmk/linux-arm into drm-next tda998x: use helpers for infoframe. * 'drm-tda998x-devel' of git://ftp.arm.linux.org.uk/~rmk/linux-arm: drm/i2c: tda998x: use drm_hdmi_avi_infoframe_from_display_mode()
2015-03-30drm/i2c: tda998x: use drm_hdmi_avi_infoframe_from_display_mode()Russell King
Make use of the DRM HDMI AVI infoframe helper to construct the AVI infoframe, rather than coding this up ourselves. This allows DRM to supply proper aspect ratio information derived from the DRM display mode structure. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2015-03-19drm: adv7511: Refactor power managementLaurent Pinchart
Remove the internal dependency on DPMS mode for power management by using a by a powered state boolean instead, and use the new power off handler at probe time. This ensure that the regmap cache is properly marked as dirty when the device is probed, and the registers properly synced during the first power up. As a side effect this removes the initialization of current_edid_segment at probe time, as the field will be initialized when the device is powered on, at the latest right before reading EDID data. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Tested-by: Christian Kohn <christian.kohn@xilinx.com> Tested-by: Lars-Peter Clausen <lars@metafoo.de> Acked-by: Lars-Peter Clausen <lars@metafoo.de>
2015-03-19drm: adv7511: Fix nested sleep when reading EDIDLaurent Pinchart
The EDID read code waits for the read completion interrupt to occur using wait_event_interruptible(). The condition passed to the macro reads I2C registers. This results in sleeping with the task state set to TASK_INTERRUPTIBLE, triggering a WARN_ON() introduced in commit 8eb23b9f35aae ("sched: Debug nested sleeps"). Fix this by reworking the EDID read code. Instead of checking whether the read is complete through I2C reads, handle the interrupt registers in the interrupt handler and update a new edid_read flag accordingly. As a side effect both the IRQ and polling code paths now process the interrupt sources through the same code path, simplifying the code. Cc: stable@vger.kernel.org Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
2015-03-19drm: adv7511: Fix DDC error interrupt handlingLaurent Pinchart
The DDC error interrupt bit is located in REG_INT1, not REG_INT0. Update both the interrupt wait code and the interrupt sources reset code accordingly. Cc: stable@vger.kernel.org Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
2015-03-10drm: Fix trivial typos in commentsYannick Guerrini
Change 'pixes' to 'pixels' Change 'enabel' to 'enable' Change 'enabeling' to 'enabling' Signed-off-by: Yannick Guerrini <yguerrini@tomshardware.fr> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-03-05Merge branch 'drm-tda998x-devel' of ↵Dave Airlie
git://ftp.arm.linux.org.uk/~rmk/linux-arm into drm-next A number of TDA998x updates for the next merge window. Patches included in this set are: * adding support for finding the attached CRTCs from DT * a fix function name mis-spelling in a dev_err() * simplify the EDID reading by using the drm_do_get_edid() function instead of coding this ourselves. * 'drm-tda998x-devel' of git://ftp.arm.linux.org.uk/~rmk/linux-arm: drm/i2c: tda998x: use drm_do_get_edid() drm/i2c: tda998x: fix misspelling of current function in string drm/i2c: tda998x: add OF support for finding attached CRTCs
2015-01-29Merge branch 'master' of ↵Dave Airlie
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux into drm-next This backmerges drm-fixes into drm-next mainly for the amdkfd stuff, I'm not 100% confident, but it builds and the amdkfd folks can fix anything up. Signed-off-by: Dave Airlie <airlied@redhat.com> Conflicts: drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.h
2015-01-27Merge branch 'drm-tda998x-fixes' of ↵Dave Airlie
git://ftp.arm.linux.org.uk/~rmk/linux-arm into drm-fixes 3 fixes for the tda998x. * 'drm-tda998x-fixes' of git://ftp.arm.linux.org.uk/~rmk/linux-arm: drm/i2c: tda998x: set the CEC I2C address based on the slave I2C address drm: tda998x: Fix EDID read timeout on HDMI connect drm: tda998x: Protect the page register
2015-01-21drm/i2c: tda998x: use drm_do_get_edid()Laurent Pinchart
Replace the internal EDID read implementation by a call to the new EDID read core function. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Reviewed-by: Rob Clark <robdclark@gmail.com> Tested-by: Jean-Francois Moine <moinejf@free.fr> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2015-01-21drm/i2c: tda998x: fix misspelling of current function in stringJulia Lawall
Replace a misspelled function name by %s and then __func__. This was done using Coccinelle, including the use of Levenshtein distance, as proposed by Rasmus Villemoes. Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2015-01-21drm/i2c: tda998x: set the CEC I2C address based on the slave I2C addressAndrew Jackson
The I2C address for the TDA9989 and TDA19989 is fixed at 0x34 but the two LSBs of the TDA19988's address are set by two configuration pins on the chip. Irrespective of the chip, the associated CEC peripheral's I2C address is based upon the main I2C address. This patch avoids any special handling required to support systems that contain multiple TDA19988 devices on the same I2C bus. Signed-off-by: Andrew Jackson <Andrew.Jackson@arm.com> Signed-off-by: Liviu Dudau <Liviu.Dudau@arm.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2015-01-16drm/i2c: tda998x: add OF support for finding attached CRTCsRussell King
Add support to find the attached CRTCs via OF using the newly introduced helper. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2014-12-23drm: adv7511: Remove interlaced mode checkLaurent Pinchart
The ADV7511 supports interlaced modes fine, there's no need to reject them. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
2014-12-01drm: tda998x: Fix EDID read timeout on HDMI connectJean-Francois Moine
When the HDMI cable is disconnected and reconnected, EDID reading is called too early raising a EDID read timeout. This patch uses the system work queue to delay the notification of the HDMI connect/disconnect event. Signed-off-by: Jean-Francois Moine <moinejf@free.fr> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2014-12-01drm: tda998x: Protect the page registerJean-Francois Moine
As the HDMI registers of the TDA998x chips are accessed by pages, the page register must be protected. Signed-off-by: Jean-Francois Moine <moinejf@free.fr> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2014-11-26drm: Add adv7511 encoder driverLars-Peter Clausen
This patch adds a driver for the Analog Devices adv7511. The adv7511 is a standalone HDMI transmitter chip. It features a HDMI output interface on one end and video and audio input interfaces on the other. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
2014-08-05drm/tda998x: update for new drm connector APIs.Dave Airlie
Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-08-05Merge branch 'tda998x-devel' of git://ftp.arm.linux.org.uk/~rmk/linux-cubox ↵Dave Airlie
into drm-next This builds upon the previous set of fixes which were pulled on 6th July. Included in this set are: - an update from Jean-Francois to add the missing reg documentation entry to the device tree documentation. - conversion of the tda998x driver to the component helpers. * 'tda998x-devel' of git://ftp.arm.linux.org.uk/~rmk/linux-cubox: drm/i2c: tda998x: add component support drm/i2c: tda998x: allow re-use of tda998x support code drm/i2c: tda998x: fix lack of required reg in DT documentation Conflicts: drivers/gpu/drm/i2c/tda998x_drv.c
2014-08-01drm/i2c: tda998x: add component supportRussell King
Add component helper support to the tda998x driver. This permits the TDA998x to be declared as a separate device in device tree, and bound at the appropriate moment with a co-operating card driver. The existing slave_encoder interfaces are kept while there are existing users of it in order to prevent regressions. Tested-by: Darren Etheridge <detheridge@ti.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2014-08-01drm/i2c: tda998x: allow re-use of tda998x support codeRussell King
Re-jig the TDA998x code so that we separate the functionality from the drm slave encoder implementation. In several places, this is pretty clearly the correct thing to do, because we can avoid repetitively having to convert from the drm_encoder to the TDA998x private structure, particularly with the driver internal functions. The main motivation behind this change is to allow the code to be re-used with a standard drm_encoder and drm_connector implementation based on the component helpers, rather than the slave_encoder system. The addition of this will be in the following patch. We keep the slave_encoder interface as there are existing users of this; we need to give them time to convert and test. Tested-by: Darren Etheridge <detheridge@ti.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2014-07-22drm/i2c: tda998x: Remove useless testJean-Francois Moine
In tda998x_encoder_destroy(), priv->cec is never NULL, so, remove its test. Signed-off-by: Jean-Francois Moine <moinejf@free.fr> Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-07-06Merge branch 'tda998x-fixes' of git://ftp.arm.linux.org.uk/~rmk/linux-cuboxDave Airlie
mode fixes for tda998x. * 'tda998x-fixes' of git://ftp.arm.linux.org.uk/~rmk/linux-cubox: drm/i2c: tda998x: add some basic mode validation drm/i2c: tda998x: faster polling for edid drm/i2c: tda998x: move drm_i2c_encoder_destroy call
2014-06-26drm/i2c: tda998x: add some basic mode validationRussell King
The TDA998x can't handle modes with clocks above 150MHz, or resolutions larger than 8192x2048. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2014-06-26drm/i2c: tda998x: faster polling for edidRussell King
One of Jean-Francois patches changed the EDID polling to once every 10ms for 10 interations, whereas the original code did 1ms for 100 interations. This appears to cause boot-time detection to take noticably longer. Revert this change. Acked-by: Jean-Francois Moine <moinejf@free.fr> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2014-06-26drm/i2c: tda998x: move drm_i2c_encoder_destroy callGuido Martínez
Currently tda998x_encoder_destroy() calls cec_write() and reg_clear(), as part of the release procedure. Such calls need to access the I2C bus and therefore, we need to call them before drm_i2c_encoder_destroy() which unregisters the I2C device. This commit moves the latter so it's done afterwards. Signed-off-by: Guido Martínez <guido@vanguardiasur.com.ar> Signed-off-by: Ezequiel García <ezequiel@vanguardiasur.com.ar> Cc: <stable@vger.kernel.org> #v3.9+ Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2014-04-22drm/i2c/tda998x: Fix signed overflow issueDaniel Vetter
This is C standard hair-splitting, but afaict - sum will be promoted to signed int in computation since uint8_t fits - signed overflow is undefined. No we need to add up an awful lot of bytes to actually make it overflow. But I guess the real risk is gcc spotting this and going bananas. Fix this by simply using unsigned in to force all computations to use the well-defined unsigned behaviour. Spotted by coverity. v2: Simplify the entire computation as suggested by Jean. Cc: Russell King <rmk+kernel@arm.linux.org.uk> Cc: Rob Clark <robdclark@gmail.com> Cc: Jean-Francois Moine <moinejf@free.fr> Reviewed-by: David Herrmann <dh.herrmann@gmail.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-02-14drm/i2c: tda998x: always use the same device for all kernel messagesRussell King
Rather than using a mixture of the parent DRM device and the component device for messages from the driver, consistently use the component device for all messages. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>