All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexander Aring <alex.aring@gmail.com>
To: Stefan Schmidt <stefan@osg.samsung.com>
Cc: linux-wpan@vger.kernel.org, Stefan Schmidt <s.schmidt@samsung.com>
Subject: Re: [PATCHv2 bluetooth-next 2/4] ieee802154/atusb: Add .set_txpower operation to the driver
Date: Fri, 29 May 2015 11:19:23 +0200	[thread overview]
Message-ID: <20150529091922.GD3709@omega> (raw)
In-Reply-To: <1432889488-28420-3-git-send-email-stefan@osg.samsung.com>

On Fri, May 29, 2015 at 10:51:26AM +0200, Stefan Schmidt wrote:
> From: Stefan Schmidt <s.schmidt@samsung.com>
> 
> Atusb uses the at86rf231 transceiver so we can use the same calculation
> for txpower settings for it.
> 
> Signed-off-by: Stefan Schmidt <stefan@osg.samsung.com>
> ---
>  drivers/net/ieee802154/atusb.c | 26 ++++++++++++++++++++++++++
>  1 file changed, 26 insertions(+)
> 
> diff --git a/drivers/net/ieee802154/atusb.c b/drivers/net/ieee802154/atusb.c
> index 95d4220..9805ebe 100644
> --- a/drivers/net/ieee802154/atusb.c
> +++ b/drivers/net/ieee802154/atusb.c
> @@ -453,6 +453,26 @@ static void atusb_stop(struct ieee802154_hw *hw)
>  	atusb_get_and_clear_error(atusb);
>  }
>  
> +#define ATUSB_MAX_TX_POWERS 0xF
> +static const s32 atusb_powers[ATUSB_MAX_TX_POWERS + 1] = {
> +	300, 280, 230, 180, 130, 70, 0, -100, -200, -300, -400, -500, -700,
> +	-900, -1200, -1700,
> +};
> +
> +static int
> +atusb_set_txpower(struct ieee802154_hw *hw, s32 mbm)
> +{
> +	struct atusb *atusb = hw->priv;
> +	u32 i;
> +
> +	for (i = 0; i < hw->phy->supported.tx_powers_size; i++) {
> +		if (hw->phy->supported.tx_powers[i] == mbm)
> +			return atusb_write_subreg(atusb, SR_TX_PWR_23X, i);
> +	}
> +
> +	return -EINVAL;
> +}
> +

also the mapping looks different in at86rf230. Anyway, it's just a note.

- Alex

  reply	other threads:[~2015-05-29  9:19 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-29  8:51 [PATCHv2 bluetooth-next 0/4] Atusb driver improvements Stefan Schmidt
2015-05-29  8:51 ` [PATCHv2 bluetooth-next 1/4] ieee802154/atusb: Add function for partial register writes Stefan Schmidt
2015-05-29  8:51 ` [PATCHv2 bluetooth-next 2/4] ieee802154/atusb: Add .set_txpower operation to the driver Stefan Schmidt
2015-05-29  9:19   ` Alexander Aring [this message]
2015-05-29  9:27     ` Stefan Schmidt
2015-05-29  8:51 ` [PATCHv2 bluetooth-next 3/4] ieee802154/atusb: Add .set_promiscuous_mode driver operation Stefan Schmidt
2015-05-29  9:17   ` Alexander Aring
2015-05-29  8:51 ` [PATCHv2 bluetooth-next 4/4] MAINTAINERS: Add myself as maintainer for the atusb driver Stefan Schmidt
2015-05-29  9:03 ` [PATCHv2 bluetooth-next 0/4] Atusb driver improvements Varka Bhadram
2015-05-29  9:39 ` Alexander Aring
2015-05-29 13:41 ` Marcel Holtmann

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=20150529091922.GD3709@omega \
    --to=alex.aring@gmail.com \
    --cc=linux-wpan@vger.kernel.org \
    --cc=s.schmidt@samsung.com \
    --cc=stefan@osg.samsung.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.