Re: [PATCH v3 2/2] drm/bridge: tc358767: Expose test mode functionality via debugfs

2019-12-10 Thread Andrey Smirnov
On Mon, Dec 9, 2019 at 7:05 AM Tomi Valkeinen wrote: > > On 09/12/2019 16:38, Andrey Smirnov wrote: > > On Mon, Dec 9, 2019 at 1:38 AM Tomi Valkeinen wrote: > >> > >> (Cc'ing Daniel for the last paragraph) > >> > >> On 09/12/2019 07:08, A

Re: [PATCH v3 2/2] drm/bridge: tc358767: Expose test mode functionality via debugfs

2019-12-10 Thread Andrey Smirnov
On Mon, Dec 9, 2019 at 1:38 AM Tomi Valkeinen wrote: > > (Cc'ing Daniel for the last paragraph) > > On 09/12/2019 07:08, Andrey Smirnov wrote: > > Presently, the driver code artificially limits test pattern mode to a > > single pattern with fixed color select

Re: [PATCH] drm/bridge: tc358767: fix poll timeouts

2019-12-10 Thread Andrey Smirnov
g in > tc_link_training()") Tested on RDU2 with TC358767/eDP panel, doesn't seem to break anything there, so: Tested-by: Andrey Smirnov > --- > drivers/gpu/drm/bridge/tc358767.c | 8 > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/drivers

[PATCH v3 0/2] tc358767 test mode

2019-12-09 Thread Andrey Smirnov
- Debugfs permission changed to reflect write-only nature of this feature - Original commit split into two - Minor formatting changes Thanks, Andrey Smirnov [v1] lore.kernel.org/r/20190826182524.5064-1-andrew.smir...@gmail.com [v2] lore.kernel.org/r/20190912013740.563

[PATCH v3 2/2] drm/bridge: tc358767: Expose test mode functionality via debugfs

2019-12-09 Thread Andrey Smirnov
trigger a link re-establishment by switching back to normal mode Signed-off-by: Andrey Smirnov Cc: Andrzej Hajda Cc: Laurent Pinchart Cc: Tomi Valkeinen Cc: Cory Tusar Cc: Chris Healy Cc: Lucas Stach Cc: dri-devel@lists.freedesktop.org Cc: linux-ker...@vger.ker

[PATCH v3 1/2] drm/bridge: tc358767: Introduce __tc_bridge_enable/disable()

2019-12-09 Thread Andrey Smirnov
Expose underlying implementation of bridge's enable/disable functions, so it would be possible to use them in other parts of the driver. Signed-off-by: Andrey Smirnov Cc: Andrzej Hajda Cc: Laurent Pinchart Cc: Tomi Valkeinen Cc: Cory Tusar Cc: Chris Healy Cc: Lucas Stach Cc: dri-

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

2019-12-06 Thread Andrey Smirnov
On Wed, Dec 4, 2019 at 10:27 AM Tomi Valkeinen wrote: > > Hi Andrey, > > On 19/06/2019 08:27, Andrey Smirnov wrote: > > > @@ -748,22 +748,19 @@ static int tc_set_video_mode(struct tc_data *tc, > > > > static int tc_wait_link_training(struct tc_data *tc) >

[PATCH v2 2/2] drm/bridge: tc358767: Expose test mode functionality via debugfs

2019-09-11 Thread Andrey Smirnov
trigger a link re-establishment by switching back to normal mode Signed-off-by: Andrey Smirnov Cc: Andrzej Hajda Cc: Laurent Pinchart Cc: Tomi Valkeinen Cc: Cory Tusar Cc: Chris Healy Cc: Lucas Stach Cc: dri-devel@lists.freedesktop.org Cc: linux-ker...@vger.ker

[PATCH v2 1/2] drm/bridge: tc358767: Introduce __tc_bridge_enable/disable()

2019-09-11 Thread Andrey Smirnov
Expose underlying implementation of bridge's enable/disable functions, so it would be possible to use them in other parts of the driver. Signed-off-by: Andrey Smirnov Cc: Andrzej Hajda Cc: Laurent Pinchart Cc: Tomi Valkeinen Cc: Cory Tusar Cc: Chris Healy Cc: Lucas Stach Cc: dri-

[PATCH v2 0/2] tc358767 test mode

2019-09-11 Thread Andrey Smirnov
nature of this feature - Original commit split into two - Minor formatting changes Thanks, Andrey Smirnov [v1] lore.kernel.org/r/20190826182524.5064-1-andrew.smir...@gmail.com Andrey Smirnov (2): drm/bridge: tc358767: Introduce __tc_bridge_enable/disable() drm/bridge: tc358767: E

Re: [PATCH] drm/bridge: tc358767: Expose test mode functionality via debugfs

2019-08-28 Thread Andrey Smirnov
On Mon, Aug 26, 2019 at 10:46 PM Tomi Valkeinen wrote: > > Hi, > > On 26/08/2019 21:25, Andrey Smirnov wrote: > > Presently, the driver code artificially limits test pattern mode to a > > single pattern with fixed color selection. It being a kernel module > > p

Re: [PATCH] drm/bridge: tc358767: Expose test mode functionality via debugfs

2019-08-28 Thread Andrey Smirnov
On Tue, Aug 27, 2019 at 1:06 AM Laurent Pinchart wrote: > > Hi Andrey, > > On Mon, Aug 26, 2019 at 09:24:57PM -0700, Andrey Smirnov wrote: > > On Mon, Aug 26, 2019 at 3:08 PM Laurent Pinchart wrote: > > > On Mon, Aug 26, 2019 at 11:25:24AM -0700, Andrey Smirnov wr

Re: [PATCH] drm/bridge: tc358767: Expose test mode functionality via debugfs

2019-08-26 Thread Andrey Smirnov
On Mon, Aug 26, 2019 at 3:08 PM Laurent Pinchart wrote: > > Hi Andrey, > > Thank you for the patch. > > On Mon, Aug 26, 2019 at 11:25:24AM -0700, Andrey Smirnov wrote: > > Presently, the driver code artificially limits test pattern mode to a > > single pattern with f

[PATCH] drm/bridge: tc358767: Expose test mode functionality via debugfs

2019-08-26 Thread Andrey Smirnov
trigger a link re-establishment by switching back to normal mode Signed-off-by: Andrey Smirnov Cc: Andrzej Hajda Cc: Laurent Pinchart Cc: Tomi Valkeinen Cc: Cory Tusar Cc: Chris Healy Cc: Lucas Stach Cc: dri-devel@lists.freedesktop.org Cc: linux-ker...@vger.ker

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

2019-06-18 Thread Andrey Smirnov
;t really saving that much code 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 Reviewed-by: Andrzej Hajda Cc: Andrzej Hajda Cc: Laurent Pinchart Cc: Tomi Valkeinen Cc: Andrey Gusako

[PATCH v6 13/15] drm/bridge: tc358767: Drop unnecessary 8 byte buffer

2019-06-18 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 Reviewed-by: Andrzej Hajda Cc: Andrzej Hajda Cc: Laurent Pinchart Cc: Tomi Valkeinen Cc: Andrey Gusakov Cc: Philipp

[PATCH v6 06/15] drm/bridge: tc358767: Simplify AUX data read

2019-06-18 Thread Andrey Smirnov
Simplify AUX data read by removing index arithmetic and shifting with a helper function that does two things: 1. Fetch data from up to 4 32-bit registers from the chip 2. Copy read data into user provided array. Signed-off-by: Andrey Smirnov Reviewed-by: Andrzej Hajda Cc: Andrzej Hajda

[PATCH v6 08/15] drm/bridge: tc358767: Increase AUX transfer length limit

2019-06-18 Thread Andrey Smirnov
case of I2C transfers), so limit it to 15. Signed-off-by: Andrey Smirnov Reviewed-by: Andrzej Hajda Cc: Andrzej Hajda Cc: Laurent Pinchart Cc: Tomi Valkeinen Cc: Andrey Gusakov Cc: Philipp Zabel Cc: Cory Tusar Cc: Chris Healy Cc: Lucas Stach Cc: dri-devel@lists.freedesktop.org Cc: linux-ker

[PATCH v6 11/15] drm/bridge: tc358767: Introduce tc_pllupdate()

2019-06-18 Thread Andrey Smirnov
-by: Andrey Smirnov Reviewed-by: Laurent Pinchart Reviewed-by: Andrzej Hajda Cc: Andrzej Hajda Cc: Laurent Pinchart Cc: Tomi Valkeinen Cc: Andrey Gusakov Cc: Philipp Zabel Cc: Cory Tusar Cc: Chris Healy Cc: Lucas Stach Cc: dri-devel@lists.freedesktop.org Cc: linux-ker...@vger.kernel.org

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

2019-06-18 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 Reviewed-by: Andrzej Hajda Cc: Andrzej Hajda Cc: Laurent Pinchart Cc: Tomi Valkeinen Cc: Andrey Gusakov Cc: Philipp Zabel Cc: Cory Tusa

[PATCH v6 10/15] drm/bridge: tc358767: Introduce tc_set_syspllparam()

2019-06-18 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 Reviewed-by: Andrzej Hajda Cc

[PATCH v6 12/15] drm/bridge: tc358767: Simplify tc_aux_wait_busy()

2019-06-18 Thread Andrey Smirnov
We never pass anything but 100 as timeout_ms to tc_aux_wait_busy(), so we may as well hardcode that value and simplify function's signature. Signed-off-by: Andrey Smirnov Reviewed-by: Andrzej Hajda Cc: Andrzej Hajda Cc: Laurent Pinchart Cc: Tomi Valkeinen Cc: Andrey Gusakov Cc: Ph

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

2019-06-18 Thread Andrey Smirnov
pecial I2C write buffer transformation was dropped in this patch. Signed-off-by: Andrey Smirnov Reviewed-by: Andrzej Hajda Cc: Andrzej Hajda Cc: Laurent Pinchart Cc: Tomi Valkeinen Cc: Andrey Gusakov Cc: Philipp Zabel Cc: Cory Tusar Cc: Chris Healy Cc: Lucas Stach Cc: dri-devel@lists.fr

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

2019-06-18 Thread Andrey Smirnov
x27;s only one user of it, inline its code into tc_aux_transfer() instead of trying to accommodate the change above. Signed-off-by: Andrey Smirnov Reviewed-by: Andrzej Hajda Cc: Andrzej Hajda Cc: Laurent Pinchart Cc: Tomi Valkeinen Cc: Andrey Gusakov Cc: Philipp Zabel Cc: Cory Tusar Cc: C

[PATCH v6 15/15] drm/bridge: tc358767: Add support for address-only I2C transfers

2019-06-18 Thread Andrey Smirnov
Transfer size of zero means a request to do an address-only transfer. Since the HW support this, we probably shouldn't be just ignoring such requests. While at it allow DP_AUX_I2C_MOT flag to pass through, since it is supported by the HW as well. Signed-off-by: Andrey Smirnov Review

[PATCH v6 04/15] drm/bridge: tc358767: Simplify tc_set_video_mode()

2019-06-18 Thread Andrey Smirnov
Simplify tc_set_video_mode() by replacing explicit shifting using macros from . No functional change intended. Signed-off-by: Andrey Smirnov Reviewed-by: Andrzej Hajda Cc: Andrzej Hajda Cc: Laurent Pinchart Cc: Tomi Valkeinen Cc: Andrey Gusakov Cc: Philipp Zabel Cc: Cory Tusar Cc: Chris

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

2019-06-18 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 Reviewed-by: Andrzej Hajda Cc: Andrzej Hajda Cc: Laurent Pinchart Cc: Tomi

[PATCH v6 02/15] drm/bridge: tc358767: Simplify polling in tc_main_link_setup()

2019-06-18 Thread Andrey Smirnov
Replace explicit polling loop with equivalent call to tc_poll_timeout() for brevity. No functional change intended. Signed-off-by: Andrey Smirnov Reviewed-by: Andrzej Hajda Cc: Andrzej Hajda Cc: Laurent Pinchart Cc: Tomi Valkeinen Cc: Andrey Gusakov Cc: Philipp Zabel Cc: Cory Tusar Cc

[PATCH v6 00/15] tc358767 driver improvements

2019-06-18 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 [v5]: - Fixed regression in "drm/b

[PATCH v6 01/15] drm/bridge: tc358767: Simplify tc_poll_timeout()

2019-06-18 Thread Andrey Smirnov
onal change intended. Signed-off-by: Andrey Smirnov Reviewed-by: Andrzej Hajda Reviewed-by: Laurent Pinchart Cc: Andrzej Hajda Cc: Laurent Pinchart Cc: Tomi Valkeinen Cc: Andrey Gusakov Cc: Philipp Zabel Cc: Cory Tusar Cc: Chris Healy Cc: Lucas Stach Cc: dri-devel@lists.freedeskt

Re: [PATCH v5 10/15] drm/bridge: tc358767: Add support for address-only I2C transfers

2019-06-18 Thread Andrey Smirnov
On Wed, Jun 12, 2019 at 9:22 AM Andrey Smirnov wrote: > > On Wed, Jun 12, 2019 at 5:48 AM Tomi Valkeinen wrote: > > > > Hi, > > > > On 12/06/2019 11:32, Andrey Smirnov wrote: > > > Transfer size of zero means a request to do an address-only > > >

[PATCH v5 01/15] drm/bridge: tc358767: Simplify tc_poll_timeout()

2019-06-13 Thread Andrey Smirnov
onal change intended. Signed-off-by: Andrey Smirnov Reviewed-by: Andrzej Hajda Reviewed-by: Laurent Pinchart Cc: Andrzej Hajda Cc: Laurent Pinchart Cc: Tomi Valkeinen Cc: Andrey Gusakov Cc: Philipp Zabel Cc: Cory Tusar Cc: Chris Healy Cc: Lucas Stach Cc: dri-devel@lists.freedeskt

Re: [PATCH v5 10/15] drm/bridge: tc358767: Add support for address-only I2C transfers

2019-06-12 Thread Andrey Smirnov
On Wed, Jun 12, 2019 at 5:48 AM Tomi Valkeinen wrote: > > Hi, > > On 12/06/2019 11:32, Andrey Smirnov wrote: > > Transfer size of zero means a request to do an address-only > > transfer. Since the HW support this, we probably shouldn't be just > > ignori

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

2019-06-12 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 Reviewed-by: Andrzej Hajda Cc: Andrzej Hajda Cc: Laurent Pinchart Cc: Tomi Valkeinen Cc: Andrey Gusakov Cc: Philipp Zabel Cc: Cory Tusa

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

2019-06-12 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 Reviewed-by: Andrzej Hajda Cc

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

2019-06-12 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 Reviewed-by: Andrzej Hajda Cc: Andrzej Hajda Cc: Laurent Pinchart Cc: Tomi Valkeinen Cc: Andrey Gusakov Cc: Philipp

[PATCH v5 13/15] drm/bridge: tc358767: Simplify tc_aux_wait_busy()

2019-06-12 Thread Andrey Smirnov
We never pass anything but 100 as timeout_ms to tc_aux_wait_busy(), so we may as well hardcode that value and simplify function's signature. Signed-off-by: Andrey Smirnov Reviewed-by: Andrzej Hajda Cc: Andrzej Hajda Cc: Laurent Pinchart Cc: Tomi Valkeinen Cc: Andrey Gusakov Cc: Ph

[PATCH v5 06/15] drm/bridge: tc358767: Simplify AUX data read

2019-06-12 Thread Andrey Smirnov
Simplify AUX data read by removing index arithmetic and shifting with a helper function that does two things: 1. Fetch data from up to 4 32-bit registers from the chip 2. Copy read data into user provided array. Signed-off-by: Andrey Smirnov Reviewed-by: Andrzej Hajda Cc: Andrzej Hajda

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

2019-06-12 Thread Andrey Smirnov
x27;s only one user of it, inline its code into tc_aux_transfer() instead of trying to accommodate the change above. Signed-off-by: Andrey Smirnov Reviewed-by: Andrzej Hajda Cc: Andrzej Hajda Cc: Laurent Pinchart Cc: Tomi Valkeinen Cc: Andrey Gusakov Cc: Philipp Zabel Cc: Cory Tusar Cc: C

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

2019-06-12 Thread Andrey Smirnov
;t really saving that much code 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 Reviewed-by: Andrzej Hajda Cc: Andrzej Hajda Cc: Laurent Pinchart Cc: Tomi Valkeinen Cc: Andrey Gusako

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

2019-06-12 Thread Andrey Smirnov
pecial I2C write buffer transformation was dropped in this patch. Signed-off-by: Andrey Smirnov Reviewed-by: Andrzej Hajda Cc: Andrzej Hajda Cc: Laurent Pinchart Cc: Tomi Valkeinen Cc: Andrey Gusakov Cc: Philipp Zabel Cc: Cory Tusar Cc: Chris Healy Cc: Lucas Stach Cc: dri-devel@lists.fr

[PATCH v5 12/15] drm/bridge: tc358767: Introduce tc_pllupdate()

2019-06-12 Thread Andrey Smirnov
-by: Andrey Smirnov Reviewed-by: Laurent Pinchart Reviewed-by: Andrzej Hajda Cc: Andrzej Hajda Cc: Laurent Pinchart Cc: Tomi Valkeinen Cc: Andrey Gusakov Cc: Philipp Zabel Cc: Cory Tusar Cc: Chris Healy Cc: Lucas Stach Cc: dri-devel@lists.freedesktop.org Cc: linux-ker...@vger.kernel.org

[PATCH v5 08/15] drm/bridge: tc358767: Increase AUX transfer length limit

2019-06-12 Thread Andrey Smirnov
case of I2C transfers), so limit it to 15. Signed-off-by: Andrey Smirnov Reviewed-by: Andrzej Hajda Cc: Andrzej Hajda Cc: Laurent Pinchart Cc: Tomi Valkeinen Cc: Andrey Gusakov Cc: Philipp Zabel Cc: Cory Tusar Cc: Chris Healy Cc: Lucas Stach Cc: dri-devel@lists.freedesktop.org Cc: linux-ker

[PATCH v5 10/15] drm/bridge: tc358767: Add support for address-only I2C transfers

2019-06-12 Thread Andrey Smirnov
Transfer size of zero means a request to do an address-only transfer. Since the HW support this, we probably shouldn't be just ignoring such requests. While at it allow DP_AUX_I2C_MOT flag to pass through, since it is supported by the HW as well. Signed-off-by: Andrey Smirnov Review

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

2019-06-12 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 Reviewed-by: Andrzej Hajda Cc: Andrzej Hajda Cc: Laurent Pinchart Cc: Tomi

[PATCH v5 04/15] drm/bridge: tc358767: Simplify tc_set_video_mode()

2019-06-12 Thread Andrey Smirnov
Simplify tc_set_video_mode() by replacing explicit shifting using macros from . No functional change intended. Signed-off-by: Andrey Smirnov Reviewed-by: Andrzej Hajda Cc: Andrzej Hajda Cc: Laurent Pinchart Cc: Tomi Valkeinen Cc: Andrey Gusakov Cc: Philipp Zabel Cc: Cory Tusar Cc: Chris

[PATCH v5 02/15] drm/bridge: tc358767: Simplify polling in tc_main_link_setup()

2019-06-12 Thread Andrey Smirnov
Replace explicit polling loop with equivalent call to tc_poll_timeout() for brevity. No functional change intended. Signed-off-by: Andrey Smirnov Reviewed-by: Andrzej Hajda Cc: Andrzej Hajda Cc: Laurent Pinchart Cc: Tomi Valkeinen Cc: Andrey Gusakov Cc: Philipp Zabel Cc: Cory Tusar Cc

[PATCH v5 00/15] tc358767 driver improvements

2019-06-12 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 [v4]: - tc_pllupdate_pllen() renamed to

Re: [PATCH v3 06/15] drm/bridge: tc358767: Simplify AUX data read

2019-06-07 Thread Andrey Smirnov
On Thu, Jun 6, 2019 at 3:59 AM Andrzej Hajda wrote: > > On 05.06.2019 09:04, Andrey Smirnov wrote: > > Simplify AUX data read by removing index arithmetic and shifting with > > a helper functions that does three things: > > > > 1. Fetch data from up to 4

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

2019-06-07 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: Andrzej Hajda Cc: Laurent Pinchart Cc: Tomi Valkeinen Cc: Andrey Gusakov Cc: Philipp Zabel Cc: Cory Tusar Cc: Chris Healy Cc:

[PATCH v4 06/15] drm/bridge: tc358767: Simplify AUX data read

2019-06-07 Thread Andrey Smirnov
Simplify AUX data read by removing index arithmetic and shifting with a helper function that does two things: 1. Fetch data from up to 4 32-bit registers from the chip 2. Copy read data into user provided array. Signed-off-by: Andrey Smirnov Reviewed-by: Andrzej Hajda Cc: Andrzej Hajda

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

2019-06-06 Thread Andrey Smirnov
pecial I2C write buffer transformation was dropped in this patch. Signed-off-by: Andrey Smirnov Reviewed-by: Andrzej Hajda Cc: Andrzej Hajda Cc: Laurent Pinchart Cc: Tomi Valkeinen Cc: Andrey Gusakov Cc: Philipp Zabel Cc: Cory Tusar Cc: Chris Healy Cc: Lucas Stach Cc: dri-devel@lists.fr

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

2019-06-06 Thread Andrey Smirnov
;t really saving that much code 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 Reviewed-by: Andrzej Hajda Cc: Andrzej Hajda Cc: Laurent Pinchart Cc: Tomi Valkeinen Cc: Andrey Gusako

[PATCH v4 08/15] drm/bridge: tc358767: Increase AUX transfer length limit

2019-06-06 Thread Andrey Smirnov
case of I2C transfers), so limit it to 15. Signed-off-by: Andrey Smirnov Reviewed-by: Andrzej Hajda Cc: Andrzej Hajda Cc: Laurent Pinchart Cc: Tomi Valkeinen Cc: Andrey Gusakov Cc: Philipp Zabel Cc: Cory Tusar Cc: Chris Healy Cc: Lucas Stach Cc: dri-devel@lists.freedesktop.org Cc: linux-ker

