Re: [PATCH] drm/bridge: parade-ps8640: Add backpointer to drm_device in drm_dp_aux

2021-12-07 Thread Philip Chen
Hi On Tue, Dec 7, 2021 at 8:13 AM Doug Anderson wrote: > > Hi, > > On Mon, Dec 6, 2021 at 5:44 PM Philip Chen wrote: > > > > Hi > > > > On Mon, Dec 6, 2021 at 4:29 PM Douglas Anderson > > wrote: > > > > > > When we added the su

Re: [PATCH] drm/bridge: parade-ps8640: Add backpointer to drm_device in drm_dp_aux

2021-12-06 Thread Philip Chen
drm_bridge *bridge, > if (!(flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR)) > return -EINVAL; > > + ps_bridge->aux.drm_dev = bridge->dev; > ret = drm_dp_aux_register(_bridge->aux); > if (ret) { > dev_err(dev, "failed to register DP AUX channel: %d\n", ret); > -- > 2.34.1.400.ga245620fadb-goog > Signed-off-by: Philip Chen

[PATCH] drm/msm/dsi: set default num_data_lanes

2021-10-30 Thread Philip Chen
input/output endpoint of the controller is expected to have 4 lanes. So let's set num_data_lanes to 4 by default. Signed-off-by: Philip Chen --- drivers/gpu/drm/msm/dsi/dsi_host.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/msm/dsi/dsi_host.c b/drivers/gpu/drm/msm/dsi/dsi

Re: [PATCH v5 1/2] drm/bridge: parade-ps8640: Enable runtime power management

2021-10-28 Thread Philip Chen
Add "Sam Ravnborg " to cc list for vis. Remove "Andrzej Hajda " from cc list as the address can't be found. On Thu, Oct 28, 2021 at 10:58 AM Philip Chen wrote: > > Fit ps8640 driver into runtime power management framework: > > First, break _poweron() to 3 p

[PATCH v5 2/2] drm/bridge: parade-ps8640: Populate devices on aux-bus

2021-10-28 Thread Philip Chen
evice tree. In this case, panel driver can retrieve EDID by triggering AUX transactions, without ps8640_bridge_get_edid() calls at all. To prevent the "old" and "new" options from interfering with each other's logic flow, disable DRM_BRIDGE_OP_EDID when the new option is taken. Signed

[PATCH v5 1/2] drm/bridge: parade-ps8640: Enable runtime power management

2021-10-28 Thread Philip Chen
s no reason to check there. The other user of "powered", _get_edid(), only cares if pre_enable() has already been called. Lastly, change some existing DRM_...() logging to dev_...() along the way, since DRM_...() seem to be deprecated in [1]. [1] https://patchwork.freedesktop.org/patch/

Re: [PATCH v4 1/2] drm/bridge: parade-ps8640: Enable runtime power management

2021-10-27 Thread Philip Chen
Hi Doug, On Wed, Oct 27, 2021 at 3:08 PM Doug Anderson wrote: > > Hi, > > On Tue, Oct 26, 2021 at 2:56 PM Philip Chen wrote: > > > > Fit ps8640 driver into runtime power management framework: > > > > First, break _poweron() to 3 parts: (1) turn on power an

Re: [PATCH v4 2/2] drm/bridge: parade-ps8640: Populate devices on aux-bus

2021-10-27 Thread Philip Chen
Hi Doug On Wed, Oct 27, 2021 at 3:13 PM Doug Anderson wrote: > > Hi, > > On Tue, Oct 26, 2021 at 2:56 PM Philip Chen wrote: > > > > Conventionally, panel is listed under the root of the device tree. > > When userland asks for display mode, ps8640 bridge is resp

[PATCH v4 2/2] drm/bridge: parade-ps8640: Populate devices on aux-bus

2021-10-26 Thread Philip Chen
evice tree. In this case, panel driver can retrieve EDID by triggering AUX transactions, without ps8640_bridge_get_edid() calls at all. To prevent the "old" and "new" options from interfering with each other's logic flow, disable DRM_BRIDGE_OP_EDID when the new option is taken. Signed

[PATCH v4 1/2] drm/bridge: parade-ps8640: Enable runtime power management

2021-10-26 Thread Philip Chen
s no reason to check there. The other user of "powered", _get_edid(), only cares if pre_enable() has already been called. Lastly, change some existing DRM_...() logging to dev_...() along the way, since DRM_...() seem to be deprecated in [1]. [1] https://patchwork.freedesktop.org/patch/

Re: [PATCH v3 1/2] drm/bridge: parade-ps8640: Enable runtime power management

2021-10-26 Thread Philip Chen
Hi On Tue, Oct 26, 2021 at 12:36 PM Stephen Boyd wrote: > > Quoting Philip Chen (2021-10-26 12:11:09) > > Fit ps8640 driver into runtime power management framework: > > > > First, break _poweron() to 3 parts: (1) turn on power and wait for > > ps8640's internal MCU

Re: [PATCH v2 1/2] drm/bridge: parade-ps8640: Enable runtime power management

2021-10-26 Thread Philip Chen
Hi On Mon, Oct 25, 2021 at 1:05 PM Stephen Boyd wrote: > > Quoting Philip Chen (2021-10-21 14:05:59) > > Fit ps8640 driver into runtime power management framework: > > > > First, break _poweron() to 3 parts: (1) turn on power and wait for > > ps8640's internal MCU

[PATCH v3 2/2] drm/bridge: parade-ps8640: Populate devices on aux-bus

2021-10-26 Thread Philip Chen
evice tree. In this case, panel driver can retrieve EDID by triggering AUX transactions, without ps8640_bridge_get_edid() calls at all. To prevent the "old" and "new" options from interfering with each other's logic flow, disable DRM_BRIDGE_OP_EDID when the new option is taken. Signed

[PATCH v3 1/2] drm/bridge: parade-ps8640: Enable runtime power management

2021-10-26 Thread Philip Chen
s no reason to check there. The other user of "powered", _get_edid(), only cares if pre_enable() has already been called. Lastly, change some existing DRM_...() logging to dev_...() along the way, since DRM_...() seem to be deprecated in [1]. [1] https://patchwork.freedesktop.org/patch/

Re: [PATCH v2 2/2] drm/bridge: parade-ps8640: Populate devices on aux-bus

2021-10-26 Thread Philip Chen
Hi, On Mon, Oct 25, 2021 at 1:10 PM Stephen Boyd wrote: > > Quoting Philip Chen (2021-10-21 14:06:00) > > diff --git a/drivers/gpu/drm/bridge/parade-ps8640.c > > b/drivers/gpu/drm/bridge/parade-ps8640.c > > index 220ca3b03d24..f99a2e0808b7 100644 > > --- a/drivers/

Re: [PATCH] drm/bridge: Fix the bridge chain order for pre_enable / post_disable

2021-10-21 Thread Philip Chen
Hi Doug, I see this patch fixes the order for drm_bridge_chain_pre_enable() and drm_atomic_bridge_chain_post_disable(). For completeness, shouldn't we also fix the order for drm_atomic_bridge_chain_pre_enable() and drm_bridge_chain_post_disable()? Surely, if Sam's pending patches will land

Re: [PATCH 2/2] drm/bridge: parade-ps8640: Populate devices on aux-bus

2021-10-21 Thread Philip Chen
Hi Doug, On Mon, Oct 18, 2021 at 1:43 PM Doug Anderson wrote: > > Hi, > > On Sat, Oct 16, 2021 at 9:57 AM Philip Chen wrote: > > > > Conventionally, panel is listed under the root in the device tree. > > When userland asks for display mode, ps8640 bridge is resp

Re: [PATCH 1/2] drm/bridge: parade-ps8640: Enable runtime power management

2021-10-21 Thread Philip Chen
Hi Doug, On Mon, Oct 18, 2021 at 1:43 PM Doug Anderson wrote: > > Hi, > > On Sat, Oct 16, 2021 at 9:57 AM Philip Chen wrote: > > > > @@ -319,81 +345,70 @@ static void ps8640_bridge_poweron(struct ps8640 > > *ps_bridge) > > */ > >

[PATCH v2 2/2] drm/bridge: parade-ps8640: Populate devices on aux-bus

2021-10-21 Thread Philip Chen
evice tree. In this case, panel driver can retrieve EDID by triggering AUX transactions, without ps8640_bridge_get_edid() calls at all. To prevent the "old" and "new" options from interfering with each other's logic flow, disable DRM_BRIDGE_OP_EDID when the new option is take

[PATCH v2 1/2] drm/bridge: parade-ps8640: Enable runtime power management

2021-10-21 Thread Philip Chen
s no reason to check there. The other user of "powered", _get_edid(), only cares if pre_enable() has already been called. Lastly, change some existing DRM_...() logging to dev_...() along the way, since DRM_...() seem to be deprecated in [1]. [1] https://patchwork.freedesktop.org/patch/454760/ Signed

[PATCH 2/2] drm/bridge: parade-ps8640: Populate devices on aux-bus

2021-10-16 Thread Philip Chen
evice tree. In this case, panel driver can retrieve EDID by triggering AUX transactions, without ps8640_bridge_get_edid() calls at all. To prevent the "old" and "new" options from interfering with each other's logic flow, disable DRM_BRIDGE_OP_EDID when the new option is take

[PATCH 1/2] drm/bridge: parade-ps8640: Enable runtime power management

2021-10-16 Thread Philip Chen
here. The other user of "powered", _get_edid(), only cares if pre_enable() has already been called. Lastly, change some existing DRM_...() logging to dev_...() along the way, since DRM_...() seem to be deprecated in [1]. [1] https://patchwork.freedesktop.org/patch/454760/ Signed-off-by:

[PATCH v2 2/3] dt-bindings: drm/bridge: ps8640: Add aux-bus child

2021-09-29 Thread Philip Chen
dp-aux-bus.yaml says we can list an eDP panel as a child of an eDP controller node to represent the fact that the panel is connected to the controller's DP AUX bus. Let's add it to the ps8640 bindings. Signed-off-by: Philip Chen --- (no changes since v1) .../bindings/display/bridge/ps8640

Re: [PATCH v5 2/2] drm/bridge: parade-ps8640: Add support for AUX channel

2021-09-21 Thread Philip Chen
Hi On Tue, Sep 21, 2021 at 9:02 AM Doug Anderson wrote: > > Hi, > > On Sat, Sep 18, 2021 at 10:21 AM Philip Chen wrote: > > > > +static ssize_t ps8640_aux_transfer(struct drm_dp_aux *aux, > > + struct drm_dp_aux_msg *msg) &g

[PATCH v6 2/2] drm/bridge: parade-ps8640: Add support for AUX channel

2021-09-21 Thread Philip Chen
Implement the first version of AUX support, which will be useful as we expand the driver to support varied use cases. Reviewed-by: Sam Ravnborg Signed-off-by: Philip Chen --- Changes in v6: - Error check the aux address is no greater than 20 bits - Read RDATA into a u32 variable and then copy

[PATCH v6 1/2] drm/bridge: parade-ps8640: Use regmap APIs

2021-09-21 Thread Philip Chen
Replace the direct i2c access (i2c_smbus_* functions) with regmap APIs, which will simplify the future update on ps8640 driver. Reviewed-by: Douglas Anderson Acked-by: Sam Ravnborg Signed-off-by: Philip Chen --- (no changes since v4) Changes in v4: - Remove excessive error logging from

Re: [PATCH v5 2/2] drm/bridge: parade-ps8640: Add support for AUX channel

2021-09-20 Thread Philip Chen
Hi Sam, On Sat, Sep 18, 2021 at 1:29 PM Sam Ravnborg wrote: > > Hi Philip, > On Sat, Sep 18, 2021 at 10:21:17AM -0700, Philip Chen wrote: > > Implement the first version of AUX support, which will be useful as > > we expand the driver to support varied use cases. > >

[PATCH v5 2/2] drm/bridge: parade-ps8640: Add support for AUX channel

2021-09-18 Thread Philip Chen
Implement the first version of AUX support, which will be useful as we expand the driver to support varied use cases. Signed-off-by: Philip Chen --- Changes in v5: - Add a couple of syntax fixes accidentally uncommited in v4 Changes in v4: - Fix aux_transfer function: - Replace dev_err

[PATCH v5 1/2] drm/bridge: parade-ps8640: Use regmap APIs

2021-09-18 Thread Philip Chen
Replace the direct i2c access (i2c_smbus_* functions) with regmap APIs, which will simplify the future update on ps8640 driver. Reviewed-by: Douglas Anderson Signed-off-by: Philip Chen --- (no changes since v4) Changes in v4: - Remove excessive error logging from the probe function Changes

Re: [PATCH v3 3/3] drm/bridge: parade-ps8640: Add support for AUX channel

2021-09-17 Thread Philip Chen
Hi On Tue, Sep 14, 2021 at 5:57 PM Stephen Boyd wrote: > > Quoting Philip Chen (2021-09-14 16:28:45) > > diff --git a/drivers/gpu/drm/bridge/parade-ps8640.c > > b/drivers/gpu/drm/bridge/parade-ps8640.c > > index 8d3e7a147170..dc349d729f5a 100644 > > --- a/drivers/

Re: [PATCH v3 3/3] drm/bridge: parade-ps8640: Add support for AUX channel

2021-09-17 Thread Philip Chen
Hi On Thu, Sep 16, 2021 at 1:31 PM Doug Anderson wrote: > > Hi, > > On Thu, Sep 16, 2021 at 1:15 PM Stephen Boyd wrote: > > > > > > > + return ret; > > > > > + } > > > > > + > > > > > + /* Assume it's good */ > > > > > + msg->reply = 0; > > > > > + > > > > > +

