Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1562687 > unrolled thread

[PATCH v2 4/4] mfd: cros_ec: add RTC as mfd subdevice

Started byEnric Balletbo i Serra <enric.balletbo@collabora.com>
First post2017-01-19 13:40 +0100
Last post2017-01-28 02:20 +0100
Articles 4 — 4 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH v2 4/4] mfd: cros_ec: add RTC as mfd subdevice Enric Balletbo i Serra <enric.balletbo@collabora.com> - 2017-01-19 13:40 +0100
    Re: [PATCH v2 4/4] mfd: cros_ec: add RTC as mfd subdevice Lee Jones <lee.jones@linaro.org> - 2017-01-23 13:20 +0100
      Re: [PATCH v2 4/4] mfd: cros_ec: add RTC as mfd subdevice Enric Balletbo Serra <eballetbo@gmail.com> - 2017-01-23 16:50 +0100
    Re: [PATCH v2 4/4] mfd: cros_ec: add RTC as mfd subdevice Benson Leung <bleung@chromium.org> - 2017-01-28 02:20 +0100

#1562687 — [PATCH v2 4/4] mfd: cros_ec: add RTC as mfd subdevice

FromEnric Balletbo i Serra <enric.balletbo@collabora.com>
Date2017-01-19 13:40 +0100
Subject[PATCH v2 4/4] mfd: cros_ec: add RTC as mfd subdevice
Message-ID<t1kau-1xr-29@gated-at.bofh.it>
From: Stephen Barber <smbarber@chromium.org>

If the EC supports RTC host commands, expose an RTC device.

Signed-off-by: Stephen Barber <smbarber@chromium.org>
Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
---
 drivers/platform/chrome/cros_ec_dev.c | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/drivers/platform/chrome/cros_ec_dev.c b/drivers/platform/chrome/cros_ec_dev.c
index 47268ec..ebe029d 100644
--- a/drivers/platform/chrome/cros_ec_dev.c
+++ b/drivers/platform/chrome/cros_ec_dev.c
@@ -383,6 +383,24 @@ static void cros_ec_sensors_register(struct cros_ec_dev *ec)
 	kfree(msg);
 }
 