[PATCH v4 12/15] drm/bridge: tc358767: Introduce tc_pllupdate_pllen()

2019-06-06 Thread Andrey Smirnov
-off-by: Andrey Smirnov Reviewed-by: Laurent Pinchart Cc: Archit Taneja Cc: Andrzej Hajda Cc: Laurent Pinchart Cc: Tomi Valkeinen Cc: Andrey Gusakov Cc: Philipp Zabel Cc: Cory Tusar Cc: Chris Healy Cc: Lucas Stach Cc: dri-devel@lists.freedesktop.org Cc: linux-ker...@vger.kernel.org

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

2019-06-06 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 v4 09/15] drm/bridge: tc358767: Use reported AUX transfer size

2019-06-06 Thread Andrey Smirnov
x27;s only 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: Andrzej Hajda Cc: Laurent Pinchart Cc: Tomi Valkeinen Cc: Andrey Gusakov Cc: Philipp Zabel Cc: Cory Tusar Cc: Chris Healy Cc: Lucas Stac

[PATCH v4 04/15] drm/bridge: tc358767: Simplify tc_set_video_mode()

2019-06-06 Thread Andrey Smirnov
Simplify tc_set_video_mode() by replacing explicit shifting using macros from . No functional change intended. Signed-off-by: Andrey Smirnov Reviewed-by: Andrzej Hajda Cc: Andrzej Hajda Cc: Laurent Pinchart Cc: Tomi Valkeinen Cc: Andrey Gusakov Cc: Philipp Zabel Cc: Cory Tusar Cc: Chris

