All of lore.kernel.org
 help / color / mirror / Atom feed
From: Antti Palosaari <crope@iki.fi>
To: "nibble.max" <nibble.max@gmail.com>
Cc: linux-media <linux-media@vger.kernel.org>
Subject: Re: [PATCH 1/4 v2] support for DVBSky dvb-s2 usb: Add ts clock and clock polarity, lnb set voltage for m88ds3103
Date: Sun, 10 Aug 2014 01:16:45 +0300	[thread overview]
Message-ID: <53E69DCD.10804@iki.fi> (raw)
In-Reply-To: <201408081150404538007@gmail.com>

On 08/08/2014 06:50 AM, nibble.max wrote:
> Add ts clock and clock polarity, lnb set voltage.

> +static int m88ds3103_set_voltage(struct dvb_frontend *fe,
> +	fe_sec_voltage_t voltage)
> +{
> +	struct m88ds3103_priv *priv = fe->demodulator_priv;
> +	u8 data;
> +
> +	dev_dbg(&priv->i2c->dev, "%s: pin_ctrl = (%02x)\n",
> +			__func__, priv->cfg->pin_ctrl);
> +
> +	m88ds3103_rd_reg(priv, 0xa2, &data);
> +
> +	if (priv->cfg->pin_ctrl & 0x80) { /*If control pin is assigned.*/
> +		data &= ~0x03; /* bit0 V/H, bit1 off/on */
> +		if (priv->cfg->pin_ctrl & 0x02)
> +			data |= 0x02;
> +
> +		switch (voltage) {
> +		case SEC_VOLTAGE_18:
> +		     if ((priv->cfg->pin_ctrl & 0x01) == 0)
> +			data |= 0x01;
> +		     break;
> +		case SEC_VOLTAGE_13:
> +		     if (priv->cfg->pin_ctrl & 0x01)
> +			data |= 0x01;
> +		     break;
> +		case SEC_VOLTAGE_OFF:
> +		     if (priv->cfg->pin_ctrl & 0x02)
> +			data &= ~0x02;
> +		     else
> +			data |= 0x02;
> +		     break;
> +		}
> +	}
> +	m88ds3103_wr_reg(priv, 0xa2, data);
> +
> +	return 0;
> +}

> +	/*
> +	 * LNB pin control
> +	 *
> +	 */
> +	u8 pin_ctrl;

That do not do anything meaningful if pin_ctrl b7 is 0? I think our way 
to implement things is to set unneeded callbacks to NULL. DVB-core 
checks existence of each callback before calling - if callback is NULL 
it means it is not used. No need to add special driver specific 
configuration values.

Other LNB control bits are not documented in m88ds3103_config. What it 
looks, there is 2 other bits used too - b0 and b1.
b0 : polarity of vertical/horizontal output pin
b1 : polarity of LNB enable/disable output pin

I think better to define 2 one bit wide bit vector (like you did for 
ts_clk_pol) and set defaults (bit == zero) like reference design does.

After these changes I am fine with this driver and will apply it.

regards
Antti

-- 
http://palosaari.fi/

      reply	other threads:[~2014-08-09 22:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-08  3:50 [PATCH 1/4 v2] support for DVBSky dvb-s2 usb: Add ts clock and clock polarity, lnb set voltage for m88ds3103 nibble.max
2014-08-09 22:16 ` Antti Palosaari [this message]

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=53E69DCD.10804@iki.fi \
    --to=crope@iki.fi \
    --cc=linux-media@vger.kernel.org \
    --cc=nibble.max@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.