+static const struct mfd_cell cros_ec_rtc_devs[] = {
+	{
+		.name = "cros-ec-rtc",
+		.id   = -1,
+	},
+};
+
+static void cros_ec_rtc_register(struct cros_ec_dev *ec)
+{
+	int ret;
+
+	ret = mfd_add_devices(ec->dev, 0, cros_ec_rtc_devs,
+			      ARRAY_SIZE(cros_ec_rtc_devs),
+			      NULL, 0, NULL);
+	if (ret)
+		dev_err(ec->dev, "failed to add cros-ec-rtc device: %d\n", ret);
+}
+
 static int ec_device_probe(struct platform_device *pdev)
 {
 	int retval = -ENOMEM;
@@ -441,6 +459,10 @@ static int ec_device_probe(struct platform_device *pdev)
 	if (cros_ec_check_features(ec, EC_FEATURE_MOTION_SENSE))
 		cros_ec_sensors_register(ec);
 
+	/* check whether this EC instance has RTC host command support */
+	if (cros_ec_check_features(ec, EC_FEATURE_RTC))
+		cros_ec_rtc_register(ec);
+
 	return 0;
 
 dev_reg_failed:
-- 
2.9.3

[toc] | [next] | [standalone]


#1564942

FromLee Jones <lee.jones@linaro.org>
Date2017-01-23 13:20 +0100
Message-ID<t2LLk-6l3-21@gated-at.bofh.it>
In reply to#1562687
On Thu, 19 Jan 2017, Enric Balletbo i Serra wrote:

> From: Stephen Barber <smbarber@chromium.org>
> 
> If the EC supports RTC host commands, expose an RTC device.
> 
> Signed-off-by: Stephen Barber <smbarber@chromium.org>
> Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
> ---
>  drivers/platform/chrome/cros_ec_dev.c | 22 ++++++++++++++++++++++
>  1 file changed, 22 insertions(+)

This still needs an Ack.

> diff --git a/drivers/platform/chrome/cros_ec_dev.c b/drivers/platform/chrome/cros_ec_dev.c
> index 47268ec..ebe029d 100644
> --- a/drivers/platform/chrome/cros_ec_dev.c
> +++ b/drivers/platform/chrome/cros_ec_dev.c
> @@ -383,6 +383,24 @@ static void cros_ec_sensors_register(struct cros_ec_dev *ec)
>  	kfree(msg);
>  }
>  
> +static const struct mfd_cell cros_ec_rtc_devs[] = {
> +	{
> +		.name = "cros-ec-rtc",
> +		.id   = -1,
> +	},
> +};
> +
> +static void cros_ec_rtc_register(struct cros_ec_dev *ec)
> +{
> +	int ret;
> +
> +	ret = mfd_add_devices(ec->dev, 0, cros_ec_rtc_devs,
> +			      ARRAY_SIZE(cros_ec_rtc_devs),
> +			      NULL, 0, NULL);
> +	if (ret)
> +		dev_err(ec->dev, "failed to add cros-ec-rtc device: %d\n", ret);
> +}
> +
>  static int ec_device_probe(struct platform_device *pdev)
>  {
>  	int retval = -ENOMEM;
> @@ -441,6 +459,10 @@ static int ec_device_probe(struct platform_device *pdev)
>  	if (cros_ec_check_features(ec, EC_FEATURE_MOTION_SENSE))
>  		cros_ec_sensors_register(ec);
>  
> +	/* check whether this EC instance has RTC host command support */
> +	if (cros_ec_check_features(ec, EC_FEATURE_RTC))
> +		cros_ec_rtc_register(ec);
> +
>  	return 0;
>  
>  dev_reg_failed:

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

[toc] | [prev] | [next] | [standalone]


#1565070

FromEnric Balletbo Serra <eballetbo@gmail.com>
Date2017-01-23 16:50 +0100
Message-ID<t2P2x-8f3-21@gated-at.bofh.it>
In reply to#1564942
Guess I forget to add one of the platform/chrome maintainers, as only
his ack is pending for this series, cc'ing Benson Leung

Thanks,
 Enric


2017-01-23 13:14 GMT+01:00 Lee Jones <lee.jones@linaro.org>:
> On Thu, 19 Jan 2017, Enric Balletbo i Serra wrote:
>
>> From: Stephen Barber <smbarber@chromium.org>
>>
>> If the EC supports RTC host commands, expose an RTC device.
>>
>> Signed-off-by: Stephen Barber <smbarber@chromium.org>
>> Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
>> ---
>>  drivers/platform/chrome/cros_ec_dev.c | 22 ++++++++++++++++++++++
>>  1 file changed, 22 insertions(+)
>
> This still needs an Ack.
>
>> diff --git a/drivers/platform/chrome/cros_ec_dev.c b/drivers/platform/chrome/cros_ec_dev.c
>> index 47268ec..ebe029d 100644
>> --- a/drivers/platform/chrome/cros_ec_dev.c
>> +++ b/drivers/platform/chrome/cros_ec_dev.c
>> @@ -383,6 +383,24 @@ static void cros_ec_sensors_register(struct cros_ec_dev *ec)
>>       kfree(msg);
>>  }
>>
>> +static const struct mfd_cell cros_ec_rtc_devs[] = {
>> +     {
>> +             .name = "cros-ec-rtc",
>> +             .id   = -1,
>> +     },
>> +};
>> +
>> +static void cros_ec_rtc_register(struct cros_ec_dev *ec)
>> +{
>> +     int ret;
>> +
>> +     ret = mfd_add_devices(ec->dev, 0, cros_ec_rtc_devs,
>> +                           ARRAY_SIZE(cros_ec_rtc_devs),
>> +                           NULL, 0, NULL);
>> +     if (ret)
>> +             dev_err(ec->dev, "failed to add cros-ec-rtc device: %d\n", ret);
>> +}
>> +
>>  static int ec_device_probe(struct platform_device *pdev)
>>  {
>>       int retval = -ENOMEM;
>> @@ -441,6 +459,10 @@ static int ec_device_probe(struct platform_device *pdev)
>>       if (cros_ec_check_features(ec, EC_FEATURE_MOTION_SENSE))
>>               cros_ec_sensors_register(ec);
>>
>> +     /* check whether this EC instance has RTC host command support */
>> +     if (cros_ec_check_features(ec, EC_FEATURE_RTC))
>> +             cros_ec_rtc_register(ec);
>> +
>>       return 0;
>>
>>  dev_reg_failed:
>
> --
> Lee Jones
> Linaro STMicroelectronics Landing Team Lead
> Linaro.org │ Open source software for ARM SoCs
> Follow Linaro: Facebook | Twitter | Blog

[toc] | [prev] | [next] | [standalone]


#1568815

FromBenson Leung <bleung@chromium.org>
Date2017-01-28 02:20 +0100
Message-ID<t4pQm-39V-3@gated-at.bofh.it>
In reply to#1562687

[Multipart message — attachments visible in raw view] — view raw

Hi Enric,

On Thu, Jan 19, 2017 at 01:30:32PM +0100, Enric Balletbo i Serra wrote:
> From: Stephen Barber <smbarber@chromium.org>
> 
> If the EC supports RTC host commands, expose an RTC device.
> 
> Signed-off-by: Stephen Barber <smbarber@chromium.org>
> Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>

Acked-by: Benson Leung <bleung@chromium.org>

Sorry for the delay on this Enric. This looks good to go.

-- 
Benson Leung
Senior Software Engineer
Chrome OS Kernel
Google Inc.
bleung@google.com
Chromium OS Project
bleung@chromium.org

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web