[PATCH v2 09/15] drm/bridge: tc358767: Use reported AUX transfer size

2019-03-24 Thread Andrey Smirnov
one user of it, inline its code into tc_aux_transfer() instead of trying to accommodate the change above. Signed-off-by: Andrey Smirnov Cc: Archit Taneja Cc: Andrzej Hajda Cc: Laurent Pinchart Cc: Tomi Valkeinen Cc: Andrey Gusakov Cc: Philipp Zabel Cc: Chris Healy Cc: Lucas Stach Cc: dri

[PATCH v2 11/15] drm/bridge: tc358767: Introduce tc_set_syspllparam()

2019-03-24 Thread Andrey Smirnov
Move common code converting clock rate to an appropriate constant and configuring SYS_PLLPARAM register into a separate routine and convert the rest of the code to use it. No functional change intended. Signed-off-by: Andrey Smirnov Reviewed-by: Laurent Pinchart Cc: Archit Taneja Cc: Andrzej

[PATCH v2 15/15] drm/bridge: tc358767: Replace magic number in tc_main_link_enable()

2019-03-24 Thread Andrey Smirnov
We don't need 8 byte array, DP_LINK_STATUS_SIZE (6) should be enough. This also gets rid of a magic number as a bonus. Signed-off-by: Andrey Smirnov Cc: Archit Taneja Cc: Andrzej Hajda Cc: Laurent Pinchart Cc: Tomi Valkeinen Cc: Andrey Gusakov Cc: Philipp Zabel Cc: Chris Healy Cc: Lucas

[PATCH v2 03/15] drm/bridge: tc358767: Simplify polling in tc_link_training()

2019-03-24 Thread Andrey Smirnov
Replace explicit polling in tc_link_training() with equivalent call to tc_poll_timeout() for simplicity. No functional change intended (not including slightly altered debug output). Signed-off-by: Andrey Smirnov Cc: Archit Taneja Cc: Andrzej Hajda Cc: Laurent Pinchart Cc: Tomi Valkeinen Cc

[PATCH v2 07/15] drm/bridge: tc358767: Simplify AUX data write

2019-03-24 Thread Andrey Smirnov
buffer and no comment in the original code explaining why it was done this way, that special I2C write buffer transformation was dropped in this patch. Signed-off-by: Andrey Smirnov Cc: Archit Taneja Cc: Andrzej Hajda Cc: Laurent Pinchart Cc: Tomi Valkeinen Cc: Andrey Gusakov Cc: Philipp Zab

[PATCH v2 05/15] drm/bridge: tc358767: Drop custom tc_write()/tc_read() accessors

2019-03-24 Thread Andrey Smirnov
and there's no way of fixing them without making them too verbose to be worth it change the driver code to not use them at all. Signed-off-by: Andrey Smirnov Cc: Archit Taneja Cc: Andrzej Hajda Cc: Laurent Pinchart Cc: Tomi Valkeinen Cc: Andrey Gusakov Cc: Philipp Zabel Cc: Chris Healy Cc: Lucas

[PATCH v2 00/15] tc358767 driver improvements

2019-03-24 Thread Andrey Smirnov
Everyone: This series contains various improvements (at least in my mind) and fixes that I made to tc358767 while working with the code of the driver. Hopefuly each patch is self explanatory. Feedback is welcome! Thanks, Andrey Smirnov Changes since [v1]: - Patchset rebased on top

[PATCH v2 14/15] drm/bridge: tc358767: Drop unnecessary 8 byte buffer

2019-03-24 Thread Andrey Smirnov
tc_get_display_props() never reads more than a byte via AUX, so there's no need to reserve 8 for that purpose. No function change intended. Signed-off-by: Andrey Smirnov Cc: Archit Taneja Cc: Andrzej Hajda Cc: Laurent Pinchart Cc: Tomi Valkeinen Cc: Andrey Gusakov Cc: Philipp Zabel Cc

Re: [21/21] drm/bridge: tc358767: implement naive HPD handling

