[PATCH 2/4] Limit max_discard_sectors to UINT_MAX>>9

2014-03-25 Thread Gwendal Grignou
max_discard_sectors can not be larger than UINT_MAX>>9, otherwise, there is a risk that discard requests would be merged into a request larger than 4GB. Signed-off-by: Gwendal Grignou --- block/blk-lib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/blk-lib.c b

[PATCH 4/4] Limit max_discard_sectors to UINT_MAX>>9

2014-03-25 Thread Gwendal Grignou
max_discard_sectors can not be larger than UINT_MAX>>9, otherwise, there is a risk that discard requests would be merged into a request larger than 4GB. Signed-off-by: Gwendal Grignou --- drivers/mtd/mtd_blkdevs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drive

[PATCH 0/4] Set max_discard_sectors maximal value to UINT_MAX>>9

2014-03-25 Thread Gwendal Grignou
512 bytes sectors. Gwendal Grignou (4): Limit max_discard_sectors to UINT_MAX>>9 Limit max_discard_sectors to UINT_MAX>>9 Limit max_discard_sectors to UINT_MAX>>9 Limit max_discard_sectors to UINT_MAX>>9 block/blk-lib.c | 2 +- drivers/block/nbd.c | 2

Re: [PATCH v4 0/6] platform/chrome: cros_ec debugfs and sysfs updates

2018-03-26 Thread Gwendal Grignou
i Serra (3): >platform/chrome: cros_ec_sysfs: introduce to_cros_ec_dev define. >platform/chrome: cros_ec_sysfs: use permission-specific DEVICE_ATTR > variants >platform/chrome: cros_ec_debugfs: Use octal permissions '0444' > Gwendal Grignou (2): >platform/chrom

Re: [PATCH v3 6/6] platform/chrome: mfd/cros_ec_dev: Add sysfs entry to set keyboard wake lid angle

2018-03-20 Thread Gwendal Grignou
On Tue, Mar 20, 2018 at 8:51 AM, Enric Balletbo i Serra wrote: > From: Gwendal Grignou > > This adds a sysfs attribute (/sys/class/chromeos/cros_ec/kb_wake_angle) > used to set and get the keyboard wake lid angle. This attribute is > present only if 2 accelerometers are contr

Re: [PATCH v2 6/6] platform/chrome: mfd/cros_ec_dev: Add sysfs entry to set keyboard wake lid angle

2018-03-16 Thread Gwendal Grignou
On Wed, Mar 7, 2018 at 8:28 AM Lee Jones wrote: > On Wed, 21 Feb 2018, Enric Balletbo i Serra wrote: > > From: Gwendal Grignou > > > > This adds a sysfs attribute (/sys/class/chromeos/cros_ec/kb_wake_angle) > > used to set and get the keyboard wake lid angle. This at

Re: [PATCH 6/6] mfd: cros_ec_i2c: add ACPI module device table

2018-02-21 Thread Gwendal Grignou
: Enric Balletbo i Serra Reviewed-by: Gwendal Grignou > --- > drivers/mfd/cros_ec_i2c.c | 12 > 1 file changed, 12 insertions(+) > > diff --git a/drivers/mfd/cros_ec_i2c.c b/drivers/mfd/cros_ec_i2c.c > index 9f70de1e4c70..9248490504a9 100644 > --- a/

Re: [PATCH 3/6] mfd: cros_ec_dev: Register cros-ec-rtc driver as a subdevice.

2018-02-21 Thread Gwendal Grignou
On Mon, Feb 19, 2018 at 2:40 PM, Enric Balletbo i Serra wrote: > Check whether this EC instance has RTC host command support and instatiate > the RTC driver as a subdevice in such case. > > Signed-off-by: Enric Balletbo i Serra Reviewed-by: Gwendal Grignou > --- > drivers

Re: [PATCH 4/6] mfd: cros_ec_dev: Register cros_ec_accel_legacy driver as a subdevice.

2018-02-21 Thread Gwendal Grignou
egacy device is present on Chromebook devices with older EC > firmware only supporting deprecated EC commands (Glimmer based devices). > > Tested-by: Gwendal Grignou > Signed-off-by: Enric Balletbo i Serra Reviewed-by: Gwendal Grignou > --- >

Re: [PATCH 1/6] mfd: cros_ec: fail early if we cannot identify the EC

2018-02-21 Thread Gwendal Grignou
using the wrong protocol, the > wrong buffer size, mixing the EC with other chips). > > Signed-off-by: Vincent Palatin > Acked-by: Benson Leung > Signed-off-by: Enric Balletbo i Serra Reviewed-by: Gwendal Grignou > --- > drivers/mfd/cros_ec.c | 6 +- > 1 file changed,

Re: [PATCH v2 1/6] platform/chrome: cros_ec_sysfs: Modify error handling

2018-02-21 Thread Gwendal Grignou
On Wed, Feb 21, 2018 at 9:07 AM, Enric Balletbo i Serra wrote: > From: Gwendal Grignou > > When accessing a sysfs attribute, if the EC command fails, -EPROTO is > now returned instead of an error message as it is unlikely an app is > parsing the error message to do something mea

Re: [PATCH 5/6] mfd: cros_ec_dev: Check communication with ec at resume

2018-02-21 Thread Gwendal Grignou
On Mon, Feb 19, 2018 at 2:41 PM, Enric Balletbo i Serra wrote: > From: Gwendal Grignou This patch is not needed anymore. It was added to > > Send dummy command to EC at resume time, wait for status. > If EC loses that command and return a status for the > pre-susp

[PATCH] platform/chrome: Use to_cros_ec_dev more broadly

