aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i2c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2015-03-19drm: adv7511: Refactor power managementLaurent Pinchart1-48/+53
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 Pinchart1-50/+46
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 Pinchart1-4/+10
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 Guerrini1-1/+1
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 git://ftp.arm.linux.org.uk/~rmk/linux-arm into drm-nextDave Airlie1-70/+31
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 git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux into drm-nextDave Airlie1-10/+42
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 git://ftp.arm.linux.org.uk/~rmk/linux-arm into drm-fixesDave Airlie1-10/+42
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 Pinchart1-68/+18
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 Lawall1-1/+1
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 Jackson1-1/+4
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 King1-1/+12
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 Pinchart1-3/+0
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 Moine1-4/+18
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 Moine1-5/+20
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 Clausen4-0/+1307
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 Airlie1-2/+2
Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-08-05Merge branch 'tda998x-devel' of git://ftp.arm.linux.org.uk/~rmk/linux-cubox into drm-nextDave Airlie1-81/+306
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 King1-14/+198
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 King1-69/+110
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 Moine1-2/+1
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 Airlie1-3/+9
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 King1-0/+6
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 King1-2/+2
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ínez1-1/+1
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 Vetter1-3/+3
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 King1-5/+5
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>
2014-02-13drm/i2c: tda998x: adjust the audio clock divider for S/PDIFJean-Francois Moine1-3/+7
According to some tests on the Cubox (Marvell Armada 510 + TDA19988), the S/PDIF input asks for a greater audio clock divider. Tested-by: Russell King <rmk+kernel@arm.linux.org.uk> Acked-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: Jean-Francois Moine <moinejf@free.fr> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2014-02-13drm/i2c: tda998x: code optimizationJean-Francois Moine1-8/+4
This patch reduces the number of I2C exchanges by setting many bits in one write and removing a useless write. Tested-by: Russell King <rmk+kernel@arm.linux.org.uk> Acked-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: Jean-Francois Moine <moinejf@free.fr> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2014-02-13drm/i2c: tda998x: remove the unused variable ca_i2sJean-Francois Moine1-3/+1
ca_i2s is only ever written to, but never read, so let's get rid of it. Tested-by: Russell King <rmk+kernel@arm.linux.org.uk> Acked-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: Jean-Francois Moine <moinejf@free.fr> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2014-02-13drm/i2c: tda998x: make the audio code more readableJean-Francois Moine1-12/+13
This patch adds a definition of the values of the MUX_AP register and simplifies the macro's defining the fields of the AIP_CLKSEL register. This makes the format specific audio init sequence more readable. Tested-by: Russell King <rmk+kernel@arm.linux.org.uk> Acked-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: Jean-Francois Moine <moinejf@free.fr> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2014-02-13drm/i2c: tda998x: use irq for connection status and EDID readJean-Francois Moine1-9/+105
This patch adds the optional treatment of the tda998x IRQ. The interrupt function is used to know the display connection status without polling and to speedup reading the EDID. The IRQ number and trigger type are defined in the i2c client either by platform data or in the DT. Tested-by: Russell King <rmk+kernel@arm.linux.org.uk> Acked-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: Jean-Francois Moine <moinejf@free.fr> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2014-02-13drm/i2c: tda998x: always enable EDID read IRQJean-Francois Moine1-5/+3
There is no need to enable/disable EDID read IRQ at each EDID block read. This patch enables the IRQ at init time. Tested-by: Russell King <rmk+kernel@arm.linux.org.uk> Acked-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: Jean-Francois Moine <moinejf@free.fr> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2014-02-13drm/i2c: tda998x: add DT supportJean-Francois Moine1-0/+22
This patch adds DT support to the tda998x. Tested-by: Russell King <rmk+kernel@arm.linux.org.uk> Acked-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: Jean-Francois Moine <moinejf@free.fr> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2014-02-13drm/i2c: tda998x: don't read write-only registersJean-Francois Moine1-22/+24
This patch takes care of the write-only registers of the tda998x. The registers SOFTRESET, TBG_CNTRL_0 and TBG_CNTRL_1 have all bits cleared after reset, so, they may be fully re-written. The register MAT_CONTRL is set to MAT_CONTRL_MAT_BP | MAT_CONTRL_MAT_SC(1) after reset, so, it may be fully set again to this value. Tested-by: Russell King <rmk+kernel@arm.linux.org.uk> Acked-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: Jean-Francois Moine <moinejf@free.fr> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2014-02-13drm/i2c: tda998x: don't freeze the system at audio startup timeJean-Francois Moine1-1/+1
This patch prevents the system to be freezed at audio startup time, replacing mdelay by msleep. Tested-by: Russell King <rmk+kernel@arm.linux.org.uk> Acked-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: Jean-Francois Moine <moinejf@free.fr> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2014-02-13drm/i2c: tda998x: change probe message originJean-Francois Moine1-5/+14
On probe, a message giving the TDA chip version seems to come from the DRM driver: armada-drm armada-510-drm: found TDA19988 This patch changes the originator of the message to the TDA driver: tda998x 0-0070: found TDA19988 Tested-by: Russell King <rmk+kernel@arm.linux.org.uk> Acked-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: Jean-Francois Moine <moinejf@free.fr> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2014-02-13drm/i2c: tda998x: code cleanupJean-Francois Moine1-6/+7
This patch: - replaces ARRAY_SIZE() by sizeof() when a number of bytes is needed, - adds a linefeed in an error message and - removes an useless variable setting. Tested-by: Russell King <rmk+kernel@arm.linux.org.uk> Acked-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: Jean-Francois Moine <moinejf@free.fr> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2014-02-13drm/i2c: tda998x: clean up error chip version checkingRussell King1-5/+8
This is a nicer way, and results in proper return codes should the read of the MSB version register fail. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2014-02-13drm/i2c: tda998x: check more I/O errorsJean-Francois Moine1-14/+43
This patch adds more error checking inn I2C I/O functions. In case of I/O error, this permits to avoid writing in bad controller pages, a bad chipset detection or looping when getting the EDID. Tested-by: Russell King <rmk+kernel@arm.linux.org.uk> Acked-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: Jean-Francois Moine <moinejf@free.fr> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2014-02-13drm/i2c: tda998x: simplify the i2c read/write functionsJean-Francois Moine1-160/+162
This patch simplifies the i2c read/write functions and permits them to be easily called in more contexts. Tested-by: Russell King <rmk+kernel@arm.linux.org.uk> Acked-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: Jean-Francois Moine <moinejf@free.fr> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2014-02-13drm/i2c: tda998x: use ALSA IEC958 definitions and update audio frequencyJean-Francois Moine1-3/+5
This patch sets the frequency as 'not indicated' instead of '48kHz' and uses the asound values in the channel status definition. Tested-by: Russell King <rmk+kernel@arm.linux.org.uk> Acked-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: Jean-Francois Moine <moinejf@free.fr> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2014-02-13drm/i2c: tda998x: add the active aspect in HDMI AVI frameJean-Francois Moine1-0/+1
The picture aspect setting was zero, which is reserved. A setting of Same As Picture makes more sense. Tested-by: Russell King <rmk+kernel@arm.linux.org.uk> Acked-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: Jean-Francois Moine <moinejf@free.fr> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2014-02-13drm/i2c: tda998x: use HDMI constantsJean-Francois Moine1-6/+6
This patch replaces hard coded values by hdmi constants. Tested-by: Russell King <rmk+kernel@arm.linux.org.uk> Acked-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: Jean-Francois Moine <moinejf@free.fr> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2014-02-13drm/i2c: tda998x: Fix memory leak in tda998x_encoder_init error path.Dave Jones1-1/+3
Commit 6ae668cc19e8 (drm/i2c: tda998x: check the CEC device creation) introduced a memory leak in the error path of tda998x_encoder_init Picked up by the nightly Coverity scan. CID 1174076 Signed-off-by: Dave Jones <davej@fedoraproject.org> Acked-by: Jean-Francois Moine <moinejf@free.fr> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2014-02-02drm/i2c: tda998x: fix the ENABLE_SPACE registerJean-Francois Moine1-1/+1
This patch fixes the ENABLE_SPACE register, the value of which was inverted. Tested-by: Russell King <rmk+kernel@arm.linux.org.uk> Acked-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: Jean-Francois Moine <moinejf@free.fr> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2014-02-02drm/i2c: tda998x: set the PLL division factor in range 0..3Jean-Francois Moine1-1/+6
The predivider division factor of the register PLL_SERIAL_2 is in the range 0..3, the value 0 being used for a division by 1. Tested-by: Russell King <rmk+kernel@arm.linux.org.uk> Acked-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: Jean-Francois Moine <moinejf@free.fr> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2014-02-02drm/i2c: tda998x: force the page register at startup timeJean-Francois Moine1-1/+1
This patch forces the page register to be set on the first I/O operation. Tested-by: Russell King <rmk+kernel@arm.linux.org.uk> Acked-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: Jean-Francois Moine <moinejf@free.fr> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2014-02-02drm/i2c: tda998x: free the CEC device on encoder_destroyJean-Francois Moine1-0/+2
The cec i2c device is created in tda998x_encoder_init() when the DRM driver starts. This patch frees it when the DRM driver is unloaded. Tested-by: Russell King <rmk+kernel@arm.linux.org.uk> Acked-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: Jean-Francois Moine <moinejf@free.fr> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2014-02-02drm/i2c: tda998x: check the CEC device creationJean-Francois Moine1-0/+2
This patch checks if the CEC device is well created at intialization time. Tested-by: Russell King <rmk+kernel@arm.linux.org.uk> Acked-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: Jean-Francois Moine <moinejf@free.fr> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2014-02-02drm/i2c: tda998x: fix bad value in the AIFJean-Francois Moine1-1/+1
The AIF has an uninitialized byte. This patch clears the whole buffer before filling it. Tested-by: Russell King <rmk+kernel@arm.linux.org.uk> Acked-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: Jean-Francois Moine <moinejf@free.fr> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>