All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
From: Johan Hedberg <johan.hedberg@gmail.com>
To: Simon Wood <simon@mungewell.org>
Cc: linux-bluetooth@vger.kernel.org, Marcel Holtmann <marcel@holtmann.org>
Subject: Re: [PATCH] bccmd - add ability to read ADC
Date: Wed, 17 Jun 2015 15:48:42 +0300	[thread overview]
Message-ID: <20150617124842.GA17715@t440s.P-661HNU-F1> (raw)
In-Reply-To: <1433786660-2169-1-git-send-email-simon@mungewell.org>

Hi Simon,

On Mon, Jun 08, 2015, Simon Wood wrote:
> Some BlueCore devices are equipped with an 'Analogue In' pin which is
> internally connected to a MUX and ADC. This patch adds the ability to
> control the MUX and read the ADC.
> 
> The ADC is also connected internal to a temp sensor, which can also be
> read via this method.
> 
> The (only) MUX values expected to be used are:
> 1  Internal 1V25 reference
> 16 BlueCore01b pin Test_A; BlueCore2-External pin AIO0
> 17 BlueCore01b pin Test_B; BlueCore2-External pin AIO1
> 36 Chip’s internal temperature (change) sensor. BlueCore2-ROM and later only.
> 
> The MUX can also select other (undocumented) test points.
> 
> Example usage
> --
> $ ./bccmd -t HCI -d hci1 adc 17
> ADC value from Mux 0x11 : 0x0054 (valid)
> $ ./bccmd -t HCI -d hci1 adc 1
> ADC value from Mux 0x01 : 0x00b2 (valid)
> 
> Signed-off-by: Simon Wood <simon@mungewell.org>

No Signed-off-by lines for user space patches please.

> +static int cmd_adc(int transport, int argc, char *argv[])
> +{
> +	uint8_t array[8];
> +	uint16_t mux, value;
> +	int err;
> +
> +	OPT_HELP(1, NULL);
> +
> +	if (!strncasecmp(argv[0], "0x", 2))
> +		mux = strtol(argv[0], NULL, 16);
> +	else
> +		mux = atoi(argv[0]);
> +
> +	// Request an ADC read from a particular mux'ed input

No C++ style comments please. Use /* ... */

> +	// sleep, then read result

Same here.

And the patch doesn't actually compile:

tools/bccmd.c:1068:2: error: implicit declaration of function ‘usleep’ [-Werror=implicit-function-declaration]
  usleep(50000);
  ^

Please add the necessary include for that (unistd.h, I believe).

Johan

  reply	other threads:[~2015-06-17 12:48 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-27 15:32 [Patch] bccmd - add ability to read ADC simon
2015-06-06  5:49 ` Marcel Holtmann
2015-06-08 18:04   ` [PATCH] " Simon Wood
2015-06-17 12:48     ` Johan Hedberg [this message]
2015-06-17 15:16       ` simon

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=20150617124842.GA17715@t440s.P-661HNU-F1 \
    --to=johan.hedberg@gmail.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=marcel@holtmann.org \
    --cc=simon@mungewell.org \
    /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.