2018-05-09 Thread Gwendal Grignou
Move to_cros_ec_dev macro to cros_ec.h and use it when the private ec object is needed from device object. Signed-off-by: Gwendal Grignou --- drivers/mfd/cros_ec_dev.c | 4 ++-- drivers/platform/chrome/cros_ec_lightbar.c | 21 +++-- drivers/platform/chrome

[PATCH] cros_ec: Use devm_kzalloc for private data

2018-05-09 Thread Gwendal Grignou
Use dev_kzmalloc, remove .release entry point. Signed-off-by: Gwendal Grignou --- drivers/mfd/cros_ec_dev.c | 10 +- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/drivers/mfd/cros_ec_dev.c b/drivers/mfd/cros_ec_dev.c index eafd06f62a3a..45d42511a3e5 100644 --- a/drivers

[PATCH] configfs: inherit file and directory owners

2018-04-13 Thread Gwendal Grignou
the ability to create any groups inside of that group. Signed-off-by: Daniel Rosenberg Signed-off-by: Gwendal Grignou --- fs/configfs/inode.c | 38 +++--- 1 file changed, 31 insertions(+), 7 deletions(-) diff --git a/fs/configfs/inode.c b/fs/configfs/inode.c index

[PATCH] configfs: initialize inode with owner

2018-03-06 Thread Gwendal Grignou
From: Sarthak Kukreti Use standard helper to set inode owner when created from user space. This is a noop when the owner is root. Signed-off-by: Sarthak Kukreti Signed-off-by: Gwendal Grignou --- fs/configfs/configfs_internal.h | 5 - fs/configfs/inode.c | 14

Re: [PATCH] configfs: initialize inode with owner

2018-03-07 Thread Gwendal Grignou
This patch is not correct: When listed with ls, configfs attributes have the uid/gid of the user who list them, but looks wrong. I will test it more and repost. Gwendal. On Tue, Mar 6, 2018 at 7:36 PM, Gwendal Grignou wrote: > From: Sarthak Kukreti > > Use standard helper to set in

Re: [PATCH 5/6] mfd: cros_ec_dev: Check communication with ec at resume

2018-02-23 Thread Gwendal Grignou
On Thu, Feb 22, 2018 at 1:41 AM, Enric Balletbo i Serra wrote: > Hi Gwendal, > > On 22/02/18 03:20, Gwendal Grignou wrote: >> On Mon, Feb 19, 2018 at 2:41 PM, Enric Balletbo i Serra >> wrote: >>> From: Gwendal Grignou >> This patch is not needed anymore

Re: [PATCH v3 1/4] mfd: cros_ec: Get rid of cros_ec_check_features from cros_ec_dev.

2017-07-13 Thread Gwendal Grignou
On Wed, Jul 12, 2017 at 3:13 AM, Enric Balletbo i Serra wrote: > The cros_ec_dev driver should be used only to expose the Chrome OS Embedded > 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

Re: [PATCH v5 2/3] platform/chrome: cros_ec_lpc: Add support for Google Glimmer

2017-12-06 Thread Gwendal Grignou
On Tue, Dec 5, 2017 at 1:55 PM, Thierry Escande wrote: > Hi Gwendal, > > On 01/12/2017 20:54, Gwendal Grignou wrote: >> >> This is not required. >> Looking with dmidecode, Glimmer reports: >> ... >> BIOS Information >> Vendor: coreboot &g

Re: [PATCH v2 2/2] cros_ec: Move cros_ec_dev module to drivers/mfd

2017-12-01 Thread Gwendal Grignou
Reviewed-by: Gwendal Grignou On Thu, Nov 30, 2017 at 12:50 PM, Guenter Roeck wrote: > On Mon, Nov 20, 2017 at 8:15 AM, Thierry Escande > wrote: >> The cros_ec_dev module is responsible for registering the MFD devices >> attached to the ChromeOS EC. This patch moves this mod

Re: [PATCH v2 1/2] cros_ec: Split cros_ec_devs module

2017-12-01 Thread Gwendal Grignou
Reviewed-by: Gwendal Grignou On Thu, Nov 30, 2017 at 12:49 PM, Guenter Roeck wrote: > On Mon, Nov 20, 2017 at 8:15 AM, Thierry Escande > wrote: >> This patch splits the cros_ec_devs module in two parts with a >> cros_ec_dev module responsible for handling MFD de

Re: [PATCH v5 1/3] platform/chrome: cros_ec_lpc: Register the driver if ACPI entry is missing.

