* [PATCH 1/4] devicetree: Add Micro Crystal AG vendor id
@ 2016-06-21 6:57 Dirk Behme
[not found] ` <1466492240-5528-1-git-send-email-dirk.behme-V5te9oGctAVWk0Htik3J/w@public.gmane.org>
0 siblings, 1 reply; 7+ messages in thread
From: Dirk Behme @ 2016-06-21 6:57 UTC (permalink / raw)
To: rtc-linux-/JYPxA39Uh5TLH3MbocFFw
Cc: Oleksij Rempel, devicetree-u79uwXL29TY76Z2rM5mHXA
From: Oleksij Rempel <fixed-term.Oleksij.Rempel-V5te9oGctAVWk0Htik3J/w@public.gmane.org>
Signed-off-by: Oleksij Rempel <fixed-term.Oleksij.Rempel-V5te9oGctAVWk0Htik3J/w@public.gmane.org>
Cc: devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
---
Documentation/devicetree/bindings/vendor-prefixes.txt | 1 +
1 file changed, 1 insertion(+)
diff --git a/Documentation/devicetree/bindings/vendor-prefixes.txt b/Documentation/devicetree/bindings/vendor-prefixes.txt
index 2c2500d..a6b39f9 100644
--- a/Documentation/devicetree/bindings/vendor-prefixes.txt
+++ b/Documentation/devicetree/bindings/vendor-prefixes.txt
@@ -152,6 +152,7 @@ lsi LSI Corp. (LSI Logic)
lltc Linear Technology Corporation
marvell Marvell Technology Group Ltd.
maxim Maxim Integrated Products
+mc Micro Crystal AG
meas Measurement Specialties
mediatek MediaTek Inc.
melexis Melexis N.V.
--
2.8.0
--
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.
---
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 email to rtc-linux+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit https://groups.google.com/d/optout.
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 2/4] dt/bindings: Add bindings for Micro Crystal rv8803
[not found] ` <1466492240-5528-1-git-send-email-dirk.behme-V5te9oGctAVWk0Htik3J/w@public.gmane.org>
@ 2016-06-21 6:57 ` Dirk Behme
[not found] ` <1466492240-5528-2-git-send-email-dirk.behme-V5te9oGctAVWk0Htik3J/w@public.gmane.org>
2016-06-21 6:57 ` [PATCH 3/4] rtc: rv8803: add device tree compatible names Dirk Behme
` (2 subsequent siblings)
3 siblings, 1 reply; 7+ messages in thread
From: Dirk Behme @ 2016-06-21 6:57 UTC (permalink / raw)
To: rtc-linux-/JYPxA39Uh5TLH3MbocFFw
Cc: Oleksij Rempel, devicetree-u79uwXL29TY76Z2rM5mHXA
From: Oleksij Rempel <fixed-term.Oleksij.Rempel-V5te9oGctAVWk0Htik3J/w@public.gmane.org>
... and Epson RX8900 real time clock
Signed-off-by: Oleksij Rempel <fixed-term.Oleksij.Rempel-V5te9oGctAVWk0Htik3J/w@public.gmane.org>
Cc: devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
---
.../devicetree/bindings/rtc/epson,rx8900.txt | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
create mode 100644 Documentation/devicetree/bindings/rtc/epson,rx8900.txt
diff --git a/Documentation/devicetree/bindings/rtc/epson,rx8900.txt b/Documentation/devicetree/bindings/rtc/epson,rx8900.txt
new file mode 100644
index 0000000..51959de
--- /dev/null
+++ b/Documentation/devicetree/bindings/rtc/epson,rx8900.txt
@@ -0,0 +1,21 @@
+Real Time Clock driver for:
+ - Epson RX8900
+ - Micro Crystal rv8803
+
+Required properties:
+- compatible: should be: "mc,rv8803" or "epson,rx8900"
+- reg : the I2C address of the device for I2C
+
+Optional properties:
+- epson,vdetoff : Disable Voltage Detector. Should be set if no
+ backup battery is used.
+- trickle-diode-disable : Disable internal trickle charger diode
+
+Example:
+
+ rtc: rtc@32 {
+ compatible = "epson,rx8900"
+ reg = <0x32>;
+ epson,vdetoff;
+ trickle-diode-disable;
+ };
--
2.8.0
--
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.
---
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 email to rtc-linux+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit https://groups.google.com/d/optout.
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 3/4] rtc: rv8803: add device tree compatible names
[not found] ` <1466492240-5528-1-git-send-email-dirk.behme-V5te9oGctAVWk0Htik3J/w@public.gmane.org>
2016-06-21 6:57 ` [PATCH 2/4] dt/bindings: Add bindings for Micro Crystal rv8803 Dirk Behme
@ 2016-06-21 6:57 ` Dirk Behme
2016-06-21 6:57 ` [PATCH 4/4] rtc: rv8803: Be able to set VDETOFF and SWOFF via devcie tree Dirk Behme
2016-06-21 21:45 ` [PATCH 1/4] devicetree: Add Micro Crystal AG vendor id Rob Herring
3 siblings, 0 replies; 7+ messages in thread
From: Dirk Behme @ 2016-06-21 6:57 UTC (permalink / raw)
To: rtc-linux-/JYPxA39Uh5TLH3MbocFFw
Cc: Knut Wohlrab, Oleksij Rempel, devicetree-u79uwXL29TY76Z2rM5mHXA
From: Knut Wohlrab <Knut.Wohlrab-V5te9oGctAVWk0Htik3J/w@public.gmane.org>
Add device tree compatible names for usage in a compatible
list of alternative RTC devices.
Signed-off-by: Knut Wohlrab <Knut.Wohlrab-V5te9oGctAVWk0Htik3J/w@public.gmane.org>
Signed-off-by: Oleksij Rempel <fixed-term.Oleksij.Rempel-V5te9oGctAVWk0Htik3J/w@public.gmane.org>
Cc: devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
---
drivers/rtc/rtc-rv8803.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/drivers/rtc/rtc-rv8803.c b/drivers/rtc/rtc-rv8803.c
index f623038..62baddd 100644
--- a/drivers/rtc/rtc-rv8803.c
+++ b/drivers/rtc/rtc-rv8803.c
@@ -18,6 +18,7 @@
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/rtc.h>
+#include <linux/of.h>
#define RV8803_SEC 0x00
#define RV8803_MIN 0x01
@@ -520,9 +521,19 @@ static const struct i2c_device_id rv8803_id[] = {
};
MODULE_DEVICE_TABLE(i2c, rv8803_id);
+#ifdef CONFIG_OF
+static const struct of_device_id rv8803_of_match[] = {
+ { .compatible = "mc,rv8803", },
+ { .compatible = "epson,rx8900", },
+ {},
+};
+MODULE_DEVICE_TABLE(of, rv8803_of_match);
+#endif
+
static struct i2c_driver rv8803_driver = {
.driver = {
.name = "rtc-rv8803",
+ .of_match_table = of_match_ptr(rv8803_of_match),
},
.probe = rv8803_probe,
.remove = rv8803_remove,
--
2.8.0
--
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.
---
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 email to rtc-linux+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit https://groups.google.com/d/optout.
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 4/4] rtc: rv8803: Be able to set VDETOFF and SWOFF via devcie tree
[not found] ` <1466492240-5528-1-git-send-email-dirk.behme-V5te9oGctAVWk0Htik3J/w@public.gmane.org>
2016-06-21 6:57 ` [PATCH 2/4] dt/bindings: Add bindings for Micro Crystal rv8803 Dirk Behme
2016-06-21 6:57 ` [PATCH 3/4] rtc: rv8803: add device tree compatible names Dirk Behme
@ 2016-06-21 6:57 ` Dirk Behme
2016-06-21 21:45 ` [PATCH 1/4] devicetree: Add Micro Crystal AG vendor id Rob Herring
3 siblings, 0 replies; 7+ messages in thread
From: Dirk Behme @ 2016-06-21 6:57 UTC (permalink / raw)
To: rtc-linux-/JYPxA39Uh5TLH3MbocFFw
Cc: Oleksij Rempel, Carsten Resch, Dirk Behme,
devicetree-u79uwXL29TY76Z2rM5mHXA
From: Oleksij Rempel <fixed-term.Oleksij.Rempel-V5te9oGctAVWk0Htik3J/w@public.gmane.org>
There might be designs where the power supply circuit is designed
in a way that VDETOFF and SWOFF is reuqired to be set. Otherwise the
RTC detects a power loss. Add a device tree interface for this.
Signed-off-by: Carsten Resch <Carsten.Resch-V5te9oGctAVWk0Htik3J/w@public.gmane.org>
Signed-off-by: Dirk Behme <dirk.behme-V5te9oGctAVWk0Htik3J/w@public.gmane.org>
Signed-off-by: Oleksij Rempel <fixed-term.Oleksij.Rempel-V5te9oGctAVWk0Htik3J/w@public.gmane.org>
Cc: devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
---
drivers/rtc/rtc-rv8803.c | 39 +++++++++++++++++++++++++++++++++++++++
1 file changed, 39 insertions(+)
diff --git a/drivers/rtc/rtc-rv8803.c b/drivers/rtc/rtc-rv8803.c
index 62baddd..2566d67 100644
--- a/drivers/rtc/rtc-rv8803.c
+++ b/drivers/rtc/rtc-rv8803.c
@@ -50,6 +50,10 @@
#define RV8803_CTRL_TIE BIT(4)
#define RV8803_CTRL_UIE BIT(5)
+#define RX8900_BACKUP_CTRL 0x18
+#define RX8900_FLAG_SWOFF BIT(2)
+#define RX8900_FLAG_VDETOFF BIT(3)
+
struct rv8803_data {
struct i2c_client *client;
struct rtc_device *rtc;
@@ -423,6 +427,35 @@ static struct rtc_class_ops rv8803_rtc_ops = {
.ioctl = rv8803_ioctl,
};
+static int rx8900_trickle_charger_init(struct rv8803_data *rv8803)
+{
+ struct i2c_client *client = rv8803->client;
+ struct device_node *node = client->dev.of_node;
+ int err;
+ u8 flags;
+
+ if (!node)
+ return 0;
+
+ if (!of_device_is_compatible(node, "epson,rx8900"))
+ return 0;
+
+ err = i2c_smbus_read_byte_data(rv8803->client, RX8900_BACKUP_CTRL);
+ if (err < 0)
+ return err;
+
+ flags = ~(RX8900_FLAG_VDETOFF | RX8900_FLAG_SWOFF) & (u8)err;
+
+ if (of_property_read_bool(node, "epson,vdetoff"))
+ flags |= RX8900_FLAG_VDETOFF;
+
+ if (of_property_read_bool(node, "trickle-diode-disable"))
+ flags |= RX8900_FLAG_SWOFF;
+
+ return i2c_smbus_write_byte_data(rv8803->client, RX8900_BACKUP_CTRL,
+ flags);
+}
+
static int rv8803_probe(struct i2c_client *client,
const struct i2c_device_id *id)
{
@@ -498,6 +531,12 @@ static int rv8803_probe(struct i2c_client *client,
if (err)
return err;
+ err = rx8900_trickle_charger_init(rv8803);
+ if (err) {
+ dev_err(&client->dev, "failed to init charger\n");
+ return err;
+ }
+
err = device_create_bin_file(&client->dev, &rv8803_nvram_attr);
if (err)
return err;
--
2.8.0
--
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.
---
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 email to rtc-linux+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit https://groups.google.com/d/optout.
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH 1/4] devicetree: Add Micro Crystal AG vendor id
[not found] ` <1466492240-5528-1-git-send-email-dirk.behme-V5te9oGctAVWk0Htik3J/w@public.gmane.org>
` (2 preceding siblings ...)
2016-06-21 6:57 ` [PATCH 4/4] rtc: rv8803: Be able to set VDETOFF and SWOFF via devcie tree Dirk Behme
@ 2016-06-21 21:45 ` Rob Herring
3 siblings, 0 replies; 7+ messages in thread
From: Rob Herring @ 2016-06-21 21:45 UTC (permalink / raw)
To: Dirk Behme
Cc: rtc-linux-/JYPxA39Uh5TLH3MbocFFw, Oleksij Rempel,
devicetree-u79uwXL29TY76Z2rM5mHXA
On Tue, Jun 21, 2016 at 08:57:17AM +0200, Dirk Behme wrote:
> From: Oleksij Rempel <fixed-term.Oleksij.Rempel-V5te9oGctAVWk0Htik3J/w@public.gmane.org>
>
> Signed-off-by: Oleksij Rempel <fixed-term.Oleksij.Rempel-V5te9oGctAVWk0Htik3J/w@public.gmane.org>
> Cc: devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> ---
> Documentation/devicetree/bindings/vendor-prefixes.txt | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/Documentation/devicetree/bindings/vendor-prefixes.txt b/Documentation/devicetree/bindings/vendor-prefixes.txt
> index 2c2500d..a6b39f9 100644
> --- a/Documentation/devicetree/bindings/vendor-prefixes.txt
> +++ b/Documentation/devicetree/bindings/vendor-prefixes.txt
> @@ -152,6 +152,7 @@ lsi LSI Corp. (LSI Logic)
> lltc Linear Technology Corporation
> marvell Marvell Technology Group Ltd.
> maxim Maxim Integrated Products
> +mc Micro Crystal AG
mc is a bit short. How about microcrystal?
> meas Measurement Specialties
> mediatek MediaTek Inc.
> melexis Melexis N.V.
> --
> 2.8.0
>
> --
> To unsubscribe from this list: send the line "unsubscribe devicetree" in
> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
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.
---
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 email to rtc-linux+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit https://groups.google.com/d/optout.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 2/4] dt/bindings: Add bindings for Micro Crystal rv8803
[not found] ` <1466492240-5528-2-git-send-email-dirk.behme-V5te9oGctAVWk0Htik3J/w@public.gmane.org>
@ 2016-06-21 21:48 ` Rob Herring
2016-06-22 5:15 ` fixed-term.Oleksij.Rempel
0 siblings, 1 reply; 7+ messages in thread
From: Rob Herring @ 2016-06-21 21:48 UTC (permalink / raw)
To: Dirk Behme
Cc: rtc-linux-/JYPxA39Uh5TLH3MbocFFw, Oleksij Rempel,
devicetree-u79uwXL29TY76Z2rM5mHXA
On Tue, Jun 21, 2016 at 08:57:18AM +0200, Dirk Behme wrote:
> From: Oleksij Rempel <fixed-term.Oleksij.Rempel-V5te9oGctAVWk0Htik3J/w@public.gmane.org>
>
> ... and Epson RX8900 real time clock
>
> Signed-off-by: Oleksij Rempel <fixed-term.Oleksij.Rempel-V5te9oGctAVWk0Htik3J/w@public.gmane.org>
> Cc: devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> ---
> .../devicetree/bindings/rtc/epson,rx8900.txt | 21 +++++++++++++++++++++
> 1 file changed, 21 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/rtc/epson,rx8900.txt
>
> diff --git a/Documentation/devicetree/bindings/rtc/epson,rx8900.txt b/Documentation/devicetree/bindings/rtc/epson,rx8900.txt
> new file mode 100644
> index 0000000..51959de
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/rtc/epson,rx8900.txt
> @@ -0,0 +1,21 @@
> +Real Time Clock driver for:
> + - Epson RX8900
> + - Micro Crystal rv8803
> +
> +Required properties:
> +- compatible: should be: "mc,rv8803" or "epson,rx8900"
> +- reg : the I2C address of the device for I2C
> +
> +Optional properties:
> +- epson,vdetoff : Disable Voltage Detector. Should be set if no
> + backup battery is used.
set to no? Looks like a boolean to me.
How about epson,vdet-disable to be consistent.
> +- trickle-diode-disable : Disable internal trickle charger diode
boolean?
Needs a vendor prefix.
> +
> +Example:
> +
> + rtc: rtc@32 {
> + compatible = "epson,rx8900"
> + reg = <0x32>;
> + epson,vdetoff;
> + trickle-diode-disable;
> + };
> --
> 2.8.0
>
> --
> To unsubscribe from this list: send the line "unsubscribe devicetree" in
> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
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.
---
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 email to rtc-linux+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit https://groups.google.com/d/optout.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 2/4] dt/bindings: Add bindings for Micro Crystal rv8803
2016-06-21 21:48 ` Rob Herring
@ 2016-06-22 5:15 ` fixed-term.Oleksij.Rempel
0 siblings, 0 replies; 7+ messages in thread
From: fixed-term.Oleksij.Rempel @ 2016-06-22 5:15 UTC (permalink / raw)
To: Rob Herring, Dirk Behme
Cc: rtc-linux-/JYPxA39Uh5TLH3MbocFFw, devicetree-u79uwXL29TY76Z2rM5mHXA
On 21.06.2016 23:48, Rob Herring wrote:
> On Tue, Jun 21, 2016 at 08:57:18AM +0200, Dirk Behme wrote:
>> From: Oleksij Rempel <fixed-term.Oleksij.Rempel-V5te9oGctAVWk0Htik3J/w@public.gmane.org>
>>
>> ... and Epson RX8900 real time clock
>>
>> Signed-off-by: Oleksij Rempel <fixed-term.Oleksij.Rempel-V5te9oGctAVWk0Htik3J/w@public.gmane.org>
>> Cc: devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
>> ---
>> .../devicetree/bindings/rtc/epson,rx8900.txt | 21 +++++++++++++++++++++
>> 1 file changed, 21 insertions(+)
>> create mode 100644 Documentation/devicetree/bindings/rtc/epson,rx8900.txt
>>
>> diff --git a/Documentation/devicetree/bindings/rtc/epson,rx8900.txt b/Documentation/devicetree/bindings/rtc/epson,rx8900.txt
>> new file mode 100644
>> index 0000000..51959de
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/rtc/epson,rx8900.txt
>> @@ -0,0 +1,21 @@
>> +Real Time Clock driver for:
>> + - Epson RX8900
>> + - Micro Crystal rv8803
>> +
>> +Required properties:
>> +- compatible: should be: "mc,rv8803" or "epson,rx8900"
>> +- reg : the I2C address of the device for I2C
>> +
>> +Optional properties:
>> +- epson,vdetoff : Disable Voltage Detector. Should be set if no
>> + backup battery is used.
>
> set to no? Looks like a boolean to me.
>
> How about epson,vdet-disable to be consistent.
>
>> +- trickle-diode-disable : Disable internal trickle charger diode
>
> boolean?
>
> Needs a vendor prefix.
This is common name used by many rtc driver without vendor prefix.
--
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.
---
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 email to rtc-linux+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit https://groups.google.com/d/optout.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2016-06-22 5:15 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-21 6:57 [PATCH 1/4] devicetree: Add Micro Crystal AG vendor id Dirk Behme
[not found] ` <1466492240-5528-1-git-send-email-dirk.behme-V5te9oGctAVWk0Htik3J/w@public.gmane.org>
2016-06-21 6:57 ` [PATCH 2/4] dt/bindings: Add bindings for Micro Crystal rv8803 Dirk Behme
[not found] ` <1466492240-5528-2-git-send-email-dirk.behme-V5te9oGctAVWk0Htik3J/w@public.gmane.org>
2016-06-21 21:48 ` Rob Herring
2016-06-22 5:15 ` fixed-term.Oleksij.Rempel
2016-06-21 6:57 ` [PATCH 3/4] rtc: rv8803: add device tree compatible names Dirk Behme
2016-06-21 6:57 ` [PATCH 4/4] rtc: rv8803: Be able to set VDETOFF and SWOFF via devcie tree Dirk Behme
2016-06-21 21:45 ` [PATCH 1/4] devicetree: Add Micro Crystal AG vendor id Rob Herring
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).