mirror of
https://github.com/torvalds/linux.git
synced 2026-07-28 01:55:51 +02:00
drm/bridge: ite-it6263: Move chip initialization code from probe to atomic_enable
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>
Reviewed-by: Liu Ying <victor.liu@nxp.com>
Link: https://patch.msgid.link/20260501061200.20129-1-biju.das.jz@bp.renesas.com
Signed-off-by: Liu Ying <victor.liu@nxp.com>
This commit is contained in:
parent
3cc5d7a595
commit
6d0cc72b3a
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user