linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Togorean, Bogdan" <Bogdan.Togorean@analog.com>
To: "dri-devel@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>,
	"narmstrong@baylibre.com" <narmstrong@baylibre.com>
Cc: "Laurent.pinchart@ideasonboard.com" 
	<Laurent.pinchart@ideasonboard.com>,
	"airlied@linux.ie" <airlied@linux.ie>,
	"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
	"sam@ravnborg.org" <sam@ravnborg.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"tglx@linutronix.de" <tglx@linutronix.de>,
	"matt.redfearn@thinci.com" <matt.redfearn@thinci.com>,
	"allison@lohutok.net" <allison@lohutok.net>,
	"robh+dt@kernel.org" <robh+dt@kernel.org>
Subject: Re: [PATCH 2/2] drm: bridge: adv7511: Add support for ADV7535
Date: Thu, 1 Aug 2019 11:43:28 +0000	[thread overview]
Message-ID: <6714fb6a454e8085ada559b085db2557befdeeb4.camel@analog.com> (raw)
In-Reply-To: <797f1c00-b76d-fef8-93d2-a2b52d266065@baylibre.com>

Hi Neil,

Thank you for review.

On Wed, 2019-07-31 at 09:42 +0200, Neil Armstrong wrote:
> [External]
> 
> Hi Bogdan,
> 
> On 30/07/2019 15:17, Bogdan Togorean wrote:
> > ADV7535 is a DSI to HDMI bridge chip like ADV7533 but it allows
> > 1080p@60Hz. v1p2 is fixed to 1.8V on ADV7535 but on ADV7533 can be
> > 1.2V
> > or 1.8V and is configurable in a register.
> > 
> > Signed-off-by: Bogdan Togorean <bogdan.togorean@analog.com>
> > ---
> >  drivers/gpu/drm/bridge/adv7511/adv7511.h     |  2 ++
> >  drivers/gpu/drm/bridge/adv7511/adv7511_drv.c | 31 +++++++++++++++-
> > ----
> >  2 files changed, 25 insertions(+), 8 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/bridge/adv7511/adv7511.h
> > b/drivers/gpu/drm/bridge/adv7511/adv7511.h
> > index 52b2adfdc877..702432615ec8 100644
> > --- a/drivers/gpu/drm/bridge/adv7511/adv7511.h
> > +++ b/drivers/gpu/drm/bridge/adv7511/adv7511.h
> > @@ -91,6 +91,7 @@
> >  #define ADV7511_REG_ARC_CTRL			0xdf
> >  #define ADV7511_REG_CEC_I2C_ADDR		0xe1
> >  #define ADV7511_REG_CEC_CTRL			0xe2
> > +#define ADV7511_REG_SUPPLY_SELECT		0xe4
> >  #define ADV7511_REG_CHIP_ID_HIGH		0xf5
> >  #define ADV7511_REG_CHIP_ID_LOW			0xf6
> >  
> > @@ -320,6 +321,7 @@ struct adv7511_video_config {
> >  enum adv7511_type {
> >  	ADV7511,
> >  	ADV7533,
> > +	ADV7535,
> >  };
> >  
> >  #define ADV7511_MAX_ADDRS 3
> > diff --git a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
> > b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
> > index f6d2681f6927..941072decb73 100644
> > --- a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
> > +++ b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
> > @@ -367,7 +367,7 @@ static void adv7511_power_on(struct adv7511
> > *adv7511)
> >  	 */
> >  	regcache_sync(adv7511->regmap);
> >  
> > -	if (adv7511->type == ADV7533)
> > +	if (adv7511->type == ADV7533 || adv7511->type == ADV7535)
> >  		adv7533_dsi_power_on(adv7511);
> >  	adv7511->powered = true;
> >  }
> > @@ -387,7 +387,7 @@ static void __adv7511_power_off(struct adv7511
> > *adv7511)
> >  static void adv7511_power_off(struct adv7511 *adv7511)
> >  {
> >  	__adv7511_power_off(adv7511);
> > -	if (adv7511->type == ADV7533)
> > +	if (adv7511->type == ADV7533 || adv7511->type == ADV7535)
> >  		adv7533_dsi_power_off(adv7511);
> >  	adv7511->powered = false;
> >  }
> > @@ -761,7 +761,7 @@ static void adv7511_mode_set(struct adv7511
> > *adv7511,
> >  	regmap_update_bits(adv7511->regmap, 0x17,
> >  		0x60, (vsync_polarity << 6) | (hsync_polarity << 5));
> >  
> > -	if (adv7511->type == ADV7533)
> > +	if (adv7511->type == ADV7533 || adv7511->type == ADV7535)
> >  		adv7533_mode_set(adv7511, adj_mode);
> >  
> >  	drm_mode_copy(&adv7511->curr_mode, adj_mode);
> > @@ -874,7 +874,7 @@ static int adv7511_bridge_attach(struct
> > drm_bridge *bridge)
> >  				 &adv7511_connector_helper_funcs);
> >  	drm_connector_attach_encoder(&adv->connector, bridge->encoder);
> >  
> > -	if (adv->type == ADV7533)
> > +	if (adv->type == ADV7533 || adv->type == ADV7535)
> >  		ret = adv7533_attach_dsi(adv);
> >  
> >  	if (adv->i2c_main->irq)
> > @@ -952,7 +952,7 @@ static bool
> > adv7511_cec_register_volatile(struct device *dev, unsigned int reg)
> >  	struct i2c_client *i2c = to_i2c_client(dev);
> >  	struct adv7511 *adv7511 = i2c_get_clientdata(i2c);
> >  
> > -	if (adv7511->type == ADV7533)
> > +	if (adv7511->type == ADV7533 || adv7511->type == ADV7535)
> >  		reg -= ADV7533_REG_CEC_OFFSET;
> >  
> >  	switch (reg) {
> > @@ -994,7 +994,7 @@ static int adv7511_init_cec_regmap(struct
> > adv7511 *adv)
> >  		goto err;
> >  	}
> >  
> > -	if (adv->type == ADV7533) {
> > +	if (adv->type == ADV7533 || adv->type == ADV7535) {
> >  		ret = adv7533_patch_cec_registers(adv);
> >  		if (ret)
> >  			goto err;
> > @@ -1094,8 +1094,9 @@ static int adv7511_probe(struct i2c_client
> > *i2c, const struct i2c_device_id *id)
> >  	struct adv7511_link_config link_config;
> >  	struct adv7511 *adv7511;
> >  	struct device *dev = &i2c->dev;
> > +	struct regulator *reg_v1p2;
> >  	unsigned int val;
> > -	int ret;
> > +	int ret, reg_v1p2_uV;
> >  
> >  	if (!dev->of_node)
> >  		return -EINVAL;
> > @@ -1163,6 +1164,18 @@ static int adv7511_probe(struct i2c_client
> > *i2c, const struct i2c_device_id *id)
> >  	if (ret)
> >  		goto uninit_regulators;
> >  
> > +	if (adv7511->type == ADV7533) {
> > +		ret = match_string(adv7533_supply_names, adv7511-
> > >num_supplies,
> > +									
> > "v1p2");
> > +		reg_v1p2 = adv7511->supplies[ret].consumer;
> > +		reg_v1p2_uV = regulator_get_voltage(reg_v1p2);
> > +
> > +		if (reg_v1p2_uV == 1200000) {
> > +			regmap_update_bits(adv7511->regmap,
> > +				ADV7511_REG_SUPPLY_SELECT, 0x80, 0x80);
> > +		}
> > +	}
> > +
> >  	adv7511_packet_disable(adv7511, 0xffff);
> >  
> >  	adv7511->i2c_edid = i2c_new_secondary_device(i2c, "edid",
> > @@ -1242,7 +1255,7 @@ static int adv7511_remove(struct i2c_client
> > *i2c)
> >  {
> >  	struct adv7511 *adv7511 = i2c_get_clientdata(i2c);
> >  
> > -	if (adv7511->type == ADV7533)
> > +	if (adv7511->type == ADV7533 || adv7511->type == ADV7535)
> >  		adv7533_detach_dsi(adv7511);
> >  	i2c_unregister_device(adv7511->i2c_cec);
> >  	if (adv7511->cec_clk)
> > @@ -1268,6 +1281,7 @@ static const struct i2c_device_id
> > adv7511_i2c_ids[] = {
> >  	{ "adv7513", ADV7511 },
> >  #ifdef CONFIG_DRM_I2C_ADV7533
> >  	{ "adv7533", ADV7533 },
> > +	{ "adv7535", ADV7535 },
> 
> Maybe you should add a new CONFIG_DRM_I2C_ADV7535 or update the
> current CONFIG_DRM_I2C_ADV7533 description.
I'll rename the config option as Laurent also suggested to
CONFIG_DRM_I2C_ADV753X and update its description. 
> 
> >  #endif
> >  	{ }
> >  };
> > @@ -1279,6 +1293,7 @@ static const struct of_device_id
> > adv7511_of_ids[] = {
> >  	{ .compatible = "adi,adv7513", .data = (void *)ADV7511 },
> >  #ifdef CONFIG_DRM_I2C_ADV7533
> >  	{ .compatible = "adi,adv7533", .data = (void *)ADV7533 },
> > +	{ .compatible = "adi,adv7535", .data = (void *)ADV7535 },
> 
> Ditto
> 
> I'm not a adv75xx expert but it looks sane.
> 
> Neil
> 
> >  #endif
> >  	{ }
> >  };
> > 

  reply	other threads:[~2019-08-01 11:44 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-30 13:17 [PATCH 0/2] drm: bridge: adv7511: Add support For ADV7535 Bogdan Togorean
2019-07-30 13:17 ` [PATCH 1/2] dt-bindings: drm: bridge: adv7511: Add ADV7535 support Bogdan Togorean
2019-07-31  8:29   ` Laurent Pinchart
2019-07-30 13:17 ` [PATCH 2/2] drm: bridge: adv7511: Add support for ADV7535 Bogdan Togorean
2019-07-31  7:42   ` Neil Armstrong
2019-08-01 11:43     ` Togorean, Bogdan [this message]
2019-07-31  9:14   ` Laurent Pinchart
2019-08-01 12:10     ` Togorean, Bogdan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6714fb6a454e8085ada559b085db2557befdeeb4.camel@analog.com \
    --to=bogdan.togorean@analog.com \
    --cc=Laurent.pinchart@ideasonboard.com \
    --cc=airlied@linux.ie \
    --cc=allison@lohutok.net \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matt.redfearn@thinci.com \
    --cc=narmstrong@baylibre.com \
    --cc=robh+dt@kernel.org \
    --cc=sam@ravnborg.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).