[PATCH v4 01/15] drm/bridge: tc358767: Simplify tc_poll_timeout()

2019-06-06 Thread Andrey Smirnov
onal change intended. Signed-off-by: Andrey Smirnov Reviewed-by: Andrzej Hajda Reviewed-by: Laurent Pinchart Cc: Andrzej Hajda Cc: Laurent Pinchart Cc: Tomi Valkeinen Cc: Andrey Gusakov Cc: Philipp Zabel Cc: Cory Tusar Cc: Chris Healy Cc: Lucas Stach Cc: dri-devel@lists.freedeskt

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

2019-06-06 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: Andrzej Hajda Cc: Laurent Pinchart Cc: Tomi Valkeinen Cc: Andrey Gusakov Cc: Philipp Zabel Cc: Cory Tusar Cc:

[PATCH v4 10/15] drm/bridge: tc358767: Add support for address-only I2C transfers

2019-06-06 Thread Andrey Smirnov
Transfer size of zero means a request to do an address-only transfer. Since the HW support this, we probably shouldn't be just ignoring such requests. While at it allow DP_AUX_I2C_MOT flag to pass through, since it is supported by the HW as well. Signed-off-by: Andrey Smirnov Cc: Andrzej

[PATCH v4 13/15] drm/bridge: tc358767: Simplify tc_aux_wait_busy()

