Messages in this thread Patch in this message |  | | Subject | Re: [PATCH v4] drm/bridge: ite-it6263: Move chip initialization code from probe to atomic_enable | | From | Liu Ying <> | | Date | Tue, 05 May 2026 14:06:21 +0800 |
| |
# Add your code comments below. There is no need to trim or delete # any existing content -- just insert your comments under the relevant # lines of code. Lines starting with "> " are quoted diff context and # lines starting with "| " are comments from other reviewers. # The final email will be reformatted automatically to include only # the sections that have your comments. # > On the RZ/G3L SMARC EVK, suspend to RAM powers down the ITE IT6263 chip. > The display controller driver's system PM callbacks invoke > drm_mode_config_helper_{suspend,resume}, which in turn call the bridge's > atomic_{disable,enable} callbacks to handle suspend/resume for the bridge > without dedicated PM ops. > > To support proper reinitialization after power loss, move reset_gpio into > the it6263 struct so it is accessible beyond probe time. Relocate > it6263_hw_reset(), it6263_lvds_set_i2c_addr(), it6263_lvds_config() and > it6263_hdmi_config() from probe to atomic_enable, ensuring the chip is > fully reset and reconfigured on every enable, including after a > suspend/resume cycle. > > Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com> > > diff --git a/drivers/gpu/drm/bridge/ite-it6263.c b/drivers/gpu/drm/bridge/ite-it6263.c > index 2ea49245e700..4a8268d0eac2 100644 > --- a/drivers/gpu/drm/bridge/ite-it6263.c > +++ b/drivers/gpu/drm/bridge/ite-it6263.c > @@ -200,6 +200,7 @@ struct it6263 { > struct regmap *lvds_regmap; > struct drm_bridge bridge; > struct drm_bridge *next_bridge; > + struct gpio_desc *reset_gpio; > int lvds_data_mapping; > bool lvds_dual_link; > bool lvds_link12_swap; > @@ -603,6 +604,15 @@ static void it6263_bridge_atomic_enable(struct drm_bridge *bridge, > bool pclk_high; > int i, ret; > > + it6263_hw_reset(it->reset_gpio); > + > + ret = it6263_lvds_set_i2c_addr(it); > + if (ret) > + dev_err(it->dev, "failed to set I2C addr\n"); > + > + it6263_lvds_config(it); > + it6263_hdmi_config(it); > + > connector = drm_atomic_get_new_connector_for_encoder(state, > bridge->encoder); > crtc = drm_atomic_get_new_connector_state(state, connector)->crtc; > @@ -838,7 +848,6 @@ static const struct drm_bridge_funcs it6263_bridge_funcs = { > static int it6263_probe(struct i2c_client *client) > { > struct device *dev = &client->dev; > - struct gpio_desc *reset_gpio; > struct it6263 *it; > int ret; > > @@ -856,9 +865,9 @@ static int it6263_probe(struct i2c_client *client) > return dev_err_probe(dev, PTR_ERR(it->hdmi_regmap), > "failed to init I2C regmap for HDMI\n"); > > - reset_gpio = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_LOW); > - if (IS_ERR(reset_gpio)) > - return dev_err_probe(dev, PTR_ERR(reset_gpio), > + it->reset_gpio = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_LOW); > + if (IS_ERR(it->reset_gpio)) > + return dev_err_probe(dev, PTR_ERR(it->reset_gpio), > "failed to get reset gpio\n"); > > ret = devm_regulator_bulk_get_enable(dev, ARRAY_SIZE(it6263_supplies), > @@ -870,12 +879,6 @@ static int it6263_probe(struct i2c_client *client) > if (ret) > return ret; > > - it6263_hw_reset(reset_gpio); > - > - ret = it6263_lvds_set_i2c_addr(it); > - if (ret) > - return dev_err_probe(dev, ret, "failed to set I2C addr\n"); > - > it->lvds_i2c = devm_i2c_new_dummy_device(dev, client->adapter, > LVDS_INPUT_CTRL_I2C_ADDR); > if (IS_ERR(it->lvds_i2c)) > @@ -888,9 +891,6 @@ static int it6263_probe(struct i2c_client *client) > return dev_err_probe(dev, PTR_ERR(it->lvds_regmap), > "failed to init I2C regmap for LVDS\n"); > > - it6263_lvds_config(it); > - it6263_hdmi_config(it); > - > i2c_set_clientdata(client, it); > > it->bridge.of_node = dev->of_node;
Reviewed-by: Liu Ying <victor.liu@nxp.com>
-- Regards, Liu Ying
|  |