linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hartmut Knaack <knaack.h@gmx.de>
To: Karol Wrona <k.wrona@samsung.com>,
	Jonathan Cameron <jic23@kernel.org>,
	linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>,
	Kyungmin Park <kyungmin.park@samsung.com>,
	Karol Wrona <wrona.vy@gmail.com>
Subject: Re: [PATCH v3 5/5] iio: common: ssp_sensors: Add sensorhub gyroscope sensor
Date: Wed, 17 Dec 2014 23:20:38 +0100	[thread overview]
Message-ID: <549201B6.1070502@gmx.de> (raw)
In-Reply-To: <1417809290-9662-6-git-send-email-k.wrona@samsung.com>

Karol Wrona schrieb am 05.12.2014 um 20:54:
> This patch adds gyroscope iio driver which uses sensorhub as data
> provider.
> 
This one has got a more serious issue.
> Change-Id: Ia16bc92159d062a29957de8e62ea3fefdcd7985a
> Signed-off-by: Karol Wrona <k.wrona@samsung.com>
> Acked-by: Kyungmin Park <kyungmin.park@samsung.com>
> ---
>  drivers/iio/gyro/Makefile          |    2 +
>  drivers/iio/gyro/ssp_gyro_sensor.c |  202 ++++++++++++++++++++++++++++++++++++
>  2 files changed, 204 insertions(+)
>  create mode 100644 drivers/iio/gyro/ssp_gyro_sensor.c
> 

> +static int ssp_gyro_probe(struct platform_device *pdev)
> +{
> +	int ret;
> +	struct iio_dev *indio_dev;
> +	struct ssp_sensor_data *spd;
> +
> +	indio_dev = iio_device_alloc(sizeof(*spd));
Need to use devm_iio_device_alloc(), since iio_device_free() has been dropped.
> +	if (!indio_dev)
> +		return -ENOMEM;
> +
> +	spd = iio_priv(indio_dev);
> +
> +	spd->process_data = ssp_process_gyro_data;
> +	spd->type = SSP_GYROSCOPE_SENSOR;
> +
> +	indio_dev->name = ssp_gyro_name;
> +	indio_dev->dev.parent = &pdev->dev;
> +	indio_dev->info = &ssp_gyro_iio_info;
> +	indio_dev->modes = INDIO_BUFFER_HARDWARE;
> +	indio_dev->channels = ssp_gyro_channels;
> +	indio_dev->num_channels = ARRAY_SIZE(ssp_gyro_channels);
> +
> +	ret = ssp_common_setup_buffer(indio_dev, &ssp_gyro_buffer_ops);
> +	if (ret < 0) {
> +		dev_err(&pdev->dev, "Buffer setup fail\n");
> +		return ret;
> +	}
> +
> +	platform_set_drvdata(pdev, indio_dev);
> +
> +	ret = iio_device_register(indio_dev);
> +	if (ret < 0) {
> +		iio_buffer_unregister(indio_dev);
> +		iio_kfifo_free(indio_dev->buffer);
> +		return ret;
> +	};
> +
> +	/* similar to accel */
> +	ssp_register_consumer(indio_dev, SSP_GYROSCOPE_SENSOR);
> +
> +	return 0;
> +}
> +
> +static int ssp_gyro_remove(struct platform_device *pdev)
> +{
> +	struct iio_dev *indio_dev = platform_get_drvdata(pdev);
> +
> +	iio_device_unregister(indio_dev);
> +	iio_buffer_unregister(indio_dev);
> +	iio_kfifo_free(indio_dev->buffer);
> +
> +	return 0;
> +}
> +
> +static const struct of_device_id ssp_gyro_id_table[] = {
> +	{
> +		.compatible = "samsung,mpu6500-gyro",
> +	},
> +	{},
> +};
> +
> +static struct platform_driver ssp_gyro_driver = {
> +	.driver = {
> +		.owner = THIS_MODULE,
> +		.name = SSP_GYROSCOPE_NAME,
> +		.of_match_table = ssp_gyro_id_table,
> +	},
> +	.probe = ssp_gyro_probe,
> +	.remove = ssp_gyro_remove,
> +};
> +
> +module_platform_driver(ssp_gyro_driver);
> +
> +MODULE_AUTHOR("Karol Wrona <k.wrona@samsung.com>");
> +MODULE_DESCRIPTION("Samsung sensorhub gyroscopes driver");
> +MODULE_LICENSE("GPL");
> 


  parent reply	other threads:[~2014-12-17 22:20 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-05 19:54 [PATCH v3 0/5] iio: common: ssp_sensors: Add sensorhub driver Karol Wrona
2014-12-05 19:54 ` [PATCH v3 1/5] " Karol Wrona
2014-12-06 14:09   ` Jonathan Cameron
2014-12-16 10:17     ` Karol Wrona
2014-12-26 12:27       ` Jonathan Cameron
2014-12-17 22:11   ` Hartmut Knaack
2014-12-05 19:54 ` [PATCH v3 2/5] iio: sensorhub: Add sensorhub bindings Karol Wrona
2014-12-06 14:29   ` Jonathan Cameron
2014-12-16  7:30     ` Karol Wrona
2014-12-26 12:29       ` Jonathan Cameron
2014-12-05 19:54 ` [PATCH v3 3/5] iio: common: ssp_sensors: Add sensorhub iio commons Karol Wrona
2014-12-06 14:39   ` Jonathan Cameron
2015-01-13 16:03     ` Karol Wrona
2015-01-13 17:33       ` Jonathan Cameron
2014-12-17 22:15   ` Hartmut Knaack
2014-12-05 19:54 ` [PATCH v3 4/5] iio: common: ssp_sensors: Add sensorhub accelerometer sensor Karol Wrona
2014-12-06 14:52   ` Jonathan Cameron
2014-12-08 10:41     ` Karol Wrona
2014-12-26 12:34       ` Jonathan Cameron
2014-12-17 22:18   ` Hartmut Knaack
2014-12-05 19:54 ` [PATCH v3 5/5] iio: common: ssp_sensors: Add sensorhub gyroscope sensor Karol Wrona
2014-12-06 14:53   ` Jonathan Cameron
2014-12-17 22:20   ` Hartmut Knaack [this message]
2014-12-05 20:13 ` [PATCH v3 0/5] iio: common: ssp_sensors: Add sensorhub driver Karol Wrona

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=549201B6.1070502@gmx.de \
    --to=knaack.h@gmx.de \
    --cc=b.zolnierkie@samsung.com \
    --cc=jic23@kernel.org \
    --cc=k.wrona@samsung.com \
    --cc=kyungmin.park@samsung.com \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=wrona.vy@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 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).