Re: [PATCH v3 2/3] drm/bridge: parade-ps8640: Use regmap APIs

2021-09-17 Thread Philip Chen
Hi Doug and Stephen, Thanks for the review. Before we reach a consensus on the best logging option, I'll just remove the printouts from this patch and just return PTR_ERR. Once we reach a consensus, we can probably improve logging in a separate patch. On Fri, Sep 17, 2021 at 8:02 AM Doug

Re: [PATCH v3 1/3] drm/bridge: parade-ps8640: Improve logging at probing

2021-09-17 Thread Philip Chen
Stephen Boyd wrote: > > Quoting Philip Chen (2021-09-14 16:28:43) > > Use dev_err_probe() to add logs for error cases at probing time. > > > > Signed-off-by: Philip Chen > > --- > > > > Can you use a cover-letter for more than one patch series? > >

[PATCH v4 2/2] drm/bridge: parade-ps8640: Add support for AUX channel

2021-09-17 Thread Philip Chen
Implement the first version of AUX support, which will be useful as we expand the driver to support varied use cases. Signed-off-by: Philip Chen --- Changes in v4: - Fix aux_transfer function: - Replace dev_err with DRM_DEV_ERROR - Reorg the bit manipulation around address/len/request

[PATCH v4 1/2] drm/bridge: parade-ps8640: Use regmap APIs