2019-06-06 Thread Andrey Smirnov
We never pass anything but 100 as timeout_ms to tc_aux_wait_busy(), so we may as well hardcode that value and simplify function's signature. Signed-off-by: Andrey Smirnov Cc: Andrzej Hajda Cc: Laurent Pinchart Cc: Tomi Valkeinen Cc: Andrey Gusakov Cc: Philipp Zabel Cc: Cory Tusar Cc:

[PATCH v4 00/15] tc358767 driver improvements

2019-06-06 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 [v3]: - Collected Reviewed-bys from

[PATCH v4 02/15] drm/bridge: tc358767: Simplify polling in tc_main_link_setup()

2019-06-06 Thread Andrey Smirnov
Replace explicit polling loop with equivalent call to tc_poll_timeout() for brevity. No functional change intended. Signed-off-by: Andrey Smirnov Reviewed-by: Andrzej Hajda Cc: Andrzej Hajda Cc: Laurent Pinchart Cc: Tomi Valkeinen Cc: Andrey Gusakov Cc: Philipp Zabel Cc: Cory Tusar Cc

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

2019-06-06 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 Reviewed-by: Andrzej Hajda Cc: Andrzej Hajda Cc: Laurent Pinchart Cc: Tomi

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

2019-06-06 Thread Andrey Smirnov
On Thu, Jun 6, 2019 at 3:34 AM Andrzej Hajda wrote: > > On 05.06.2019 09:04, Andrey Smirnov wrote: > > A very unfortunate aspect of tc_write()/tc_read() macro helpers is > > that they capture quite a bit of context around them and thus require > > the caller to have magic

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

