From: Lee Jones <lee.jones@linaro.org>
To: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Cc: Jonathan Cameron <jic23@kernel.org>,
Olof Johansson <olof@lixom.net>,
bleung@chromium.org, martinez.javier@gmail.com,
Guenter Roeck <groeck@chromium.org>,
Gwendal Grignou <gwendal@chromium.org>,
linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org,
rtc-linux@googlegroups.com
Subject: [rtc-linux] Re: [PATCH v2 2/5] mfd: cros_ec: Get rid of cros_ec_check_features from cros_ec_dev.
Date: Tue, 11 Apr 2017 10:19:42 +0100 [thread overview]
Message-ID: <20170411091942.gnitmzlrrke3hvjt@dell> (raw)
In-Reply-To: <20170403163536.25634-3-enric.balletbo@collabora.com>
On Mon, 03 Apr 2017, Enric Balletbo i Serra wrote:
> The cros_ec_dev driver should be used only to expose the Chrome OS Embedd=
ed
> Controller to user-space and should not be used to add MFD devices by
> calling mfd_add_devices. This patch moves this logic to the MFD cros_ec
> driver and removes the MFD bits from the character device driver. Also
> makes independent the IIO driver from the character device as also has no
> sense.
>=20
> Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
> Acked-by: Jonathan Cameron <jic23@kernel.org>
> ---
>=20
> As pointed by Lee Jones in this thread [1] we should not use the MFD AP=
I
> outside of MFD. For this reason the cros-ec-rtc did not get accepted yet.
> The reality is that we are calling mfd_add_devices from cros-ec-dev drive=
r
> already, so this patch get rid off the MFD calls inside the chardev drive=
r
> and moves to cros-ec MFD. Also I think the chardev device should simply
> implement the ioctl calls to access to it from userspace.
>=20
> Changes since v1:
> - Acked-by: Jonathan Cameron <jic23@kernel.org>
>=20
> [1] https://www.spinics.net/lists/kernel/msg2465099.html
>=20
> .../iio/common/cros_ec_sensors/cros_ec_sensors.c | 8 -
> .../common/cros_ec_sensors/cros_ec_sensors_core.c | 8 +-
> drivers/iio/light/cros_ec_light_prox.c | 8 -
> drivers/iio/pressure/cros_ec_baro.c | 8 -
> drivers/mfd/cros_ec.c | 160 +++++++++++++++=
+++++
> drivers/platform/chrome/cros_ec_dev.c | 161 ---------------=
------
Did you create this patch with "-M"?
This also requires a drivers/platform Ack.
> include/linux/mfd/cros_ec.h | 6 +-
> 7 files changed, 170 insertions(+), 189 deletions(-)
>=20
> diff --git a/drivers/iio/common/cros_ec_sensors/cros_ec_sensors.c b/drive=
rs/iio/common/cros_ec_sensors/cros_ec_sensors.c
> index 38e8783..9b53a01 100644
> --- a/drivers/iio/common/cros_ec_sensors/cros_ec_sensors.c
> +++ b/drivers/iio/common/cros_ec_sensors/cros_ec_sensors.c
> @@ -191,19 +191,11 @@ static const struct iio_info ec_sensors_info =3D {
> static int cros_ec_sensors_probe(struct platform_device *pdev)
> {
> struct device *dev =3D &pdev->dev;
> - struct cros_ec_dev *ec_dev =3D dev_get_drvdata(dev->parent);
> - struct cros_ec_device *ec_device;
> struct iio_dev *indio_dev;
> struct cros_ec_sensors_state *state;
> struct iio_chan_spec *channel;
> int ret, i;
> =20
> - if (!ec_dev || !ec_dev->ec_dev) {
> - dev_warn(&pdev->dev, "No CROS EC device found.\n");
> - return -EINVAL;
> - }
> - ec_device =3D ec_dev->ec_dev;
> -
> indio_dev =3D devm_iio_device_alloc(&pdev->dev, sizeof(*state));
> if (!indio_dev)
> return -ENOMEM;
> diff --git a/drivers/iio/common/cros_ec_sensors/cros_ec_sensors_core.c b/=
drivers/iio/common/cros_ec_sensors/cros_ec_sensors_core.c
> index 416cae5..0cdb64a 100644
> --- a/drivers/iio/common/cros_ec_sensors/cros_ec_sensors_core.c
> +++ b/drivers/iio/common/cros_ec_sensors/cros_ec_sensors_core.c
> @@ -41,12 +41,13 @@ int cros_ec_sensors_core_init(struct platform_device =
*pdev,
> {
> struct device *dev =3D &pdev->dev;
> struct cros_ec_sensors_core_state *state =3D iio_priv(indio_dev);
> - struct cros_ec_dev *ec =3D dev_get_drvdata(pdev->dev.parent);
> + struct cros_ec_device *ec_dev =3D dev_get_drvdata(pdev->dev.parent);
> struct cros_ec_sensor_platform *sensor_platform =3D dev_get_platdata(de=
v);
> =20
> platform_set_drvdata(pdev, indio_dev);
> =20
> - state->ec =3D ec->ec_dev;
> + state->ec =3D ec_dev;
> +
> state->msg =3D devm_kzalloc(&pdev->dev,
> max((u16)sizeof(struct ec_params_motion_sense),
> state->ec->max_response), GFP_KERNEL);
> @@ -59,7 +60,8 @@ int cros_ec_sensors_core_init(struct platform_device *p=
dev,
> =20
> /* Set up the host command structure. */
> state->msg->version =3D 2;
> - state->msg->command =3D EC_CMD_MOTION_SENSE_CMD + ec->cmd_offset;
> + state->msg->command =3D EC_CMD_MOTION_SENSE_CMD +
> + sensor_platform->cmd_offset;
> state->msg->outsize =3D sizeof(struct ec_params_motion_sense);
> =20
> indio_dev->dev.parent =3D &pdev->dev;
> diff --git a/drivers/iio/light/cros_ec_light_prox.c b/drivers/iio/light/c=
ros_ec_light_prox.c
> index 7217223..2133ddc 100644
> --- a/drivers/iio/light/cros_ec_light_prox.c
> +++ b/drivers/iio/light/cros_ec_light_prox.c
> @@ -181,19 +181,11 @@ static const struct iio_info cros_ec_light_prox_inf=
o =3D {
> static int cros_ec_light_prox_probe(struct platform_device *pdev)
> {
> struct device *dev =3D &pdev->dev;
> - struct cros_ec_dev *ec_dev =3D dev_get_drvdata(dev->parent);
> - struct cros_ec_device *ec_device;
> struct iio_dev *indio_dev;
> struct cros_ec_light_prox_state *state;
> struct iio_chan_spec *channel;
> int ret;
> =20
> - if (!ec_dev || !ec_dev->ec_dev) {
> - dev_warn(dev, "No CROS EC device found.\n");
> - return -EINVAL;
> - }
> - ec_device =3D ec_dev->ec_dev;
> -
> indio_dev =3D devm_iio_device_alloc(dev, sizeof(*state));
> if (!indio_dev)
> return -ENOMEM;
> diff --git a/drivers/iio/pressure/cros_ec_baro.c b/drivers/iio/pressure/c=
ros_ec_baro.c
> index 48b2a30..dbea18b 100644
> --- a/drivers/iio/pressure/cros_ec_baro.c
> +++ b/drivers/iio/pressure/cros_ec_baro.c
> @@ -126,19 +126,11 @@ static const struct iio_info cros_ec_baro_info =3D =
{
> static int cros_ec_baro_probe(struct platform_device *pdev)
> {
> struct device *dev =3D &pdev->dev;
> - struct cros_ec_dev *ec_dev =3D dev_get_drvdata(dev->parent);
> - struct cros_ec_device *ec_device;
> struct iio_dev *indio_dev;
> struct cros_ec_baro_state *state;
> struct iio_chan_spec *channel;
> int ret;
> =20
> - if (!ec_dev || !ec_dev->ec_dev) {
> - dev_warn(dev, "No CROS EC device found.\n");
> - return -EINVAL;
> - }
> - ec_device =3D ec_dev->ec_dev;
> -
> indio_dev =3D devm_iio_device_alloc(dev, sizeof(*state));
> if (!indio_dev)
> return -ENOMEM;
> diff --git a/drivers/mfd/cros_ec.c b/drivers/mfd/cros_ec.c
> index d4a407e..bbc17ab 100644
> --- a/drivers/mfd/cros_ec.c
> +++ b/drivers/mfd/cros_ec.c
> @@ -84,6 +84,160 @@ static int cros_ec_sleep_event(struct cros_ec_device =
*ec_dev, u8 sleep_event)
> return cros_ec_cmd_xfer(ec_dev, &buf.msg);
> }
> =20
> +static int cros_ec_check_features(struct cros_ec_device *ec_dev, int fea=
ture)
> +{
> + struct cros_ec_command *msg;
> + int ret;
> +
> + if (ec_dev->features[0] =3D=3D -1U && ec_dev->features[1] =3D=3D -1U) {
> + /* features bitmap not read yet */
> +
> + msg =3D kmalloc(sizeof(*msg) + sizeof(ec_dev->features),
> + GFP_KERNEL);
> + if (!msg)
> + return -ENOMEM;
> +
> + msg->version =3D 0;
> + msg->command =3D EC_CMD_GET_FEATURES + ec_p.cmd_offset;
> + msg->insize =3D sizeof(ec_dev->features);
> + msg->outsize =3D 0;
> +
> + ret =3D cros_ec_cmd_xfer(ec_dev, msg);
> + if (ret < 0 || msg->result !=3D EC_RES_SUCCESS) {
> + dev_warn(ec_dev->dev, "cannot get EC features: %d/%d\n",
> + ret, msg->result);
> + memset(ec_dev->features, 0, sizeof(ec_dev->features));
> + }
> +
> + memcpy(ec_dev->features, msg->data, sizeof(ec_dev->features));
> +
> + dev_dbg(ec_dev->dev, "EC features %08x %08x\n",
> + ec_dev->features[0], ec_dev->features[1]);
> +
> + kfree(msg);
> + }
> +
> + return ec_dev->features[feature / 32] & EC_FEATURE_MASK_0(feature);
> +}
> +
> +static void cros_ec_sensors_register(struct cros_ec_device *ec_dev)
> +{
> + /*
> + * Issue a command to get the number of sensor reported.
> + * Build an array of sensors driver and register them all.
> + */
> + int ret, i, id, sensor_num;
> + struct mfd_cell *sensor_cells;
> + struct cros_ec_sensor_platform *sensor_platforms;
> + int sensor_type[MOTIONSENSE_TYPE_MAX];
> + struct ec_params_motion_sense *params;
> + struct ec_response_motion_sense *resp;
> + struct cros_ec_command *msg;
> +
> + msg =3D kzalloc(sizeof(struct cros_ec_command) +
> + max(sizeof(*params), sizeof(*resp)), GFP_KERNEL);
> + if (msg =3D=3D NULL)
> + return;
> +
> + msg->version =3D 2;
> + msg->command =3D EC_CMD_MOTION_SENSE_CMD + ec_p.cmd_offset;
> + msg->outsize =3D sizeof(*params);
> + msg->insize =3D sizeof(*resp);
> +
> + params =3D (struct ec_params_motion_sense *)msg->data;
> + params->cmd =3D MOTIONSENSE_CMD_DUMP;
> +
> + ret =3D cros_ec_cmd_xfer(ec_dev, msg);
> + if (ret < 0 || msg->result !=3D EC_RES_SUCCESS) {
> + dev_warn(ec_dev->dev, "cannot get EC sensor information: %d/%d\n",
> + ret, msg->result);
> + goto error;
> + }
> +
> + resp =3D (struct ec_response_motion_sense *)msg->data;
> + sensor_num =3D resp->dump.sensor_count;
> + /* Allocate 2 extra sensors in case lid angle or FIFO are needed */
> + sensor_cells =3D kzalloc(sizeof(struct mfd_cell) * (sensor_num + 2),
> + GFP_KERNEL);
> + if (sensor_cells =3D=3D NULL)
> + goto error;
> +
> + sensor_platforms =3D kzalloc(sizeof(struct cros_ec_sensor_platform) *
> + (sensor_num + 1), GFP_KERNEL);
> + if (sensor_platforms =3D=3D NULL)
> + goto error_platforms;
> +
> + memset(sensor_type, 0, sizeof(sensor_type));
> + id =3D 0;
> + for (i =3D 0; i < sensor_num; i++) {
> + params->cmd =3D MOTIONSENSE_CMD_INFO;
> + params->info.sensor_num =3D i;
> + ret =3D cros_ec_cmd_xfer(ec_dev, msg);
> + if (ret < 0 || msg->result !=3D EC_RES_SUCCESS) {
> + dev_warn(ec_dev->dev, "no info for EC sensor %d : %d/%d\n",
> + i, ret, msg->result);
> + continue;
> + }
> + switch (resp->info.type) {
> + case MOTIONSENSE_TYPE_ACCEL:
> + sensor_cells[id].name =3D "cros-ec-accel";
> + break;
> + case MOTIONSENSE_TYPE_BARO:
> + sensor_cells[id].name =3D "cros-ec-baro";
> + break;
> + case MOTIONSENSE_TYPE_GYRO:
> + sensor_cells[id].name =3D "cros-ec-gyro";
> + break;
> + case MOTIONSENSE_TYPE_MAG:
> + sensor_cells[id].name =3D "cros-ec-mag";
> + break;
> + case MOTIONSENSE_TYPE_PROX:
> + sensor_cells[id].name =3D "cros-ec-prox";
> + break;
> + case MOTIONSENSE_TYPE_LIGHT:
> + sensor_cells[id].name =3D "cros-ec-light";
> + break;
> + case MOTIONSENSE_TYPE_ACTIVITY:
> + sensor_cells[id].name =3D "cros-ec-activity";
> + break;
> + default:
> + dev_warn(ec_dev->dev, "unknown type %d\n",
> + resp->info.type);
> + continue;
> + }
> + sensor_platforms[id].sensor_num =3D i;
> + sensor_platforms[id].cmd_offset =3D ec_p.cmd_offset;
> + sensor_cells[id].id =3D sensor_type[resp->info.type];
> + sensor_cells[id].platform_data =3D &sensor_platforms[id];
> + sensor_cells[id].pdata_size =3D
> + sizeof(struct cros_ec_sensor_platform);
> +
> + sensor_type[resp->info.type]++;
> + id++;
> + }
> + if (sensor_type[MOTIONSENSE_TYPE_ACCEL] >=3D 2) {
> + sensor_platforms[id].sensor_num =3D sensor_num;
> +
> + sensor_cells[id].name =3D "cros-ec-angle";
> + sensor_cells[id].id =3D 0;
> + sensor_cells[id].platform_data =3D &sensor_platforms[id];
> + sensor_cells[id].pdata_size =3D
> + sizeof(struct cros_ec_sensor_platform);
> + id++;
> + }
> +
> + ret =3D mfd_add_devices(ec_dev->dev, PLATFORM_DEVID_AUTO, sensor_cells,
> + id, NULL, 0, NULL);
> + if (ret)
> + dev_err(ec_dev->dev, "failed to add EC sensors\n");
> +
> + kfree(sensor_platforms);
> +error_platforms:
> + kfree(sensor_cells);
> +error:
> + kfree(msg);
> +}
> +
> int cros_ec_register(struct cros_ec_device *ec_dev)
> {
> struct device *dev =3D ec_dev->dev;
> @@ -94,6 +248,8 @@ int cros_ec_register(struct cros_ec_device *ec_dev)
> ec_dev->max_request =3D sizeof(struct ec_params_hello);
> ec_dev->max_response =3D sizeof(struct ec_response_get_protocol_info);
> ec_dev->max_passthru =3D 0;
> + ec_dev->features[0] =3D -1U; /* Not cached yet */
> + ec_dev->features[1] =3D -1U; /* Not cached yet */
> =20
> ec_dev->din =3D devm_kzalloc(dev, ec_dev->din_size, GFP_KERNEL);
> if (!ec_dev->din)
> @@ -127,6 +283,10 @@ int cros_ec_register(struct cros_ec_device *ec_dev)
> goto fail_mfd;
> }
> =20
> + /* Check whether this EC is a sensor hub. */
> + if (cros_ec_check_features(ec_dev, EC_FEATURE_MOTION_SENSE))
> + cros_ec_sensors_register(ec_dev);
> +
> if (ec_dev->max_passthru) {
> /*
> * Register a PD device as well on top of this device.
> diff --git a/drivers/platform/chrome/cros_ec_dev.c b/drivers/platform/chr=
ome/cros_ec_dev.c
> index b9bf086..4947650 100644
> --- a/drivers/platform/chrome/cros_ec_dev.c
> +++ b/drivers/platform/chrome/cros_ec_dev.c
> @@ -90,41 +90,6 @@ static int ec_get_version(struct cros_ec_dev *ec, char=
*str, int maxlen)
> return ret;
> }
> =20
> -static int cros_ec_check_features(struct cros_ec_dev *ec, int feature)
> -{
> - struct cros_ec_command *msg;
> - int ret;
> -
> - if (ec->features[0] =3D=3D -1U && ec->features[1] =3D=3D -1U) {
> - /* features bitmap not read yet */
> -
> - msg =3D kmalloc(sizeof(*msg) + sizeof(ec->features), GFP_KERNEL);
> - if (!msg)
> - return -ENOMEM;
> -
> - msg->version =3D 0;
> - msg->command =3D EC_CMD_GET_FEATURES + ec->cmd_offset;
> - msg->insize =3D sizeof(ec->features);
> - msg->outsize =3D 0;
> -
> - ret =3D cros_ec_cmd_xfer(ec->ec_dev, msg);
> - if (ret < 0 || msg->result !=3D EC_RES_SUCCESS) {
> - dev_warn(ec->dev, "cannot get EC features: %d/%d\n",
> - ret, msg->result);
> - memset(ec->features, 0, sizeof(ec->features));
> - }
> -
> - memcpy(ec->features, msg->data, sizeof(ec->features));
> -
> - dev_dbg(ec->dev, "EC features %08x %08x\n",
> - ec->features[0], ec->features[1]);
> -
> - kfree(msg);
> - }
> -
> - return ec->features[feature / 32] & EC_FEATURE_MASK_0(feature);
> -}
> -
> /* Device file ops */
> static int ec_device_open(struct inode *inode, struct file *filp)
> {
> @@ -268,126 +233,6 @@ static void __remove(struct device *dev)
> kfree(ec);
> }
> =20
> -static void cros_ec_sensors_register(struct cros_ec_dev *ec)
> -{
> - /*
> - * Issue a command to get the number of sensor reported.
> - * Build an array of sensors driver and register them all.
> - */
> - int ret, i, id, sensor_num;
> - struct mfd_cell *sensor_cells;
> - struct cros_ec_sensor_platform *sensor_platforms;
> - int sensor_type[MOTIONSENSE_TYPE_MAX];
> - struct ec_params_motion_sense *params;
> - struct ec_response_motion_sense *resp;
> - struct cros_ec_command *msg;
> -
> - msg =3D kzalloc(sizeof(struct cros_ec_command) +
> - max(sizeof(*params), sizeof(*resp)), GFP_KERNEL);
> - if (msg =3D=3D NULL)
> - return;
> -
> - msg->version =3D 2;
> - msg->command =3D EC_CMD_MOTION_SENSE_CMD + ec->cmd_offset;
> - msg->outsize =3D sizeof(*params);
> - msg->insize =3D sizeof(*resp);
> -
> - params =3D (struct ec_params_motion_sense *)msg->data;
> - params->cmd =3D MOTIONSENSE_CMD_DUMP;
> -
> - ret =3D cros_ec_cmd_xfer(ec->ec_dev, msg);
> - if (ret < 0 || msg->result !=3D EC_RES_SUCCESS) {
> - dev_warn(ec->dev, "cannot get EC sensor information: %d/%d\n",
> - ret, msg->result);
> - goto error;
> - }
> -
> - resp =3D (struct ec_response_motion_sense *)msg->data;
> - sensor_num =3D resp->dump.sensor_count;
> - /* Allocate 2 extra sensors in case lid angle or FIFO are needed */
> - sensor_cells =3D kzalloc(sizeof(struct mfd_cell) * (sensor_num + 2),
> - GFP_KERNEL);
> - if (sensor_cells =3D=3D NULL)
> - goto error;
> -
> - sensor_platforms =3D kzalloc(sizeof(struct cros_ec_sensor_platform) *
> - (sensor_num + 1), GFP_KERNEL);
> - if (sensor_platforms =3D=3D NULL)
> - goto error_platforms;
> -
> - memset(sensor_type, 0, sizeof(sensor_type));
> - id =3D 0;
> - for (i =3D 0; i < sensor_num; i++) {
> - params->cmd =3D MOTIONSENSE_CMD_INFO;
> - params->info.sensor_num =3D i;
> - ret =3D cros_ec_cmd_xfer(ec->ec_dev, msg);
> - if (ret < 0 || msg->result !=3D EC_RES_SUCCESS) {
> - dev_warn(ec->dev, "no info for EC sensor %d : %d/%d\n",
> - i, ret, msg->result);
> - continue;
> - }
> - switch (resp->info.type) {
> - case MOTIONSENSE_TYPE_ACCEL:
> - sensor_cells[id].name =3D "cros-ec-accel";
> - break;
> - case MOTIONSENSE_TYPE_BARO:
> - sensor_cells[id].name =3D "cros-ec-baro";
> - break;
> - case MOTIONSENSE_TYPE_GYRO:
> - sensor_cells[id].name =3D "cros-ec-gyro";
> - break;
> - case MOTIONSENSE_TYPE_MAG:
> - sensor_cells[id].name =3D "cros-ec-mag";
> - break;
> - case MOTIONSENSE_TYPE_PROX:
> - sensor_cells[id].name =3D "cros-ec-prox";
> - break;
> - case MOTIONSENSE_TYPE_LIGHT:
> - sensor_cells[id].name =3D "cros-ec-light";
> - break;
> - case MOTIONSENSE_TYPE_ACTIVITY:
> - sensor_cells[id].name =3D "cros-ec-activity";
> - break;
> - default:
> - dev_warn(ec->dev, "unknown type %d\n", resp->info.type);
> - continue;
> - }
> - sensor_platforms[id].sensor_num =3D i;
> - sensor_cells[id].id =3D sensor_type[resp->info.type];
> - sensor_cells[id].platform_data =3D &sensor_platforms[id];
> - sensor_cells[id].pdata_size =3D
> - sizeof(struct cros_ec_sensor_platform);
> -
> - sensor_type[resp->info.type]++;
> - id++;
> - }
> - if (sensor_type[MOTIONSENSE_TYPE_ACCEL] >=3D 2) {
> - sensor_platforms[id].sensor_num =3D sensor_num;
> -
> - sensor_cells[id].name =3D "cros-ec-angle";
> - sensor_cells[id].id =3D 0;
> - sensor_cells[id].platform_data =3D &sensor_platforms[id];
> - sensor_cells[id].pdata_size =3D
> - sizeof(struct cros_ec_sensor_platform);
> - id++;
> - }
> - if (cros_ec_check_features(ec, EC_FEATURE_MOTION_SENSE_FIFO)) {
> - sensor_cells[id].name =3D "cros-ec-ring";
> - id++;
> - }
> -
> - ret =3D mfd_add_devices(ec->dev, 0, sensor_cells, id,
> - NULL, 0, NULL);
> - if (ret)
> - dev_err(ec->dev, "failed to add EC sensors\n");
> -
> - kfree(sensor_platforms);
> -error_platforms:
> - kfree(sensor_cells);
> -error:
> - kfree(msg);
> -}
> -
> static int ec_device_probe(struct platform_device *pdev)
> {
> int retval =3D -ENOMEM;
> @@ -402,8 +247,6 @@ static int ec_device_probe(struct platform_device *pd=
ev)
> ec->ec_dev =3D dev_get_drvdata(dev->parent);
> ec->dev =3D dev;
> ec->cmd_offset =3D ec_platform->cmd_offset;
> - ec->features[0] =3D -1U; /* Not cached yet */
> - ec->features[1] =3D -1U; /* Not cached yet */
> device_initialize(&ec->class_dev);
> cdev_init(&ec->cdev, &fops);
> =20
> @@ -432,10 +275,6 @@ static int ec_device_probe(struct platform_device *p=
dev)
> if (cros_ec_debugfs_init(ec))
> dev_warn(dev, "failed to create debugfs directory\n");
> =20
> - /* check whether this EC is a sensor hub. */
> - if (cros_ec_check_features(ec, EC_FEATURE_MOTION_SENSE))
> - cros_ec_sensors_register(ec);
> -
> /* Take control of the lightbar from the EC. */
> lb_manual_suspend_ctrl(ec, 1);
> =20
> diff --git a/include/linux/mfd/cros_ec.h b/include/linux/mfd/cros_ec.h
> index 3b16c90..8f87999 100644
> --- a/include/linux/mfd/cros_ec.h
> +++ b/include/linux/mfd/cros_ec.h
> @@ -115,6 +115,7 @@ struct cros_ec_command {
> * @event_notifier: interrupt event notifier for transport devices.
> * @event_data: raw payload transferred with the MKBP event.
> * @event_size: size in bytes of the event data.
> + * @features: stores the EC features.
> */
> struct cros_ec_device {
> =20
> @@ -149,15 +150,19 @@ struct cros_ec_device {
> =20
> struct ec_response_get_next_event event_data;
> int event_size;
> + u32 features[2];
> };
> =20
> /**
> * struct cros_ec_sensor_platform - ChromeOS EC sensor platform informat=
ion
> *
> * @sensor_num: Id of the sensor, as reported by the EC.
> + * @cmd_offset: offset to apply for each command. Set when
> + * registering a devicde behind another one.
> */
> struct cros_ec_sensor_platform {
> u8 sensor_num;
> + u16 cmd_offset;
> };
> =20
> /* struct cros_ec_platform - ChromeOS EC platform information
> @@ -191,7 +196,6 @@ struct cros_ec_dev {
> struct device *dev;
> struct cros_ec_debugfs *debug_info;
> u16 cmd_offset;
> - u32 features[2];
> };
> =20
> /**
--=20
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org =E2=94=82 Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--=20
You received this message because you are subscribed to "rtc-linux".
Membership options at http://groups.google.com/group/rtc-linux .
Please read http://groups.google.com/group/rtc-linux/web/checklist
before submitting a driver.
---=20
You received this message because you are subscribed to the Google Groups "=
rtc-linux" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to rtc-linux+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
next prev parent reply other threads:[~2017-04-11 9:19 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-03 16:35 [rtc-linux] [PATCH v2 0/5] mfd: cros-ec: Some fixes and improvements Enric Balletbo i Serra
2017-04-03 16:35 ` [rtc-linux] [PATCH v2 1/5] mfd: cros-ec: Fix host command buffer size Enric Balletbo i Serra
2017-04-11 9:18 ` [rtc-linux] " Lee Jones
2017-04-03 16:35 ` [rtc-linux] [PATCH v2 2/5] mfd: cros_ec: Get rid of cros_ec_check_features from cros_ec_dev Enric Balletbo i Serra
2017-04-11 9:19 ` Lee Jones [this message]
2017-04-20 9:40 ` [rtc-linux] " Enric Balletbo i Serra
2017-04-03 16:35 ` [rtc-linux] [PATCH v2 3/5] mfd: cros_ec: Introduce RTC commands and events definitions Enric Balletbo i Serra
2017-04-03 16:35 ` [rtc-linux] [PATCH v2 4/5] rtc: cros-ec: add cros-ec-rtc driver Enric Balletbo i Serra
2017-04-03 16:35 ` [rtc-linux] [PATCH v2 5/5] mfd: cros_ec: add RTC as mfd subdevice Enric Balletbo i Serra
2017-04-11 9:48 ` [rtc-linux] " Lee Jones
2017-04-20 9:59 ` Enric Balletbo i Serra
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=20170411091942.gnitmzlrrke3hvjt@dell \
--to=lee.jones@linaro.org \
--cc=bleung@chromium.org \
--cc=enric.balletbo@collabora.com \
--cc=groeck@chromium.org \
--cc=gwendal@chromium.org \
--cc=jic23@kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=martinez.javier@gmail.com \
--cc=olof@lixom.net \
--cc=rtc-linux@googlegroups.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