2021-09-17 Thread Philip Chen
Replace the direct i2c access (i2c_smbus_* functions) with regmap APIs, which will simplify the future update on ps8640 driver. Reviewed-by: Douglas Anderson Signed-off-by: Philip Chen --- Changes in v4: - Remove excessive error logging from the probe function Changes in v3: - Fix the nits

Re: [PATCH v3 3/3] drm/bridge: parade-ps8640: Add support for AUX channel

2021-09-15 Thread Philip Chen
Hi Fabio On Wed, Sep 15, 2021 at 2:00 PM Fabio Estevam wrote: > > On Wed, Sep 15, 2021 at 5:41 PM Philip Chen wrote: > > > As regmap_read() should always read 1 byte at a time, should I just do: > > regmap_read(map, PAGE0_SWAUX_RDATA, (unsigned int*)(buf + i)) > > The

Re: [PATCH v3 3/3] drm/bridge: parade-ps8640: Add support for AUX channel

2021-09-15 Thread Philip Chen
Hi On Tue, Sep 14, 2021 at 5:57 PM Stephen Boyd wrote: > > Quoting Philip Chen (2021-09-14 16:28:45) > > diff --git a/drivers/gpu/drm/bridge/parade-ps8640.c > > b/drivers/gpu/drm/bridge/parade-ps8640.c > > index 8d3e7a147170..dc349d729f5a 100644 > > --- a/drivers/