2019-06-06 Thread Andrey Smirnov
On Thu, Jun 6, 2019 at 1:08 AM Andrzej Hajda wrote: > > On 05.06.2019 09:04, Andrey Smirnov wrote: > > Replace explicit polling in tc_link_training() with equivalent call to > > tc_poll_timeout() for simplicity. No functional change intended (not > > including sligh

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

2019-06-05 Thread Andrey Smirnov
x27;s only 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: Cory Tusar Cc: Chris Healy

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

2019-06-05 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 v3 08/15] drm/bridge: tc358767: Increase AUX transfer length limit

2019-06-05 Thread Andrey Smirnov
case of I2C transfers), so limit it to 15. Signed-off-by: Andrey Smirnov Cc: Archit Taneja Cc: Andrzej Hajda Cc: Laurent Pinchart Cc: Tomi Valkeinen Cc: Andrey Gusakov Cc: Philipp Zabel Cc: Cory Tusar Cc: Chris Healy Cc: Lucas Stach Cc: dri-devel@lists.freedesktop.org Cc: linux-ker

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

2019-06-05 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 Zabe

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

2019-06-05 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: Cory Tusar Cc:

[PATCH v3 12/15] drm/bridge: tc358767: Introduce tc_pllupdate_pllen()

2019-06-05 Thread Andrey Smirnov
-off-by: Andrey Smirnov Reviewed-by: Laurent Pinchart Cc: Archit Taneja Cc: Andrzej Hajda Cc: Laurent Pinchart Cc: Tomi Valkeinen Cc: Andrey Gusakov Cc: Philipp Zabel Cc: Cory Tusar Cc: Chris Healy Cc: Lucas Stach Cc: dri-devel@lists.freedesktop.org Cc: linux-ker...@vger.kernel.org

