From: Joe Perches <joe@perches.com>
To: Octavian Purdila <octavian.purdila@intel.com>
Cc: gregkh@linuxfoundation.org, linus.walleij@linaro.org,
gnurou@gmail.com, wsa@the-dreams.de, sameo@linux.intel.com,
lee.jones@linaro.org, arnd@arndb.de, johan@kernel.org,
daniel.baluta@intel.com, laurentiu.palcu@intel.com,
linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-gpio@vger.kernel.org, linux-i2c@vger.kernel.org
Subject: Re: [PATCH v9 1/4] mfd: add support for Diolan DLN-2 devices
Date: Mon, 27 Oct 2014 09:57:49 -0700 [thread overview]
Message-ID: <1414429069.8884.10.camel@perches.com> (raw)
In-Reply-To: <1414427472-4100-2-git-send-email-octavian.purdila@intel.com>
On Mon, 2014-10-27 at 18:31 +0200, Octavian Purdila wrote:
> This patch implements the USB part of the Diolan USB-I2C/SPI/GPIO
> Master Adapter DLN-2. Details about the device can be found here:
trivia:
> diff --git a/drivers/mfd/dln2.c b/drivers/mfd/dln2.c
[]
> +static int _dln2_transfer(struct dln2_dev *dln2, u16 handle, u16 cmd,
> + const void *obuf, unsigned obuf_len,
> + void *ibuf, unsigned *ibuf_len)
> +{
> + int ret = 0;
> + int rx_slot;
> + struct dln2_response *rsp;
> + struct dln2_rx_context *rxc;
> + struct device *dev = &dln2->interface->dev;
> + const int timeout = DLN2_USB_TIMEOUT * HZ / 1000;
unsigned long timeout?
[]
> + ret = wait_for_completion_interruptible_timeout(&rxc->done, timeout);
> + if (ret <= 0) {
> + if (!ret)
> + ret = -ETIMEDOUT;
> + goto out_free_rx_slot;
> + }
[]
> +static int dln2_print_serialno(struct dln2_dev *dln2)
> +{
> + int ret;
> + __le32 serial_no;
> + int len = sizeof(serial_no);
> + struct device *dev = &dln2->interface->dev;
> +
> + ret = _dln2_transfer(dln2, DLN2_HANDLE_CTRL, CMD_GET_DEVICE_SN, NULL, 0,
> + &serial_no, &len);
> + if (ret < 0)
> + return ret;
> + if (len < sizeof(serial_no))
> + return -EREMOTEIO;
> +
> + dev_info(dev, "Diolan DLN2 serial 0x%x\n", le32_to_cpu(serial_no));
why a hex serial #?
next prev parent reply other threads:[~2014-10-27 16:57 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-27 16:31 [PATCH v9 0/4] mfd: add support for Diolan DLN-2 Octavian Purdila
2014-10-27 16:31 ` [PATCH v9 1/4] mfd: add support for Diolan DLN-2 devices Octavian Purdila
2014-10-27 16:57 ` Joe Perches [this message]
2014-10-28 13:25 ` Octavian Purdila
2014-11-05 15:48 ` Johan Hovold
2014-10-27 16:31 ` [PATCH v9 2/4] i2c: add support for Diolan DLN-2 USB-I2C adapter Octavian Purdila
2014-11-05 15:49 ` Johan Hovold
2014-10-27 16:31 ` [PATCH v9 3/4] gpiolib: add irq_not_threaded flag to gpio_chip Octavian Purdila
2014-10-27 16:31 ` [PATCH v9 4/4] gpio: add support for the Diolan DLN-2 USB GPIO driver Octavian Purdila
2014-11-05 15:45 ` Johan Hovold
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=1414429069.8884.10.camel@perches.com \
--to=joe@perches.com \
--cc=arnd@arndb.de \
--cc=daniel.baluta@intel.com \
--cc=gnurou@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=johan@kernel.org \
--cc=laurentiu.palcu@intel.com \
--cc=lee.jones@linaro.org \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=octavian.purdila@intel.com \
--cc=sameo@linux.intel.com \
--cc=wsa@the-dreams.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