Re: [RFC PATCH v2 2/2] drm/bridge: parade-ps8640: Add support for AUX channel

2021-09-14 Thread Philip Chen
Hi On Mon, Sep 13, 2021 at 4:43 PM Doug Anderson wrote: > > Hi, > > On Mon, Sep 13, 2021 at 2:33 PM Philip Chen wrote: > > > > Implement the first version of AUX support, which will be useful as > > we expand the driver to support varied use cases. > >

Re: [RFC PATCH v2 1/2] drm/bridge: parade-ps8640: Use regmap APIs

2021-09-14 Thread Philip Chen
Hi, Doug Thanks for the review. I fixed the nits you pointed out in v3. PTAL. On Mon, Sep 13, 2021 at 5:32 PM Doug Anderson wrote: > > Hi, > > On Mon, Sep 13, 2021 at 2:33 PM Philip Chen wrote: > > > > diff --git a/drivers/gpu/drm/bridge/parade-ps8640.c > > b

[PATCH v3 2/3] drm/bridge: parade-ps8640: Use regmap APIs

2021-09-14 Thread Philip Chen
Replace the direct i2c access (i2c_smbus_* functions) with regmap APIs, which will simplify the future update on ps8640 driver. Reviewed-by: Douglas Anderson Signed-off-by: Philip Chen --- Changes in v3: - Fix the nits from v2 review Changes in v2: - Add separate reg map config per page