[PATCH v3 01/15] drm/bridge: tc358767: Simplify tc_poll_timeout()

2019-06-05 Thread Andrey Smirnov
onal change intended. Signed-off-by: Andrey Smirnov Reviewed-by: Andrzej Hajda Reviewed-by: Laurent Pinchart Cc: Archit Taneja Cc: Andrzej Hajda Cc: Laurent Pinchart Cc: Tomi Valkeinen Cc: Andrey Gusakov Cc: Philipp Zabel Cc: Cory Tusar Cc: Chris Healy Cc: Lucas Stach Cc: dri-devel@list

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

2019-06-05 Thread Andrey Smirnov
;t really saving that much code 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:

[PATCH v3 04/15] drm/bridge: tc358767: Simplify tc_set_video_mode()

2019-06-05 Thread Andrey Smirnov
Simplify tc_set_video_mode() by replacing explicit shifting using macros from . No functional 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: Cory Tusar Cc: Chris Healy Cc

[PATCH v3 02/15] drm/bridge: tc358767: Simplify polling in tc_main_link_setup()

2019-06-05 Thread Andrey Smirnov
Replace explicit polling loop with equivalent call to tc_poll_timeout() for brevity. No functional 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: Cory Tusar Cc: Chris Healy

[PATCH v3 00/15] tc358767 driver improvements

