diff for duplicates of <20160503082505.GD2335@piout.net> diff --git a/a/1.txt b/N1/1.txt index 6055346..3e51542 100644 --- a/a/1.txt +++ b/N1/1.txt @@ -1,20 +1,19 @@ -On 29/04/2016 at 00:00:36 +0200, Myl=C4=8Dne Josserand wrote : +On 29/04/2016 at 00:00:36 +0200, Mylène Josserand wrote : > The RTC RV3029 handles different types of alarms : seconds, minutes, ... > These alarms can be enabled or disabled individually using an AE_x bit > which is the last bit (BIT(7)) on each alarm registers. ->=20 +> > To prepare the alarm IRQ support, the current code enables all the alarm > types by setting each AE_x to 1. > It also fixes others alarms issues : > - month and weekday errors : it was performing -1 instead of +1. > - wrong use of bit mask with bin2bcd ->=20 -> Signed-off-by: Myl=C4=8Dne Josserand <mylene.josserand@free-electrons.com= -> +> +> Signed-off-by: Mylène Josserand <mylene.josserand@free-electrons.com> > --- > drivers/rtc/rtc-rv3029c2.c | 25 +++++++++++++++++-------- > 1 file changed, 17 insertions(+), 8 deletions(-) ->=20 +> > diff --git a/drivers/rtc/rtc-rv3029c2.c b/drivers/rtc/rtc-rv3029c2.c > index cf8d465..916bbc2 100644 > --- a/drivers/rtc/rtc-rv3029c2.c @@ -25,73 +24,55 @@ On 29/04/2016 at 00:00:36 +0200, Myl=C4=8Dne Josserand wrote : > #define RV3029_A_YR 0x16 > +#define RV3029_A_AE_X BIT(7) > #define RV3029_ALARM_SECTION_LEN 0x07 -> =20 +> > /* timer section */ -> @@ -436,14 +437,22 @@ static int rv3029_set_alarm(struct device *dev, str= -uct rtc_wkalrm *alarm) +> @@ -436,14 +437,22 @@ static int rv3029_set_alarm(struct device *dev, struct rtc_wkalrm *alarm) > dev_err(dev, "%s: reading SR failed\n", __func__); > return -EIO; > } -> - regs[RV3029_A_SC - RV3029_A_SC] =3D bin2bcd(tm->tm_sec & 0x7f); -> - regs[RV3029_A_MN - RV3029_A_SC] =3D bin2bcd(tm->tm_min & 0x7f); -> - regs[RV3029_A_HR - RV3029_A_SC] =3D bin2bcd(tm->tm_hour & 0x3f); -> - regs[RV3029_A_DT - RV3029_A_SC] =3D bin2bcd(tm->tm_mday & 0x3f); -> - regs[RV3029_A_MO - RV3029_A_SC] =3D bin2bcd((tm->tm_mon & 0x1f) - 1); -> - regs[RV3029_A_DW - RV3029_A_SC] =3D bin2bcd((tm->tm_wday & 7) - 1); -> - regs[RV3029_A_YR - RV3029_A_SC] =3D bin2bcd((tm->tm_year & 0x7f) - 100)= -; -> =20 +> - regs[RV3029_A_SC - RV3029_A_SC] = bin2bcd(tm->tm_sec & 0x7f); +> - regs[RV3029_A_MN - RV3029_A_SC] = bin2bcd(tm->tm_min & 0x7f); +> - regs[RV3029_A_HR - RV3029_A_SC] = bin2bcd(tm->tm_hour & 0x3f); +> - regs[RV3029_A_DT - RV3029_A_SC] = bin2bcd(tm->tm_mday & 0x3f); +> - regs[RV3029_A_MO - RV3029_A_SC] = bin2bcd((tm->tm_mon & 0x1f) - 1); +> - regs[RV3029_A_DW - RV3029_A_SC] = bin2bcd((tm->tm_wday & 7) - 1); +> - regs[RV3029_A_YR - RV3029_A_SC] = bin2bcd((tm->tm_year & 0x7f) - 100); +> > + /* Activate all the alarms with AE_x bit */ -> + regs[RV3029_A_SC - RV3029_A_SC] =3D bin2bcd(tm->tm_sec) | RV3029_A_AE_X= -; -> + regs[RV3029_A_MN - RV3029_A_SC] =3D bin2bcd(tm->tm_min) | RV3029_A_AE_X= -; -> + regs[RV3029_A_HR - RV3029_A_SC] =3D (bin2bcd(tm->tm_hour) & 0x3f) +> + regs[RV3029_A_SC - RV3029_A_SC] = bin2bcd(tm->tm_sec) | RV3029_A_AE_X; +> + regs[RV3029_A_MN - RV3029_A_SC] = bin2bcd(tm->tm_min) | RV3029_A_AE_X; +> + regs[RV3029_A_HR - RV3029_A_SC] = (bin2bcd(tm->tm_hour) & 0x3f) > + | RV3029_A_AE_X; -> + regs[RV3029_A_DT - RV3029_A_SC] =3D (bin2bcd(tm->tm_mday) & 0x3f) +> + regs[RV3029_A_DT - RV3029_A_SC] = (bin2bcd(tm->tm_mday) & 0x3f) > + | RV3029_A_AE_X; -> + regs[RV3029_A_MO - RV3029_A_SC] =3D (bin2bcd(tm->tm_mon + 1) & 0x1f) +> + regs[RV3029_A_MO - RV3029_A_SC] = (bin2bcd(tm->tm_mon + 1) & 0x1f) > + | RV3029_A_AE_X; -> + regs[RV3029_A_DW - RV3029_A_SC] =3D (bin2bcd(tm->tm_wday + 1) & 0x7) +> + regs[RV3029_A_DW - RV3029_A_SC] = (bin2bcd(tm->tm_wday + 1) & 0x7) > + | RV3029_A_AE_X; -> + regs[RV3029_A_YR - RV3029_A_SC] =3D (bin2bcd(tm->tm_year - 100)) +> + regs[RV3029_A_YR - RV3029_A_SC] = (bin2bcd(tm->tm_year - 100)) > + | RV3029_A_AE_X; > + > + /* Write the alarm */ -> ret =3D rv3029_write_regs(dev, RV3029_A_SC, regs, +> ret = rv3029_write_regs(dev, RV3029_A_SC, regs, > RV3029_ALARM_SECTION_LEN); > if (ret < 0) -> @@ -493,7 +502,7 @@ static int rv3029_set_time(struct device *dev, struct= - rtc_time *tm) -> regs[RV3029_W_HOURS - RV3029_W_SEC] =3D bin2bcd(tm->tm_hour); -> regs[RV3029_W_DATE - RV3029_W_SEC] =3D bin2bcd(tm->tm_mday); -> regs[RV3029_W_MONTHS - RV3029_W_SEC] =3D bin2bcd(tm->tm_mon + 1); -> - regs[RV3029_W_DAYS - RV3029_W_SEC] =3D bin2bcd((tm->tm_wday & 7) + 1); -> + regs[RV3029_W_DAYS - RV3029_W_SEC] =3D bin2bcd(tm->tm_wday + 1) & 0x7; +> @@ -493,7 +502,7 @@ static int rv3029_set_time(struct device *dev, struct rtc_time *tm) +> regs[RV3029_W_HOURS - RV3029_W_SEC] = bin2bcd(tm->tm_hour); +> regs[RV3029_W_DATE - RV3029_W_SEC] = bin2bcd(tm->tm_mday); +> regs[RV3029_W_MONTHS - RV3029_W_SEC] = bin2bcd(tm->tm_mon + 1); +> - regs[RV3029_W_DAYS - RV3029_W_SEC] = bin2bcd((tm->tm_wday & 7) + 1); +> + regs[RV3029_W_DAYS - RV3029_W_SEC] = bin2bcd(tm->tm_wday + 1) & 0x7; This may go in a separate patch. -> regs[RV3029_W_YEARS - RV3029_W_SEC] =3D bin2bcd(tm->tm_year - 100); -> =20 -> ret =3D rv3029_write_regs(dev, RV3029_W_SEC, regs, -> --=20 +> regs[RV3029_W_YEARS - RV3029_W_SEC] = bin2bcd(tm->tm_year - 100); +> +> ret = rv3029_write_regs(dev, RV3029_W_SEC, regs, +> -- > 2.8.0.rc3 ->=20 +> ---=20 +-- Alexandre Belloni, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com - ---=20 ---=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. diff --git a/a/content_digest b/N1/content_digest index 442d5d6..ed603cb 100644 --- a/a/content_digest +++ b/N1/content_digest @@ -2,7 +2,7 @@ "ref\0cover.1461879175.git.mylene.josserand@free-electrons.com\0" "ref\0110190e646c33da59f84a6e96bc656c17a878c7e.1461879175.git.mylene.josserand@free-electrons.com\0" "From\0Alexandre Belloni <alexandre.belloni@free-electrons.com>\0" - "Subject\0[rtc-linux] Re: [PATCH V2 5/6] rtc: rv3029: fix alarm support\0" + "Subject\0Re: [PATCH V2 5/6] rtc: rv3029: fix alarm support\0" "Date\0Tue, 3 May 2016 10:25:05 +0200\0" "To\0Myl\303\250ne Josserand <mylene.josserand@free-electrons.com>\0" "Cc\0rtc-linux@googlegroups.com" @@ -10,23 +10,22 @@ " linux-kernel@vger.kernel.org\0" "\00:1\0" "b\0" - "On 29/04/2016 at 00:00:36 +0200, Myl=C4=8Dne Josserand wrote :\n" + "On 29/04/2016 at 00:00:36 +0200, Myl\303\250ne Josserand wrote :\n" "> The RTC RV3029 handles different types of alarms : seconds, minutes, ...\n" "> These alarms can be enabled or disabled individually using an AE_x bit\n" "> which is the last bit (BIT(7)) on each alarm registers.\n" - ">=20\n" + "> \n" "> To prepare the alarm IRQ support, the current code enables all the alarm\n" "> types by setting each AE_x to 1.\n" "> It also fixes others alarms issues :\n" "> - month and weekday errors : it was performing -1 instead of +1.\n" "> - wrong use of bit mask with bin2bcd\n" - ">=20\n" - "> Signed-off-by: Myl=C4=8Dne Josserand <mylene.josserand@free-electrons.com=\n" - ">\n" + "> \n" + "> Signed-off-by: Myl\303\250ne Josserand <mylene.josserand@free-electrons.com>\n" "> ---\n" "> drivers/rtc/rtc-rv3029c2.c | 25 +++++++++++++++++--------\n" "> 1 file changed, 17 insertions(+), 8 deletions(-)\n" - ">=20\n" + "> \n" "> diff --git a/drivers/rtc/rtc-rv3029c2.c b/drivers/rtc/rtc-rv3029c2.c\n" "> index cf8d465..916bbc2 100644\n" "> --- a/drivers/rtc/rtc-rv3029c2.c\n" @@ -37,75 +36,57 @@ "> #define RV3029_A_YR\t\t\t0x16\n" "> +#define RV3029_A_AE_X\t\t\tBIT(7)\n" "> #define RV3029_ALARM_SECTION_LEN\t0x07\n" - "> =20\n" + "> \n" "> /* timer section */\n" - "> @@ -436,14 +437,22 @@ static int rv3029_set_alarm(struct device *dev, str=\n" - "uct rtc_wkalrm *alarm)\n" + "> @@ -436,14 +437,22 @@ static int rv3029_set_alarm(struct device *dev, struct rtc_wkalrm *alarm)\n" "> \t\tdev_err(dev, \"%s: reading SR failed\\n\", __func__);\n" "> \t\treturn -EIO;\n" "> \t}\n" - "> -\tregs[RV3029_A_SC - RV3029_A_SC] =3D bin2bcd(tm->tm_sec & 0x7f);\n" - "> -\tregs[RV3029_A_MN - RV3029_A_SC] =3D bin2bcd(tm->tm_min & 0x7f);\n" - "> -\tregs[RV3029_A_HR - RV3029_A_SC] =3D bin2bcd(tm->tm_hour & 0x3f);\n" - "> -\tregs[RV3029_A_DT - RV3029_A_SC] =3D bin2bcd(tm->tm_mday & 0x3f);\n" - "> -\tregs[RV3029_A_MO - RV3029_A_SC] =3D bin2bcd((tm->tm_mon & 0x1f) - 1);\n" - "> -\tregs[RV3029_A_DW - RV3029_A_SC] =3D bin2bcd((tm->tm_wday & 7) - 1);\n" - "> -\tregs[RV3029_A_YR - RV3029_A_SC] =3D bin2bcd((tm->tm_year & 0x7f) - 100)=\n" - ";\n" - "> =20\n" + "> -\tregs[RV3029_A_SC - RV3029_A_SC] = bin2bcd(tm->tm_sec & 0x7f);\n" + "> -\tregs[RV3029_A_MN - RV3029_A_SC] = bin2bcd(tm->tm_min & 0x7f);\n" + "> -\tregs[RV3029_A_HR - RV3029_A_SC] = bin2bcd(tm->tm_hour & 0x3f);\n" + "> -\tregs[RV3029_A_DT - RV3029_A_SC] = bin2bcd(tm->tm_mday & 0x3f);\n" + "> -\tregs[RV3029_A_MO - RV3029_A_SC] = bin2bcd((tm->tm_mon & 0x1f) - 1);\n" + "> -\tregs[RV3029_A_DW - RV3029_A_SC] = bin2bcd((tm->tm_wday & 7) - 1);\n" + "> -\tregs[RV3029_A_YR - RV3029_A_SC] = bin2bcd((tm->tm_year & 0x7f) - 100);\n" + "> \n" "> +\t/* Activate all the alarms with AE_x bit */\n" - "> +\tregs[RV3029_A_SC - RV3029_A_SC] =3D bin2bcd(tm->tm_sec) | RV3029_A_AE_X=\n" - ";\n" - "> +\tregs[RV3029_A_MN - RV3029_A_SC] =3D bin2bcd(tm->tm_min) | RV3029_A_AE_X=\n" - ";\n" - "> +\tregs[RV3029_A_HR - RV3029_A_SC] =3D (bin2bcd(tm->tm_hour) & 0x3f)\n" + "> +\tregs[RV3029_A_SC - RV3029_A_SC] = bin2bcd(tm->tm_sec) | RV3029_A_AE_X;\n" + "> +\tregs[RV3029_A_MN - RV3029_A_SC] = bin2bcd(tm->tm_min) | RV3029_A_AE_X;\n" + "> +\tregs[RV3029_A_HR - RV3029_A_SC] = (bin2bcd(tm->tm_hour) & 0x3f)\n" "> +\t\t| RV3029_A_AE_X;\n" - "> +\tregs[RV3029_A_DT - RV3029_A_SC] =3D (bin2bcd(tm->tm_mday) & 0x3f)\n" + "> +\tregs[RV3029_A_DT - RV3029_A_SC] = (bin2bcd(tm->tm_mday) & 0x3f)\n" "> +\t\t| RV3029_A_AE_X;\n" - "> +\tregs[RV3029_A_MO - RV3029_A_SC] =3D (bin2bcd(tm->tm_mon + 1) & 0x1f)\n" + "> +\tregs[RV3029_A_MO - RV3029_A_SC] = (bin2bcd(tm->tm_mon + 1) & 0x1f)\n" "> +\t\t| RV3029_A_AE_X;\n" - "> +\tregs[RV3029_A_DW - RV3029_A_SC] =3D (bin2bcd(tm->tm_wday + 1) & 0x7)\n" + "> +\tregs[RV3029_A_DW - RV3029_A_SC] = (bin2bcd(tm->tm_wday + 1) & 0x7)\n" "> +\t\t| RV3029_A_AE_X;\n" - "> +\tregs[RV3029_A_YR - RV3029_A_SC] =3D (bin2bcd(tm->tm_year - 100))\n" + "> +\tregs[RV3029_A_YR - RV3029_A_SC] = (bin2bcd(tm->tm_year - 100))\n" "> +\t\t| RV3029_A_AE_X;\n" "> +\n" "> +\t/* Write the alarm */\n" - "> \tret =3D rv3029_write_regs(dev, RV3029_A_SC, regs,\n" + "> \tret = rv3029_write_regs(dev, RV3029_A_SC, regs,\n" "> \t\t\t\tRV3029_ALARM_SECTION_LEN);\n" "> \tif (ret < 0)\n" - "> @@ -493,7 +502,7 @@ static int rv3029_set_time(struct device *dev, struct=\n" - " rtc_time *tm)\n" - "> \tregs[RV3029_W_HOURS - RV3029_W_SEC] =3D bin2bcd(tm->tm_hour);\n" - "> \tregs[RV3029_W_DATE - RV3029_W_SEC] =3D bin2bcd(tm->tm_mday);\n" - "> \tregs[RV3029_W_MONTHS - RV3029_W_SEC] =3D bin2bcd(tm->tm_mon + 1);\n" - "> -\tregs[RV3029_W_DAYS - RV3029_W_SEC] =3D bin2bcd((tm->tm_wday & 7) + 1);\n" - "> +\tregs[RV3029_W_DAYS - RV3029_W_SEC] =3D bin2bcd(tm->tm_wday + 1) & 0x7;\n" + "> @@ -493,7 +502,7 @@ static int rv3029_set_time(struct device *dev, struct rtc_time *tm)\n" + "> \tregs[RV3029_W_HOURS - RV3029_W_SEC] = bin2bcd(tm->tm_hour);\n" + "> \tregs[RV3029_W_DATE - RV3029_W_SEC] = bin2bcd(tm->tm_mday);\n" + "> \tregs[RV3029_W_MONTHS - RV3029_W_SEC] = bin2bcd(tm->tm_mon + 1);\n" + "> -\tregs[RV3029_W_DAYS - RV3029_W_SEC] = bin2bcd((tm->tm_wday & 7) + 1);\n" + "> +\tregs[RV3029_W_DAYS - RV3029_W_SEC] = bin2bcd(tm->tm_wday + 1) & 0x7;\n" "\n" "This may go in a separate patch.\n" "\n" - "> \tregs[RV3029_W_YEARS - RV3029_W_SEC] =3D bin2bcd(tm->tm_year - 100);\n" - "> =20\n" - "> \tret =3D rv3029_write_regs(dev, RV3029_W_SEC, regs,\n" - "> --=20\n" + "> \tregs[RV3029_W_YEARS - RV3029_W_SEC] = bin2bcd(tm->tm_year - 100);\n" + "> \n" + "> \tret = rv3029_write_regs(dev, RV3029_W_SEC, regs,\n" + "> -- \n" "> 2.8.0.rc3\n" - ">=20\n" + "> \n" "\n" - "--=20\n" + "-- \n" "Alexandre Belloni, Free Electrons\n" "Embedded Linux, Kernel and Android engineering\n" - "http://free-electrons.com\n" - "\n" - "--=20\n" - "--=20\n" - "You received this message because you are subscribed to \"rtc-linux\".\n" - "Membership options at http://groups.google.com/group/rtc-linux .\n" - "Please read http://groups.google.com/group/rtc-linux/web/checklist\n" - "before submitting a driver.\n" - "---=20\n" - "You received this message because you are subscribed to the Google Groups \"=\n" - "rtc-linux\" group.\n" - "To unsubscribe from this group and stop receiving emails from it, send an e=\n" - "mail to rtc-linux+unsubscribe@googlegroups.com.\n" - For more options, visit https://groups.google.com/d/optout. + http://free-electrons.com -39db9f456a683e6df913400739d42b94479d38a84a6816e3451d251d26fb3985 +c57a74fd5d81b9df6a5a475614cc52090a49898c2d4ab1bf30e6a1af10297dd7
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.