[PATCH v3 3/3] drm/bridge: parade-ps8640: Add support for AUX channel

2021-09-14 Thread Philip Chen
Implement the first version of AUX support, which will be useful as we expand the driver to support varied use cases. Signed-off-by: Philip Chen --- Changes in v3: - Verify with HW and thus remove WARNING from the patch description - Fix the reg names to better match the manual - Fix

[PATCH v3 1/3] drm/bridge: parade-ps8640: Improve logging at probing

2021-09-14 Thread Philip Chen
Use dev_err_probe() to add logs for error cases at probing time. Signed-off-by: Philip Chen --- (no changes since v1) drivers/gpu/drm/bridge/parade-ps8640.c | 22 ++ 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/bridge/parade-ps8640.c b

Re: [PATCH 1/2] drm/bridge: parade-ps8640: Use regmap APIs

2021-09-13 Thread Philip Chen
On Thu, Sep 9, 2021 at 2:27 PM Stephen Boyd wrote: > > Quoting Doug Anderson (2021-09-09 14:14:29) > > On Thu, Sep 9, 2021 at 12:09 PM Stephen Boyd wrote: > > > > > > > > > Oh does this have register pages? regmap has support for pages where you > > > write some indirection register and then

Re: [PATCH 2/2] drm/bridge: parade-ps8640: Add support for AUX channel

2021-09-13 Thread Philip Chen
On Thu, Sep 9, 2021 at 12:07 PM Stephen Boyd wrote: > > Quoting Philip Chen (2021-09-09 11:15:27) > > On Wed, Sep 8, 2021 at 3:27 PM Stephen Boyd wrote: > > > > > > Quoting Philip Chen (2021-09-08 11:18:06) > > > > > > > +