2019-06-05 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 [v2]: - Patchset rebased on top of v4

[PATCH v3 10/15] drm/bridge: tc358767: Add support for address-only I2C transfers

2019-06-05 Thread Andrey Smirnov
Transfer size of zero means a request to do an address-only transfer. Since the HW support this, we probably shouldn't be just ignoring such requests. While at it allow DP_AUX_I2C_MOT flag to pass through, since it is supported by the HW as well. Signed-off-by: Andrey Smirnov Cc: Archit T

[PATCH v3 06/15] drm/bridge: tc358767: Simplify AUX data read

2019-06-05 Thread Andrey Smirnov
-by: Andrey Smirnov Cc: Archit Taneja Cc: Andrzej Hajda Cc: Laurent Pinchart Cc: Tomi Valkeinen Cc: Andrey Gusakov Cc: Philipp Zabel Cc: Cory Tusar Cc: Chris Healy Cc: Lucas Stach Cc: dri-devel@lists.freedesktop.org Cc: linux-ker...@vger.kernel.org --- drivers/gpu/drm/bridge/tc358767.c

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

2019-06-05 Thread Andrey Smirnov
write 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: P

[PATCH v3 13/15] drm/bridge: tc358767: Simplify tc_aux_wait_busy()

2019-06-05 Thread Andrey Smirnov
We never pass anything but 100 as timeout_ms to tc_aux_wait_busy(), so we may as well hardcode that value and simplify function's signature. Signed-off-by: Andrey Smirnov Cc: Archit Taneja Cc: Andrzej Hajda Cc: Laurent Pinchart Cc: Tomi Valkeinen Cc: Andrey Gusakov Cc: Philipp Zabe

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

2019-06-05 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

Re: [PATCHv2 03/22] drm/bridge: tc358767: fix ansi 8b10b use

2019-05-22 Thread Andrey Smirnov
ve to test v3 though), so I think we can carefully proceed assuming that that weird panel was just a fluke. Thanks, Andrey Smirnov ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel

Re: [PATCHv2 02/22] drm/bridge: tc358767: reset voltage-swing & pre-emphasis

2019-04-29 Thread Andrey Smirnov
tmp[0] = tmp[1] = DP_TRAIN_VOLTAGE_SWING_LEVEL_0 | > >> DP_TRAIN_PRE_EMPH_LEVEL_0; > > > > You may want to wrap the line. > > Well, I personally don't think wrapping at 80 is a good idea. Trying to read two files side by side on a 13" laptop screen might change your mind :-) +1 on wrapping the code around 80 character from me. Thanks, Andrey Smirnov ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel

Re: [PATCHv2 21/22] drm/bridge: tc358767: add IRQ and HPD support

2019-04-15 Thread Andrey Smirnov
On Fri, Apr 12, 2019 at 1:02 AM Tomi Valkeinen wrote: > > Hi Andrey, > > On 03/04/2019 14:34, Tomi Valkeinen wrote: > > On 02/04/2019 05:16, Andrey Smirnov wrote: > > > >> The early return above causes tc_get_display_props() to never be > >> ca

Re: [PATCHv2 21/22] drm/bridge: tc358767: add IRQ and HPD support

2019-04-02 Thread Andrey Smirnov
d; > + else > + return connector_status_unknown; > + } > + The early return above causes tc_get_display_props() to never be called for eDP case, which in turn result in tc_mode_valid() returning MODE_BAD for every mode it is given since it d

[PATCH v2 02/15] drm/bridge: tc358767: Simplify polling in tc_main_link_setup()

2019-03-24 Thread Andrey Smirnov
Replace explicit polling loop with equivalent call to tc_poll_timeout() for brevity. No functional 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: Chris Healy Cc: Lucas

Re: [PATCH v2 08/15] drm/bridge: tc358767: Increase AUX transfer length limit