2017-12-01 Thread Gwendal Grignou
Checked against 7412f0a0d90ee6ddbad4cde794f88f1489422f3a (CHROMIUM: platform/chrome: Support MKBP protocol over ACPI) Reviewed-by: Gwendal Grignou On Fri, Dec 1, 2017 at 5:42 AM, Thierry Escande wrote: > From: Enric Balletbo i Serra > > Commit 12278dc7c572 ("platform/chrome: cr

Re: [PATCH v5 2/3] platform/chrome: cros_ec_lpc: Add support for Google Glimmer

2017-12-01 Thread Gwendal Grignou
This is not required. Looking with dmidecode, Glimmer reports: ... BIOS Information Vendor: coreboot Version: Google_Glimmer.5216.198.19 ... Therefore, the first entry of cros_ec_lpc_dmi_table will match. Gwendal. On Fri, Dec 1, 2017 at 5:42 AM, Thierry Escande wrote: > This

Re: [PATCH v5 3/3] platform/chrome: Register cros_ec_accel_legacy driver

2017-12-01 Thread Gwendal Grignou
Checked against 3bf98755f9c670c5c10ca05cba22848d65117cb2 (CHROMIUM: iio: accel: Add cros_ec_accel_legacy driver) Fixup f2b141a242e59017dbc774dc916748670a41da0b (FIXUP: CHROMIUM: iio: accel: Add cros_ec_accel_legacy driver) is required for devices with secondary Embedded Controllers. Gwendal. On

Re: [PATCH 3/3] iio: proximity: Add a ChromeOS EC MKBP proximity driver

2021-01-25 Thread Gwendal Grignou
On Mon, Jan 25, 2021 at 10:52 AM Stephen Boyd wrote: > > Quoting Gwendal Grignou (2021-01-24 13:41:44) > > On Sun, Jan 24, 2021 at 9:38 AM Jonathan Cameron wrote: > > > > > > On Fri, 22 Jan 2021 14:54:43 -0800 > > > Stephen Boyd wrote: > > > &g

[PATCH v2 0/2] platform: chrome: Simplify interrupt path

2021-01-21 Thread Gwendal Grignou
comments syntax. Gwendal Grignou (2): platform: cros_ec: Call interrupt bottom half in ISH or RPMSG mode platform: cros_ec: Call interrupt bottom half at probe time drivers/platform/chrome/cros_ec.c | 33 - drivers/platform/chrome/cros_ec.h | 4 ++- drivers

[PATCH v2 2/2] platform: cros_ec: Call interrupt bottom half at probe time

2021-01-21 Thread Gwendal Grignou
While the AP was powered off, the EC may have send messages. If the message is not serviced within 3s, the EC stops sending message. Unlock the EC by purging stale messages at probe time. Signed-off-by: Gwendal Grignou --- Changes since v1: None. drivers/platform/chrome/cros_ec.c | 7

[PATCH v2 1/2] platform: cros_ec: Call interrupt bottom half in ISH or RPMSG mode

2021-01-21 Thread Gwendal Grignou
Call the same bottom half for all EC protocols (threaded code). Signed-off-by: Gwendal Grignou --- Changes since v1: - Fix merge issues, make changes in cros_ec.h instead of cros_ec_proto.h - Fix function comments syntax. drivers/platform/chrome/cros_ec.c | 26

Re: [PATCH v4 2/2] mfd: cros_ec: Add peripheral device charger

2021-01-23 Thread Gwendal Grignou
If there is a feature flag in the EC (see ec_feature_code), you can use cros_subdevices instead. > }; > > static const struct mfd_cell cros_ec_vbc_cells[] = { > -- > 2.30.0.280.ga3ce27912f-goog > Reviewed-by: Gwendal Grignou

Re: [PATCH v4 1/2] power: supply: PCHG: Peripheral device charger

2021-01-23 Thread Gwendal Grignou
On Sat, Jan 23, 2021 at 7:53 AM Daisuke Nojiri wrote: > > This patch adds a driver for PCHG (Peripheral CHarGer). PCHG is a > framework managing power supplies for peripheral devices. > > This driver creates a sysfs node for each peripheral charge port: > > /sys/class/power_supply/PCHGn >

[PATCH 1/2] platform: cros_ec: Call interrupt bottom half in ISH or RPMSG mode

2020-12-10 Thread Gwendal Grignou
Call the same bottom half for all EC protocols (threaded code). Signed-off-by: Gwendal Grignou --- drivers/platform/chrome/cros_ec.c | 26 - drivers/platform/chrome/cros_ec_ishtp.c | 6 + drivers/platform/chrome/cros_ec_rpmsg.c | 6 + include

[PATCH 0/2] platform: chrome: Simplify interrupt path

2020-12-10 Thread Gwendal Grignou
Irrespective of the transport (i2c, spi, ish, rpmsg), have all cros ec interrupt stack call the threaded part (bottom half) of the interrupt handler. Fix an issue where EC could be stuck if it sends a message while the AP is not powered on. Gwendal Grignou (2): platform: cros_ec: Call interrupt

[PATCH 2/2] platform: cros_ec: Call interrupt bottom half at probe time

2020-12-10 Thread Gwendal Grignou
While the AP was powered off, the EC may have send messages. If the message is not serviced within 3s, the EC stops sending message. Unlock the EC by purging stale messages at probe time. Signed-off-by: Gwendal Grignou --- drivers/platform/chrome/cros_ec.c | 7 +++ 1 file changed, 7

[PATCH] iio: cros_ec: set calibscale for 3d MEMS to unit vector

2019-08-19 Thread Gwendal Grignou
By default, set the calibscale vector to unit vector. It prevents sending 0 as calibscale when not initialized. Signed-off-by: Gwendal Grignou --- drivers/iio/common/cros_ec_sensors/cros_ec_sensors_core.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/iio

Re: [PATCH v5] mfd: cros_ec_dev: Register cros_ec_accel_legacy driver as a subdevice

2019-05-30 Thread Gwendal Grignou
On Thu, May 30, 2019 at 12:48 AM Lee Jones wrote: > > On Wed, 29 May 2019, Gwendal Grignou wrote: > > > On Wed, May 29, 2019 at 4:44 AM Lee Jones wrote: > > > > > > On Tue, 28 May 2019, Gwendal Grignou wrote: > > > > > >

Re: [PATCH v5] mfd: cros_ec_dev: Register cros_ec_accel_legacy driver as a subdevice

2019-05-31 Thread Gwendal Grignou
On Fri, May 31, 2019 at 1:13 AM Lee Jones wrote: > > On Thu, 30 May 2019, Gwendal Grignou wrote: > > > On Thu, May 30, 2019 at 12:48 AM Lee Jones wrote: > > > > > > On Wed, 29 May 2019, Gwendal Grignou wrote: > > > > > >

Re: [PATCH 10/10] mfd: cros_ec: Add convenience struct to define autodetectable CrOS EC subdevices

2019-06-14 Thread Gwendal Grignou
On Tue, Jun 4, 2019 at 8:20 AM Enric Balletbo i Serra wrote: > > The CrOS EC is gaining lots of subdevices that are autodetectable by > sending the EC_FEATURE_GET_CMD, it takes fair amount of boiler plate > code to add those devices. So, add a struct that can be used to quickly > add new

Re: [PATCH v7 2/2] iio: cros_ec: Add lid angle driver

2019-06-14 Thread Gwendal Grignou
On Sat, May 18, 2019 at 2:53 AM Jonathan Cameron wrote: > > On Fri, 17 May 2019 16:38:56 -0700 > Gwendal Grignou wrote: > > > Add a IIO driver that reports the angle between the lid and the base for > > ChromeOS convertible device. > > > > Tested on eve wi

Re: [PATCH] platform/chrome: Kconfig: Remove the transitional MFD_CROS_EC config

2020-09-03 Thread Gwendal Grignou
red anymore > > because all the defconfigs have been removed this option and migrated to > > enable the CrOS EC parts individually. > > > > Signed-off-by: Enric Balletbo i Serra > > Reviewed-by: Guenter Roeck Tested-by: Gwendal Grignou > > > --- > > > > dri

Re: [PATCH v2] platform: cros_ec: Reduce ligthbar get version command

2020-08-28 Thread Gwendal Grignou
[-iio list][+kernel list] On Tue, Aug 25, 2020 at 5:29 PM Gwendal Grignou wrote: > > By default, the lightbar commands are set to the > biggest lightbar command and response. That length is greater than 128 > bytes and may not work on all machines. > But all EC are prob

[PATCH v3] platform: cros_ec: Reduce ligthbar get version command

2020-08-30 Thread Gwendal Grignou
be: cros_ec_cmd: version: 0, command: EC_CMD_LIGHTBAR_CMD, outsize: 194, insize: 128, result: 0 Afer: cros_ec_cmd: version: 0, command: EC_CMD_LIGHTBAR_CMD, outsize: 1, insize: 8, result: 0 Fixes: a841178445bb7 ("mfd: cros_ec: Use a zero-length array for command data") Signed-off-by: Gwend

Re: [PATCH v2] platform: cros_ec: Reduce ligthbar get version command

2020-08-30 Thread Gwendal Grignou
On Sat, Aug 29, 2020 at 8:54 AM Jonathan Cameron wrote: > > On Tue, 25 Aug 2020 17:29:45 -0700 > Gwendal Grignou wrote: > > > By default, the lightbar commands are set to the > > biggest lightbar command and response. That length is greater than 128 > > bytes an

[PATCH] platform: cros_ec: Reduce ligthbar get version command

2020-08-15 Thread Gwendal Grignou
the command would be: cros_ec_cmd: version: 0, command: EC_CMD_LIGHTBAR_CMD, outsize: 194, insize: 128, result: 0 Afer: cros_ec_cmd: version: 0, command: EC_CMD_LIGHTBAR_CMD, outsize: 1, insize: 8, result: 0 Signed-off-by: Gwendal Grignou --- drivers/platform/chrome/cros_ec_lightbar.c | 2 ++ 1

[PATCH] platform: cros_ec: Add fields to command traces

2020-08-15 Thread Gwendal Grignou
026: cros_ec_request_done: version: 0, offset: 1, command: EC_CMD_USB_PD_POWER_INFO, outsize: 1, insize: 16, ec result: EC_RES_SUCCESS, retval: 16 Signed-off-by: Gwendal Grignou --- drivers/platform/chrome/cros_ec_trace.h | 27 +++-- 1 file changed, 21 insertions(+), 6 deletions(-) diff --

Re: [PATCH 1/2] platform/chrome: cros_ec_proto: Update cros_ec_cmd_xfer() call-sites

2020-09-18 Thread Gwendal Grignou
t; > > > As part of this update, change the error handling inside > > > cros_ec_get_sensor_count() such that the legacy LPC interface is tried > > > on all error values, not just when msg->result != EC_RESULT_SUCCESS. > > > > > > Signed-off-by: Prashant

Re: [PATCH 3/3] iio: proximity: Add a ChromeOS EC MKBP proximity driver

2021-01-26 Thread Gwendal Grignou
On Mon, Jan 25, 2021 at 3:44 PM Stephen Boyd wrote: > > Quoting Gwendal Grignou (2021-01-25 14:28:46) > > On Mon, Jan 25, 2021 at 10:52 AM Stephen Boyd wrote: > > > > > > Quoting Gwendal Grignou (2021-01-24 13:41:44) > > > > On Sun, Jan 24, 2021 a

Re: [PATCH v4 03/11] mfd / platform: cros_ec: Miscellaneous character device to talk with the EC

2019-07-15 Thread Gwendal Grignou
tem. The idea is > to move all the functionality that extends the bounds of what MFD was > designed to platform/chrome subsystem. > > Signed-off-by: Enric Balletbo i Serra > Acked-by: Andy Shevchenko > Tested-by: Gwendal Grignou > --- > > Changes in v4: None > Changes in

[PATCH v5 4/4] iio: cros_ec_accel_legacy: Add support for veyron-minnie

2019-07-15 Thread Gwendal Grignou
Veyron minnie embedded controller presents 2 accelerometers using an older interface. Add function to query the data in cros_ec_accel. Verify accelerometers on veyron-minnie are presented and working. Signed-off-by: Gwendal Grignou Acked-by: Jonathan Cameron --- drivers/iio/accel

[PATCH v5 2/4] iio: cros_ec_accel_legacy: Fix incorrect channel setting

2019-07-15 Thread Gwendal Grignou
INFO_SCALE is set both for each channel and all channels. iio is using all channel setting, so the error was not user visible. Signed-off-by: Gwendal Grignou --- drivers/iio/accel/cros_ec_accel_legacy.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/iio/accel/cros_ec_accel_legacy.c

[PATCH v5 1/4] iio: cros_ec: Add sign vector in core for backward compatibility

2019-07-15 Thread Gwendal Grignou
. Signed-off-by: Gwendal Grignou Reviewed-by: Douglas Anderson --- drivers/iio/common/cros_ec_sensors/cros_ec_sensors_core.c | 4 include/linux/iio/common/cros_ec_sensors_core.h | 1 + 2 files changed, 5 insertions(+) diff --git a/drivers/iio/common/cros_ec_sensors

[PATCH v5 0/4] Support accelerometers for veyron_minnie

2019-07-15 Thread Gwendal Grignou
- to veyron_minnie. veyron_minnie being ARM based, issue command over the I2C bus to the EC instead of relying on the shared registers over LPC. Gwendal Grignou (4): iio: cros_ec: Add sign vector in core for backward compatibility iio: cros_ec_accel_legacy: Fix incorrect channel setting iio

[PATCH v5 3/4] iio: cros_ec_accel_legacy: Use cros_ec_sensors_core

2019-07-15 Thread Gwendal Grignou
Remove duplicate code in cros-ec-accel-legacy, use cros-ec-sensors-core functions and structures when possible. On glimmer, check the 2 accelerometers are presented and working. Signed-off-by: Gwendal Grignou Acked-by: Jonathan Cameron --- drivers/iio/accel/Kconfig| 4

[PATCH v6 0/4] Support accelerometers for veyron_minnie

2019-07-15 Thread Gwendal Grignou
- to veyron_minnie. veyron_minnie being ARM based, issue command over the I2C bus to the EC instead of relying on the shared registers over LPC. Gwendal Grignou (4): iio: cros_ec: Add sign vector in core for backward compatibility iio: cros_ec_accel_legacy: Fix incorrect channel setting iio

[PATCH v6 1/4] iio: cros_ec: Add sign vector in core for backward compatibility

2019-07-15 Thread Gwendal Grignou
. Signed-off-by: Gwendal Grignou Reviewed-by: Douglas Anderson --- drivers/iio/common/cros_ec_sensors/cros_ec_sensors_core.c | 4 include/linux/iio/common/cros_ec_sensors_core.h | 1 + 2 files changed, 5 insertions(+) diff --git a/drivers/iio/common/cros_ec_sensors

[PATCH v6 4/4] iio: cros_ec_accel_legacy: Add support for veyron-minnie

2019-07-15 Thread Gwendal Grignou
Veyron minnie embedded controller presents 2 accelerometers using an older interface. Add function to query the data in cros_ec_accel. Verify accelerometers on veyron-minnie are presented and working. Signed-off-by: Gwendal Grignou Acked-by: Jonathan Cameron --- drivers/iio/accel

[PATCH v6 3/4] iio: cros_ec_accel_legacy: Use cros_ec_sensors_core

2019-07-15 Thread Gwendal Grignou
Remove duplicate code in cros-ec-accel-legacy, use cros-ec-sensors-core functions and structures when possible. On glimmer, check the 2 accelerometers are presented and working. Signed-off-by: Gwendal Grignou Acked-by: Jonathan Cameron --- drivers/iio/accel/Kconfig| 4

[PATCH v6 2/4] iio: cros_ec_accel_legacy: Fix incorrect channel setting

2019-07-15 Thread Gwendal Grignou
INFO_SCALE is set both for each channel and all channels. iio is using all channel setting, so the error was not user visible. Signed-off-by: Gwendal Grignou --- drivers/iio/accel/cros_ec_accel_legacy.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/iio/accel/cros_ec_accel_legacy.c

Re: [PATCH] iio: cros_ec_accel_legacy: Always release lock when returning from _read()

2019-07-15 Thread Gwendal Grignou
Sorry for the original mistake. I upload a patch at https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/1702884. On Mon, Jul 15, 2019 at 1:04 PM Matthias Kaehlcke wrote: > > Hi Benson, > > On Mon, Jul 15, 2019 at 12:55:57PM -0700, Benson Leung wrote: > > Hi Matthias, > > >

Re: [PATCH] iio: cros_ec_accel_legacy: Always release lock when returning from _read()

2019-07-15 Thread Gwendal Grignou
Let's use Matthias CL. On Mon, Jul 15, 2019 at 4:17 PM Gwendal Grignou wrote: > > Sorry for the original mistake. I upload a patch at > https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/1702884. > > On Mon, Jul 15, 2019 at 1:04 PM Matthias Kaehlcke wr

Re: [PATCH] platform: cros_ec_debugfs: control uptime information request

2020-05-26 Thread Gwendal Grignou
On Thu, May 21, 2020 at 2:21 AM Enric Balletbo i Serra wrote: > > Hi Gwendal, > > Thank you for your patch. > > On 21/5/20 7:28, Gwendal Grignou wrote: > > When EC does not support uptime command (EC_CMD_GET_UPTIME_INFO), > > return -EPROTO to read of /sys/kerne

[PATCH v2] platform: cros_ec_debugfs: control uptime information request

2020-05-26 Thread Gwendal Grignou
When EC does not support uptime command (EC_CMD_GET_UPTIME_INFO), do not create the uptime sysfs entry point. User space application will not probe the file needlessly. The EC console log will not contain EC_CMD_GET_UPTIME_INFO anymore. Signed-off-by: Gwendal Grignou --- drivers/platform

[PATCH] iio: cros_ec: Reapply range at resume

2020-05-26 Thread Gwendal Grignou
EC does not currently preserve range across sensor reinit. If sensor is powered down at suspend, it will default to the EC default range at resume, not the range set by the host. Save range if modified, and apply at resume. Signed-off-by: Gwendal Grignou --- .../common/cros_ec_sensors

Re: [PATCH v6 3/3] platform/chrome: Register cros_ec_accel_legacy driver

2018-01-29 Thread Gwendal Grignou
vice is present on Chromebook devices with older EC > firmware only supporting deprecated EC commands (Glimmer based devices). > > Signed-off-by: Thierry Escande Tested-by: Gwendal Grignou Integrated into chromeos kernel [internal CL:891664] Tested with Glimmer (legacy driver required)

Re: [PATCH v5 3/3] platform/chrome: Register cros_ec_accel_legacy driver

2018-01-18 Thread Gwendal Grignou
On Thu, Dec 7, 2017 at 1:31 AM, Lee Jones wrote: > On Fri, 01 Dec 2017, Gwendal Grignou wrote: > >> Checked against 3bf98755f9c670c5c10ca05cba22848d65117cb2 (CHROMIUM: >> iio: accel: Add cros_ec_accel_legacy driver) >> >> Fixup f2b141a242e59017dbc774dc91674867

Re: [PATCH] mfd: cros_ec: Update cros_ec_commands.h

2019-07-11 Thread Gwendal Grignou
Reviewed-by: Gwendal Grignou Note there is a patch series that move cros_ec_commands.h from nclude/linux/mfd/ to include/linux/platform_data. On Mon, Jul 8, 2019 at 11:16 AM Yicheng Li wrote: > > Update cros_ec_commands.h to match the fingerprint MCU section in > the current ec_c

Re: [PATCH 1/3] iio: common: cros_ec_sensors: support protocol v3 message

2019-05-22 Thread Gwendal Grignou
Remove CROS_EC_FIFO_SIZE and "u32 fifo_max_event_count;" from the driver/iio/ code. This code is for a driver - cros-ec-sensor-ring - that is not upstreamable. [see http://lkml.iu.edu/hypermail/linux/kernel/1607.2/01335.html]. The EC interface is fine though, we are working on a new version of the

[PATCH v6] mfd: cros_ec_dev: Register cros_ec_accel_legacy driver as a subdevice

2019-06-11 Thread Gwendal Grignou
deprecated EC commands: - Glimmer based devices [Intel SOC using LPC transport] - Veyron minnie devices [ARM SOC using SPI transport] Tested-by: Gwendal Grignou Signed-off-by: Enric Balletbo i Serra Reviewed-by: Andy Shevchenko Signed-off-by: Gwendal Grignou --- Changes in v6: - Remove .id field

Re: [PATCH v2 1/2] iio: cros_ec: Add sign vector in core for backward compatibility

2019-06-24 Thread Gwendal Grignou
On Sat, Jun 22, 2019 at 1:54 AM Jonathan Cameron wrote: > > On Thu, 20 Jun 2019 19:41:05 -0700 > Gwendal Grignou wrote: > > > To allow cros_ec iio core library to be used with legacy device, add a > > vector to rotate sensor data if necessary: legacy devices are not >

[PATCH v3 0/2] Support accelerometers for veyron_minnie

2019-06-24 Thread Gwendal Grignou
- to veyron_minnie. veyron_minnie being ARM based, issue command over the I2C bus to the EC instead of relying on the shared registers over LPC. Gwendal Grignou (2): iio: cros_ec: Add sign vector in core for backward compatibility iio: cros_ec: Extend legacy support to ARM device Changes in v3

[PATCH v3 2/2] iio: cros_ec: Extend legacy support to ARM device

2019-06-24 Thread Gwendal Grignou
are presented. Signed-off-by: Gwendal Grignou --- drivers/iio/accel/Kconfig| 4 +- drivers/iio/accel/cros_ec_accel_legacy.c | 350 +-- 2 files changed, 79 insertions(+), 275 deletions(-) diff --git a/drivers/iio/accel/Kconfig b/drivers/iio/accel/Kconfig

[PATCH v3 1/2] iio: cros_ec: Add sign vector in core for backward compatibility

2019-06-24 Thread Gwendal Grignou
. Signed-off-by: Gwendal Grignou Reviewed-by: Douglas Anderson --- drivers/iio/common/cros_ec_sensors/cros_ec_sensors_core.c | 4 include/linux/iio/common/cros_ec_sensors_core.h | 1 + 2 files changed, 5 insertions(+) diff --git a/drivers/iio/common/cros_ec_sensors

Re: [PATCH v5] mfd: cros_ec_dev: Register cros_ec_accel_legacy driver as a subdevice

2019-05-29 Thread Gwendal Grignou
On Wed, May 29, 2019 at 4:44 AM Lee Jones wrote: > > On Tue, 28 May 2019, Gwendal Grignou wrote: > > > On Mon, Apr 1, 2019 at 8:46 PM Lee Jones wrote: > > > > > > On Wed, 27 Feb 2019, Gwendal Grignou wrote: > > > > > > > From: E

[PATCH] iio: cros_ec: Remove replacing error code with -EIO

2019-07-18 Thread Gwendal Grignou
Due to an API misread, error code can be different for -EIO when reading a sysfs entry. Return the error reported by the cros_ec stack. Check the proper error message (protocol error, not supported) is reported when there is an error returned by the EC stack. Signed-off-by: Gwendal Grignou

[PATCH] iio: cros_ec: Add calibscale for 3d MEMS

2019-07-18 Thread Gwendal Grignou
Add calibration scale support to accel, gyro and magnetometer. Check on eve with current firmware, check reading calibscale returns 1.0, check with newer firmware values are applied. Signed-off-by: Gwendal Grignou --- .../common/cros_ec_sensors/cros_ec_sensors.c | 51

Re: [PATCH 01/13] mfd: cros_ec: Add sensor_count and make check_features public

2019-09-30 Thread Gwendal Grignou
Sounds good to me, I will make the change in rev2. On Mon, Sep 30, 2019 at 6:15 AM Enric Balletbo i Serra wrote: > > Hi Gwendal, > > Many thanks for the patches. > > On 22/9/19 19:50, Gwendal Grignou wrote: > > Add a new function to return the number of MEMS sensors ava

[PATCH 04/13] platform: chrome: cros-ec: record event timestamp in the hard irq

2019-09-22 Thread Gwendal Grignou
To improve sensor timestamp precision, given EC and AP are in different time domains, the AP needs to try to record the exact moment an event was signalled to the AP by the EC as soon as possible after it happens. First thing in the hard irq is the best place for this. Signed-off-by: Gwendal

[PATCH 00/13] cros_ec: Add sensorhub driver and FIFO processing

2019-09-22 Thread Gwendal Grignou
z. This set is built upon the master branch of git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git Enrico Granata (2): platform: chrome: cros_ec: Do not attempt to register a non-positive IRQ number platform: chrome: cros_ec: handle MKBP more events flag Gwendal Grignou

[PATCH 07/13] platform: chrome: sensorhub: Add FIFO support

2019-09-22 Thread Gwendal Grignou
cros_ec_sensorhub registers a listener and query motion sense FIFO, spread to iio sensors registers. To test, we can use libiio: iiod& iio_readdev -u ip:localhost -T 1 -s 25 -b 16 cros-ec-gyro | od -x Signed-off-by: Gwendal Grignou --- drivers/iio/accel/cros_ec_accel_legacy.c |

[PATCH 09/13] platform: chrome: sensorhub: Add median filter

2019-09-22 Thread Gwendal Grignou
. To mitigate worst offenders, add a median filter to weed out bigger than expected delays. Signed-off-by: Gwendal Grignou --- .../platform/chrome/cros_ec_sensorhub_ring.c | 485 +- .../linux/platform_data/cros_ec_sensorhub.h | 65 +++ 2 files changed, 533 insertions(+), 17 deletions

[PATCH 02/13] platform: cros_ec: Add cros_ec_sensor_hub driver

2019-09-22 Thread Gwendal Grignou
uto/ cros-ec-accel.15.auto/ iio:device1 It will be expanded to control EC sensor FIFO. Signed-off-by: Gwendal Grignou --- drivers/iio/common/cros_ec_sensors/Kconfig| 2 +- drivers/platform/chrome/Kconfig |

[PATCH 08/13] platform: chrome: sensorhub: Add code to spread timestmap

2019-09-22 Thread Gwendal Grignou
TSb | +---+ +---+ | TSb | +---+ Signed-off-by: Gwendal Grignou --- .../platform/chrome/cros_ec_sensorhub_ring.c | 99 ++- 1 file changed, 96 insertions(+), 3 deletions(-) diff --git a/drivers/platform/chrome/cros_ec_sensorhub_ring.c b/driv

[PATCH 01/13] mfd: cros_ec: Add sensor_count and make check_features public

2019-09-22 Thread Gwendal Grignou
Controller supports. Signed-off-by: Gwendal Grignou --- drivers/mfd/cros_ec_dev.c | 61 - include/linux/mfd/cros_ec.h | 17 +++ 2 files changed, 77 insertions(+), 1 deletion(-) diff --git a/drivers/mfd/cros_ec_dev.c b/drivers/mfd/cros_ec_dev.c index

[PATCH 12/13] iio: cros_ec: Report hwfifo_watermark_max

2019-09-22 Thread Gwendal Grignou
Report the maximum amount of sample the EC can hold. This is not tunable, but can be useful for application to find out the maximum amount of time it can sleep when hwfifo_timeout is set to a large number. Signed-off-by: Gwendal Grignou --- .../cros_ec_sensors/cros_ec_sensors_core.c| 35

[PATCH 03/13] platform/mfd:iio: cros_ec: Register sensor through sensorhub

2019-09-22 Thread Gwendal Grignou
- Add sensorhub include file - Remove duplicate code in mfd, since mfd just register cros_ec_sensorhub if at least one sensor is present - Change iio cros_ec driver to get the pointer to the cros_ec_dev through cros_ec_sensorhub. Signed-off-by: Gwendal Grignou --- drivers/iio/accel

[PATCH 06/13] platform: chrome: cros_ec: handle MKBP more events flag

2019-09-22 Thread Gwendal Grignou
timestamping as it keeps the desired synchronization of event times between the two processors. This patch adds kernel support for this EC feature, allowing the ec_irq to loop until all events have been served. Signed-off-by: Enrico Granata Signed-off-by: Gwendal Grignou --- drivers/platform/chrome

[PATCH 11/13] iio: cros_ec: Expose hwfifo_timeout

2019-09-22 Thread Gwendal Grignou
Expose EC sampling rate through buffer/hwfifo_timeout. Rename frequency to sampling_frequency to match IIO ABI. Signed-off-by: Gwendal Grignou --- .../common/cros_ec_sensors/cros_ec_sensors.c | 1 - .../cros_ec_sensors/cros_ec_sensors_core.c| 110 +- drivers/iio/light

[PATCH 13/13] iio: cros_ec: Use Hertz as unit for sampling frequency

2019-09-22 Thread Gwendal Grignou
To be compliant with other sensors, set and get sensor sampling frequency in Hz, not mHz. Fixes: ae7b02ad2f32 ("iio: common: cros_ec_sensors: Expose cros_ec_sensors frequency range via iio sysfs") Signed-off-by: Gwendal Grignou --- .../cros_ec_sensors/cros_ec_sensors_core

[PATCH 05/13] platform: chrome: cros_ec: Do not attempt to register a non-positive IRQ number

2019-09-22 Thread Gwendal Grignou
From: Enrico Granata Add a layer of sanity checking to cros_ec_register against attempting to register IRQ values that are not strictly greater than 0. Signed-off-by: Enrico Granata Signed-off-by: Enrico Granata Signed-off-by: Gwendal Grignou --- drivers/platform/chrome/cros_ec.c | 2 +- 1

[PATCH 10/13] iio: cros_ec: Use triggered buffer only when EC does not support FIFO

2019-09-22 Thread Gwendal Grignou
When EC supports FIFO, the samples will flow from the kernel by themselves. When no FIFO, the user space app needs to call trigger_new, or better register a high precision timer. Signed-off-by: Gwendal Grignou --- drivers/iio/accel/cros_ec_accel_legacy.c | 8 +-- .../cros_ec_sensors

Re: [PATCH 2/2] iio: cros_ec_light: Add support for RGB sensor

2020-04-30 Thread Gwendal Grignou
On Thu, Apr 23, 2020 at 12:50 AM Peter Meerwald-Stadler wrote: > > On Wed, 22 Apr 2020, Gwendal Grignou wrote: > > comments below > > > Add support for color sensors behind EC like TCS3400. > > The color data can be presented in Red Green Blue color space (RGB) or >

Re: [PATCH 2/2] iio: cros_ec_light: Add support for RGB sensor

2020-04-30 Thread Gwendal Grignou
On Sat, Apr 25, 2020 at 10:31 AM Jonathan Cameron wrote: > > On Wed, 22 Apr 2020 17:02:30 -0700 > Gwendal Grignou wrote: > > > Add support for color sensors behind EC like TCS3400. > > The color data can be presented in Red Green Blue color space (RGB) or > > the

Re: [PATCH v2 18/18] iio: cros_ec: Use Hertz as unit for sampling frequency

2019-10-22 Thread Gwendal Grignou
On Mon, Oct 21, 2019 at 9:45 AM Jonathan Cameron wrote: > > On Sun, 20 Oct 2019 22:54:03 -0700 > Gwendal Grignou wrote: > > > To be compliant with other sensors, set and get sensor sampling > > frequency in Hz, not mHz. > > > > Fixes: ae7b02ad2f32 (&

Re: [PATCH v2] platform/chrome: cros_ec_chardev: Add a poll handler to receive MKBP events

2019-09-05 Thread Gwendal Grignou
string, it still does it when no > > event mask or an empty event is set for backward compatibility (despite > > nobody really using this feature). > > > > This will be used, for example, by the userspace daemon to receive and > > treat the EC_MKBP_EVENT_FINGERPRINT se

Re: [PATCH] platform/chrome: cros_ec_spi: Document missing function parameters

2020-06-25 Thread Gwendal Grignou
Reviewed-by: Gwendal Grignou On Thu, Jun 25, 2020 at 10:02 AM Enric Balletbo i Serra wrote: > > Kerneldoc expects all kernel function members to be documented. > > Fixes the following W=1 level warnings: > > cros_ec_spi.c:153: warning: Function parameter or member 'ec_dev

Re: [PATCH] platform/chrome: cros_ec_rpmsg: Document missing struct parameters

2020-06-25 Thread Gwendal Grignou
Reviewed-by: Gwendal Grignou On Thu, Jun 25, 2020 at 10:03 AM Enric Balletbo i Serra wrote: > > Kerneldoc expects all kernel structure member to be documented. > > Fixes the following W=1 level warnings: > > cros_ec_rpmsg.c:49: warning: Function parameter or member 'ept

[PATCH] platform: cros_ec: sensorhub: Simplify legacy timestamp spreading

2020-07-28 Thread Gwendal Grignou
5ms-+-+-+---> t Afer, at host level 1 2 3 4 5 --interrupt delay--+-2.5ms-+-2.5ms-+-2.5ms-+-2.5ms-+---> t Signed-off-by: Gwendal Grignou --- .../platform/chrome/cros_ec_sensorhub_ring.c | 94 +++ 1 file changed, 33 insertio

Re: [PATCH v2 2/3] iio: common: cros_ec_sensors: add sysfs attribute for frequencies

2019-05-28 Thread Gwendal Grignou
On Mon, May 27, 2019 at 2:55 AM Fabien Lahoudere wrote: > > Le dimanche 26 mai 2019 à 18:45 +0100, Jonathan Cameron a écrit : > > On Thu, 23 May 2019 11:07:36 +0200 > > Fabien Lahoudere wrote: > > > > > In order to provide minimum and maximum frequencies for each > > > sensors, > > > we use a

Re: [PATCH v5] mfd: cros_ec_dev: Register cros_ec_accel_legacy driver as a subdevice

2019-05-28 Thread Gwendal Grignou
On Mon, Apr 1, 2019 at 8:46 PM Lee Jones wrote: > > On Wed, 27 Feb 2019, Gwendal Grignou wrote: > > > From: Enric Balletbo i Serra > > > > With this patch, the cros_ec_ctl driver will register the legacy > > accelerometer driver (named cros_ec_accel_legacy) if

Re: [PATCH 1/2] iio: cros_ec: Add sign vector in core for backward compatibility

2019-06-20 Thread Gwendal Grignou
On Thu, Jun 20, 2019 at 2:46 PM Doug Anderson wrote: > > Hi, > > On Thu, Jun 20, 2019 at 11:53 AM Gwendal Grignou wrote: > > > > To allow cros_ec iio core library to be used with legacy device, add a > > vector to rotate sensor data if necessary: legacy devi

<    1   2   3   4   5   >