[RFC PATCH v2 2/2] drm/bridge: parade-ps8640: Add support for AUX channel

2021-09-13 Thread Philip Chen
in practice. Signed-off-by: Philip Chen --- Changes in v2: - Handle the case where an AUX transaction has no payload - Add a reg polling for p0.0x83 to confirm AUX cmd is issued and read data is returned - Replace regmap_noinc_read/write with looped regmap_read/write, as regmap_noinc_read/write doesn't

[RFC PATCH v2 1/2] drm/bridge: parade-ps8640: Use regmap APIs

2021-09-13 Thread Philip Chen
Replace the direct i2c access (i2c_smbus_* functions) with regmap APIs, which will simplify the future update on ps8640 driver. Signed-off-by: Philip Chen --- Changes in v2: - Add separate reg map config per page drivers/gpu/drm/bridge/parade-ps8640.c | 89 ++ 1 file

Re: [PATCH 1/2] drm/bridge: parade-ps8640: Use regmap APIs

2021-09-09 Thread Philip Chen
Hi, On Wed, Sep 8, 2021 at 2:54 PM Stephen Boyd wrote: > > Quoting Philip Chen (2021-09-08 11:18:05) > > diff --git a/drivers/gpu/drm/bridge/parade-ps8640.c > > b/drivers/gpu/drm/bridge/parade-ps8640.c > > index 685e9c38b2db..a16725dbf912 100644 > > --- a/drivers/

Re: [PATCH 2/2] drm/bridge: parade-ps8640: Add support for AUX channel

2021-09-09 Thread Philip Chen
Hi, On Wed, Sep 8, 2021 at 3:27 PM Stephen Boyd wrote: > > Quoting Philip Chen (2021-09-08 11:18:06) > > diff --git a/drivers/gpu/drm/bridge/parade-ps8640.c > > b/drivers/gpu/drm/bridge/parade-ps8640.c > > index a16725dbf912..3f0241a60357 100644 > > --- a/drivers/

[PATCH 2/2] drm/bridge: parade-ps8640: Add support for AUX channel

2021-09-08 Thread Philip Chen
Implement the first version of AUX support, which will be useful as we expand the driver to support varied use cases. Signed-off-by: Philip Chen --- drivers/gpu/drm/bridge/parade-ps8640.c | 123 + 1 file changed, 123 insertions(+) diff --git a/drivers/gpu/drm/bridge

[PATCH 1/2] drm/bridge: parade-ps8640: Use regmap APIs

2021-09-08 Thread Philip Chen
Replace the direct i2c access (i2c_smbus_* functions) with regmap APIs, which will simplify the future update on ps8640 driver. Signed-off-by: Philip Chen --- drivers/gpu/drm/bridge/parade-ps8640.c | 66 +++--- 1 file changed, 39 insertions(+), 27 deletions(-) diff --git

Re: [PATCH] drm/bridge: parade-ps8640: Reorg the macros

2021-08-24 Thread Philip Chen
Hi, On Tue, Aug 24, 2021 at 3:37 PM Doug Anderson wrote: > > Hi, > > On Fri, Aug 20, 2021 at 4:22 PM Philip Chen wrote: > > > > From: Philip Chen > > > > Reorg the macros as follows: > > (1) Group the registers on the same page together. > &

[PATCH v2] drm/bridge: parade-ps8640: Reorg the macros

2021-08-24 Thread Philip Chen
Reorg the macros as follows: (1) Group the registers on the same page together. (2) Group the register and its bit operation together while indenting the macros of the bit operation with one space. Also fix a misnomer for the number of mipi data lanes. Signed-off-by: Philip Chen --- Changes

[PATCH] drm/bridge: parade-ps8640: Reorg the macros

2021-08-21 Thread Philip Chen
From: Philip Chen Reorg the macros as follows: (1) Group the registers on the same page together. (2) Group the register and its bit operation together while indenting the macros of the bit operation with one space. Also fix a misnomer for the number of mipi data lanes. Signed-off-by: Philip