2019-03-24 Thread Andrey Smirnov
On Fri, Mar 22, 2019 at 6:14 AM Tomi Valkeinen wrote: > > On 22/03/2019 05:28, Andrey Smirnov wrote: > > According to the datasheet tc358767 can transfer up to 16 bytes via > > its AUX channel, so the artificial limit of 8 apperas to be too > > low. However only up to 15-b

[PATCH v2 10/15] drm/bridge: tc358767: Add support for address-only I2C transfers

2019-03-24 Thread Andrey Smirnov
Transfer size of zero means a request to do an address-only transfer. Since the HW support this, we probably shouldn't be just ignoring such requests. While at it allow DP_AUX_I2C_MOT flag to pass through, since it is supported by the HW as well. Signed-off-by: Andrey Smirnov Cc: Archit T

Re: [PATCH v2 00/15] tc358767 driver improvements

2019-03-24 Thread Andrey Smirnov
On Fri, Mar 22, 2019 at 1:06 AM Tomi Valkeinen wrote: > > Hi, > > On 22/03/2019 05:28, Andrey Smirnov wrote: > > Everyone: > > > > This series contains various improvements (at least in my mind) and > > fixes that I made to tc358767 while working with the c

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

2019-03-24 Thread Andrey Smirnov
On Fri, Mar 22, 2019 at 3:51 AM Tomi Valkeinen wrote: > > On 22/03/2019 05:28, Andrey Smirnov wrote: > > Simplify AUX data write by dropping index arithmetic and shifting and > > replacing it with a call to a helper function that does three things: > > > > 1. Co

[PATCH v2 04/15] drm/bridge: tc358767: Simplify tc_set_video_mode()

2019-03-24 Thread Andrey Smirnov
Simplify tc_set_video_mode() by replacing repreated calls to tc_write()/regmap_write() with a single call to regmap_multi_reg_write(). While at it, simplify explicit shifting by using macros from . No functional change intended. Signed-off-by: Andrey Smirnov Cc: Archit Taneja Cc: Andrzej Hajda

[PATCH v2 01/15] drm/bridge: tc358767: Simplify tc_poll_timeout()

2019-03-24 Thread Andrey Smirnov
onal change intended. Signed-off-by: Andrey Smirnov Reviewed-by: Andrzej Hajda Reviewed-by: Laurent Pinchart 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-devel@lists.freedeskt

[PATCH v2 12/15] drm/bridge: tc358767: Introduce tc_pllupdate_pllen()

2019-03-24 Thread Andrey Smirnov
-off-by: Andrey Smirnov Reviewed-by: Laurent Pinchart 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-devel@lists.freedesktop.org Cc: linux-ker...@vger.kernel.org --- drivers/gpu/drm

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

2019-03-24 Thread Andrey Smirnov
On Fri, Mar 22, 2019 at 3:29 AM Tomi Valkeinen wrote: > > On 22/03/2019 05:28, Andrey Smirnov wrote: > > A very unfortunate aspect of tc_write()/tc_read() macro helpers is > > that they capture quite a bit of context around them and thus require > > the caller to have m

[PATCH v2 08/15] drm/bridge: tc358767: Increase AUX transfer length limit

2019-03-24 Thread Andrey Smirnov
case of I2C transfers), so limit it to 15. 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-devel@lists.freedesktop.org Cc: linux-ker...@vger.kernel.org

Re: [PATCH v2 04/15] drm/bridge: tc358767: Simplify tc_set_video_mode()

2019-03-24 Thread Andrey Smirnov
On Fri, Mar 22, 2019 at 3:19 AM Tomi Valkeinen wrote: > > On 22/03/2019 05:28, Andrey Smirnov wrote: > > Simplify tc_set_video_mode() by replacing repreated calls to > > tc_write()/regmap_write() with a single call to > > regmap_multi_reg_write(). While at it, simpl

[PATCH v2 06/15] drm/bridge: tc358767: Simplify AUX data read

2019-03-24 Thread Andrey Smirnov
-by: Andrey Smirnov --- drivers/gpu/drm/bridge/tc358767.c | 39 --- 1 file changed, 26 insertions(+), 13 deletions(-) diff --git a/drivers/gpu/drm/bridge/tc358767.c b/drivers/gpu/drm/bridge/tc358767.c index 060e4b05095a..81c10a5d8106 100644 --- a/drivers/gpu/drm

[PATCH v2 13/15] drm/bridge: tc358767: Simplify tc_aux_wait_busy()

2019-03-24 Thread Andrey Smirnov
We never pass anything but 100 as timeout_ms to tc_aux_wait_busy(), so we may as well hardcode that value and simplify function's signature. Signed-off-by: Andrey Smirnov Cc: Archit Taneja Cc: Andrzej Hajda Cc: Laurent Pinchart Cc: Tomi Valkeinen Cc: Andrey Gusakov Cc: Philipp Zabe

  1   2   >