2019-03-21 Thread Andrey Smirnov
On Wed, Mar 20, 2019 at 6:03 AM Tomi Valkeinen wrote: > > On 20/03/2019 08:57, Tomi Valkeinen wrote: > > On 19/03/2019 20:18, Andrey Smirnov wrote: > > > >> TC358767 has two GPIO pins that can be used for HPD signal. I think > >> instead of hardcoding

Re: [21/21] drm/bridge: tc358767: implement naive HPD handling

2019-03-20 Thread Andrey Smirnov
67 if you could use your "normal" GPIOs. Using gpiolib API would allow us to handle both usecase with the same code. Lastly, by treating "hpd-gpios" as an optional property, we can preserve old driver behaviour regardless if it is connected to DP or eDP panel. Not saying that this

Re: [21/21] drm/bridge: tc358767: implement naive HPD handling

2019-03-20 Thread Andrey Smirnov
On Tue, Mar 19, 2019 at 11:18 AM Andrey Smirnov wrote: > > > tc358767 driver doesn't have any HPD handling at the moment, as it was > > originally developed to support only eDP. > > > This patch implements a naive, polling-based HPD handling, which is used > >

Re: [PATCH 6/9] drm/bridge: tc358767: Simplify error check in tc_aux_linx_setup()

2019-03-12 Thread Andrey Smirnov
On Mon, Mar 4, 2019 at 4:33 AM Laurent Pinchart wrote: > > Hi Andrey, > > Thank you for the patch. > > On Tue, Feb 26, 2019 at 11:36:06AM -0800, Andrey Smirnov wrote: > > Tc_poll_timeout() can only return -ETIMEDOUT, so checking for other > > errors is not necessary.

Re: [PATCH 5/9] drm/bridge: tc358767: Simplify polling in tc_link_training()

2019-03-12 Thread Andrey Smirnov
On Mon, Mar 4, 2019 at 4:30 AM Laurent Pinchart wrote: > > Hi Andrey, > > Thank you for the patch. > > On Tue, Feb 26, 2019 at 11:36:05AM -0800, Andrey Smirnov wrote: > > Replace explicit polling in tc_link_training() with equivalent call to > > regmap_read

Re: [PATCH 2/9] drm/bridge: tc358767: Simplify tc_stream_clock_calc()

2019-03-12 Thread Andrey Smirnov
On Mon, Mar 4, 2019 at 4:20 AM Laurent Pinchart wrote: > > Hello, > > On Mon, Mar 04, 2019 at 10:42:20AM +0100, Andrzej Hajda wrote: > > On 26.02.2019 20:36, Andrey Smirnov wrote: > > > Drop the use of tc_write() as well as "magicly" used "ret" and

Re: [PATCH 3/9] drm/bridge: tc358767: Simplify tc_set_video_mode()

2019-03-12 Thread Andrey Smirnov
On Mon, Mar 4, 2019 at 4:26 AM Laurent Pinchart wrote: > > Hi Andrey, > > Thank you for the patch. > > On Tue, Feb 26, 2019 at 11:36:03AM -0800, Andrey Smirnov wrote: > > Simplify tc_set_video_mode() by replacing repreated calls to > > tc_write()/reg

[PATCH 4/9] drm/bridge: tc358767: Simplify polling in tc_main_link_setup()

2019-02-27 Thread Andrey Smirnov
Replace explicit polling loop with equivalent call to regmap_read_poll_timeout() for simplicity. No functional change intended. Signed-off-by: Andrey Smirnov Cc: Archit Taneja Cc: Andrzej Hajda Cc: Laurent Pinchart Cc: Chris Healy Cc: Lucas Stach Cc: dri-devel@lists.freedesktop.org Cc

[PATCH 8/9] drm/bridge: tc358767: Introduce tc_pllupdate_pllen()

2019-02-27 Thread Andrey Smirnov
-off-by: Andrey Smirnov Cc: Archit Taneja Cc: Andrzej Hajda Cc: Laurent Pinchart Cc: Chris Healy Cc: Lucas Stach Cc: dri-devel@lists.freedesktop.org Cc: linux-ker...@vger.kernel.org --- drivers/gpu/drm/bridge/tc358767.c | 36 +++ 1 file changed, 22 insertions

[PATCH 7/9] drm/bridge: tc358767: Introduce tc_set_syspllparam()

2019-02-27 Thread Andrey Smirnov
Move common code converting clock rate to an appropriate constant and configuring SYS_PLLPARAM register into a separate routine and convert the rest of the code to use it. No functional change intended. Signed-off-by: Andrey Smirnov Cc: Archit Taneja Cc: Andrzej Hajda Cc: Laurent Pinchart Cc

[PATCH 6/9] drm/bridge: tc358767: Simplify error check in tc_aux_linx_setup()

2019-02-27 Thread Andrey Smirnov
Tc_poll_timeout() can only return -ETIMEDOUT, so checking for other errors is not necessary. Drop it. No functional change intended. Signed-off-by: Andrey Smirnov Cc: Archit Taneja Cc: Andrzej Hajda Cc: Laurent Pinchart Cc: Chris Healy Cc: Lucas Stach Cc: dri-devel@lists.freedesktop.org Cc

[PATCH 5/9] drm/bridge: tc358767: Simplify polling in tc_link_training()

2019-02-27 Thread Andrey Smirnov
Replace explicit polling in tc_link_training() with equivalent call to regmap_read_poll_timeout() for simplicity. No functional change intended (not including slightly altered debug output). Signed-off-by: Andrey Smirnov Cc: Archit Taneja Cc: Andrzej Hajda Cc: Laurent Pinchart Cc: Chris Healy

[PATCH 9/9] drm/bridge: tc358767: Drop tc_read() macro

2019-02-27 Thread Andrey Smirnov
There's only one place where tc_read() is used, so it doesn't save us much. Drop it. No functional change intended. Signed-off-by: Andrey Smirnov Cc: Archit Taneja Cc: Andrzej Hajda Cc: Laurent Pinchart Cc: Chris Healy Cc: Lucas Stach Cc: dri-devel@lists.freedesktop.org Cc: linux-ker

[PATCH 0/9] tc358767 driver improvements

2019-02-27 Thread Andrey Smirnov
Everyone: This series contains various improvements (at least in my mind) that I made to tc358767 while working with the code of the driver. Hopefuly each patch is self explanatory. Feedback is welcome! Thanks, Andrey Smirnov Andrey Smirnov (9): drm/bridge: tc358767: Simplify tc_poll_timeout

[PATCH 2/9] drm/bridge: tc358767: Simplify tc_stream_clock_calc()

2019-02-27 Thread Andrey Smirnov
Drop the use of tc_write() as well as "magicly" used "ret" and "err:" and replace it with a simple call to regmap_write(). No functional change intended. Signed-off-by: Andrey Smirnov Cc: Archit Taneja Cc: Andrzej Hajda Cc: Laurent Pinchart Cc: Chris Healy

[PATCH 3/9] drm/bridge: tc358767: Simplify tc_set_video_mode()

2019-02-27 Thread Andrey Smirnov
Simplify tc_set_video_mode() by replacing repreated calls to tc_write()/regmap_write() with a single call regmap_multi_reg_write(). No functional change intended. Signed-off-by: Andrey Smirnov Cc: Archit Taneja Cc: Andrzej Hajda Cc: Laurent Pinchart Cc: Chris Healy Cc: Lucas Stach Cc: dri

[PATCH 1/9] drm/bridge: tc358767: Simplify tc_poll_timeout()

2019-02-27 Thread Andrey Smirnov
Implementation of tc_poll_timeout() is almost a 100% copy-and-paste of the code for regmap_read_poll_timeout(). Replace copied code with a call to the original. No functional change intended. Signed-off-by: Andrey Smirnov Cc: Archit Taneja Cc: Andrzej Hajda Cc: Laurent Pinchart Cc: Chris

<    1   2