diff for duplicates of <55383625.3070108@ti.com> diff --git a/a/1.txt b/N1/1.txt index 5fad901..7ba03bb 100644 --- a/a/1.txt +++ b/N1/1.txt @@ -1,6 +1,6 @@ On 04/22/2015 08:26 AM, Grygorii.Strashko@linaro.org wrote: > Hi, -> +>=20 > On 04/21/2015 03:51 AM, Nishanth Menon wrote: >> Alarm interrupt enable register is at offset 0x7, while the time >> registers for the alarm follow that. When we program Alarm interrupt @@ -17,14 +17,14 @@ On 04/22/2015 08:26 AM, Grygorii.Strashko@linaro.org wrote: >> the time of programming the ALM0_EN bit. However, we will not have >> unexpected interrupts while the time is programmed after the interrupt >> are enabled. -> +>=20 > I think it will be nice if you will mention that you going to follow > vendor recommendations - AN1491 Configuring the MCP794XX RTCC Family > http://ww1.microchip.com/downloads/en/AppNotes/01491A.pdf > ;) > "Also, it is recommended that the alarm registers be loaded > before the alarm is enabled." -> +>=20 Hmm... i did not know that existed, thanks for digging it up.. that teaches me to look for docs before putting a scope/LA on the board @@ -58,42 +58,42 @@ ured. Alarm 1 can be configured in the same manner. 2. Write 0x47 to the Alarm0 Minutes register [0x0B]. 3. Write 0x71 to the Alarm0 Hours register [0x0C] -– 11 hours in 12-hour format. -4. Write 0x72 to the Alarm0 Day register [0x0D] – +=E2=80=93 11 hours in 12-hour format. +4. Write 0x72 to the Alarm0 Day register [0x0D] =E2=80=93 Tuesday + Alarm Polarity Low + Match on all. The Alarm0 Interrupt Flag is also cleared. 5. Write 0x14 to the Alarm0 Date register [0x0E]. 6. Write 0x08 to the Alarm0 Month register [0x0F]. With all the Alarm0 registers set we can now activate the Alarm0 on the Control register. -7. Write 0x10 to the Control register [0x07] – +7. Write 0x10 to the Control register [0x07] =E2=80=93 Alarm0 enabled no CLKOUT, Alarm1 disabled before this patch we do ( http://pastebin.ubuntu.com/10863880/) - CONTROL r[7] = 0x90 (OUT=1, ALM0EN=1) - OSCTRIM r[8] = 0x00 - EEUNLOCK r[9] = 0x00 - ALM0SEC r[A] = 0x01 - ALM0MIN r[B] = 0x45 - ALM0HOUR r[C] = 0x23 - ALM0WKDAY r[D] = 0x75 <-ALMOIF is cleared - ALM0DATE r[E] = 0x09 - ALM0MTH r[F] = 0x04 - RSRVED r[10] = 0x01 + CONTROL r[7] =3D 0x90 (OUT=3D1, ALM0EN=3D1) + OSCTRIM r[8] =3D 0x00 + EEUNLOCK r[9] =3D 0x00 + ALM0SEC r[A] =3D 0x01 + ALM0MIN r[B] =3D 0x45 + ALM0HOUR r[C] =3D 0x23 + ALM0WKDAY r[D] =3D 0x75 <-ALMOIF is cleared + ALM0DATE r[E] =3D 0x09 + ALM0MTH r[F] =3D 0x04 + RSRVED r[10] =3D 0x01 with this patch, we do: -burst( CONTROL r[7] = 0x80 (OUT=1) - OSCTRIM r[8] = 0x00 - EEUNLOCK r[9] = 0x00 - ALM0SEC r[A] = 0x01 - ALM0MIN r[B] = 0x45 - ALM0HOUR r[C] = 0x23 - ALM0WKDAY r[D] = 0x75 <-ALMOIF is cleared - ALM0DATE r[E] = 0x09 - ALM0MTH r[F] = 0x04 - RSRVED r[10] = 0x01 +burst( CONTROL r[7] =3D 0x80 (OUT=3D1) + OSCTRIM r[8] =3D 0x00 + EEUNLOCK r[9] =3D 0x00 + ALM0SEC r[A] =3D 0x01 + ALM0MIN r[B] =3D 0x45 + ALM0HOUR r[C] =3D 0x23 + ALM0WKDAY r[D] =3D 0x75 <-ALMOIF is cleared + ALM0DATE r[E] =3D 0x09 + ALM0MTH r[F] =3D 0x04 + RSRVED r[10] =3D 0x01 ) - CONTROL r[7] = 0x90 (OUT=1, ALM0EN=1) + CONTROL r[7] =3D 0x90 (OUT=3D1, ALM0EN=3D1) Which is slightly unoptimal way of what the app note recommends. - as I mentioned earlier in this thread, I will try and do optimizations in @@ -119,28 +119,32 @@ thanks for pointing it out to me. >> index 4ffabb322a9a..3cd4783375a5 100644 >> --- a/drivers/rtc/rtc-ds1307.c >> +++ b/drivers/rtc/rtc-ds1307.c ->> @@ -742,17 +742,17 @@ static int mcp794xx_set_alarm(struct device *dev, struct rtc_wkalrm *t) ->> regs[6] &= ~MCP794XX_BIT_ALMX_IF; +>> @@ -742,17 +742,17 @@ static int mcp794xx_set_alarm(struct device *dev, = +struct rtc_wkalrm *t) +>> regs[6] &=3D ~MCP794XX_BIT_ALMX_IF; >> /* Set alarm match: second, minute, hour, day, date, month. */ ->> regs[6] |= MCP794XX_MSK_ALMX_MATCH; +>> regs[6] |=3D MCP794XX_MSK_ALMX_MATCH; >> - >> - if (t->enabled) ->> - regs[0] |= MCP794XX_BIT_ALM0_EN; +>> - regs[0] |=3D MCP794XX_BIT_ALM0_EN; >> - else ->> - regs[0] &= ~MCP794XX_BIT_ALM0_EN; ->> + /* Disable interrupt. We will not enable until completely programmed */ ->> + regs[0] &= ~MCP794XX_BIT_ALM0_EN; ->> ->> ret = ds1307->write_block_data(client, MCP794XX_REG_CONTROL, 10, regs); +>> - regs[0] &=3D ~MCP794XX_BIT_ALM0_EN; +>> + /* Disable interrupt. We will not enable until completely programmed *= +/ +>> + regs[0] &=3D ~MCP794XX_BIT_ALM0_EN; +>> =20 +>> ret =3D ds1307->write_block_data(client, MCP794XX_REG_CONTROL, 10, re= +gs); >> if (ret < 0) >> return ret; ->> +>> =20 >> - return 0; >> + if (!t->enabled) >> + return 0; ->> + regs[0] |= MCP794XX_BIT_ALM0_EN; ->> + return i2c_smbus_write_byte_data(client, MCP794XX_REG_CONTROL, regs[0]); -> +>> + regs[0] |=3D MCP794XX_BIT_ALM0_EN; +>> + return i2c_smbus_write_byte_data(client, MCP794XX_REG_CONTROL, regs[0]= +); +>=20 > So, It seems, that right sequence should be: > - disable alarmX > - read alarmX regs @@ -156,19 +160,34 @@ anyways..)... Will have to think more about optimizing more later. -> -> More over, looks like, alarm/alarm IRQ should be enabled/disabled separately from set_alarm/RTC_ALM_SET +>=20 +> More over, looks like, alarm/alarm IRQ should be enabled/disabled separat= +ely from set_alarm/RTC_ALM_SET > by RTC_AIE_ON, RTC_AIE_OFF. Should it? -> +>=20 >> } ->> ->> static int mcp794xx_alarm_irq_enable(struct device *dev, unsigned int enabled) +>> =20 +>> static int mcp794xx_alarm_irq_enable(struct device *dev, unsigned int = +enabled) >> -> -> +>=20 +>=20 --- +--=20 Regards, Nishanth Menon + +--=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 30ce13f..1645dc8 100644 --- a/a/content_digest +++ b/N1/content_digest @@ -1,19 +1,19 @@ "ref\01429577494-15087-1-git-send-email-nm@ti.com\0" "ref\05537A169.206@linaro.org\0" "From\0Nishanth Menon <nm@ti.com>\0" - "Subject\0Re: [PATCH V2] drivers/rtc/rtc-ds1307.c: Enable the mcp794xx alarm after programming time\0" + "Subject\0[rtc-linux] Re: [PATCH V2] drivers/rtc/rtc-ds1307.c: Enable the mcp794xx alarm after programming time\0" "Date\0Wed, 22 Apr 2015 19:00:37 -0500\0" "To\0Grygorii.Strashko@linaro.org <grygorii.strashko@linaro.org>" Alexandre Belloni <alexandre.belloni@free-electrons.com> " Alessandro Zummo <a.zummo@towertech.it>\0" - "Cc\0linux-omap@vger.kernel.org" - linux-kernel@vger.kernel.org - " rtc-linux@googlegroups.com\0" + "Cc\0<linux-omap@vger.kernel.org>" + <linux-kernel@vger.kernel.org> + " <rtc-linux@googlegroups.com>\0" "\00:1\0" "b\0" "On 04/22/2015 08:26 AM, Grygorii.Strashko@linaro.org wrote:\n" "> Hi,\n" - "> \n" + ">=20\n" "> On 04/21/2015 03:51 AM, Nishanth Menon wrote:\n" ">> Alarm interrupt enable register is at offset 0x7, while the time\n" ">> registers for the alarm follow that. When we program Alarm interrupt\n" @@ -30,14 +30,14 @@ ">> the time of programming the ALM0_EN bit. However, we will not have\n" ">> unexpected interrupts while the time is programmed after the interrupt\n" ">> are enabled.\n" - "> \n" + ">=20\n" "> I think it will be nice if you will mention that you going to follow\n" "> vendor recommendations - AN1491 Configuring the MCP794XX RTCC Family\n" "> http://ww1.microchip.com/downloads/en/AppNotes/01491A.pdf\n" "> ;)\n" "> \"Also, it is recommended that the alarm registers be loaded\n" "> before the alarm is enabled.\"\n" - "> \n" + ">=20\n" "\n" "Hmm... i did not know that existed, thanks for digging it up.. that\n" "teaches me to look for docs before putting a scope/LA on the board\n" @@ -71,42 +71,42 @@ "2. Write 0x47 to the Alarm0 Minutes register\n" "[0x0B].\n" "3. Write 0x71 to the Alarm0 Hours register [0x0C]\n" - "\342\200\223 11 hours in 12-hour format.\n" - "4. Write 0x72 to the Alarm0 Day register [0x0D] \342\200\223\n" + "=E2=80=93 11 hours in 12-hour format.\n" + "4. Write 0x72 to the Alarm0 Day register [0x0D] =E2=80=93\n" "Tuesday + Alarm Polarity Low + Match on all.\n" "The Alarm0 Interrupt Flag is also cleared.\n" "5. Write 0x14 to the Alarm0 Date register [0x0E].\n" "6. Write 0x08 to the Alarm0 Month register [0x0F].\n" "With all the Alarm0 registers set we can now activate\n" "the Alarm0 on the Control register.\n" - "7. Write 0x10 to the Control register [0x07] \342\200\223\n" + "7. Write 0x10 to the Control register [0x07] =E2=80=93\n" "Alarm0 enabled no CLKOUT, Alarm1 disabled\n" "\n" "before this patch we do ( http://pastebin.ubuntu.com/10863880/)\n" - "\tCONTROL r[7] = 0x90 (OUT=1, ALM0EN=1)\n" - "\tOSCTRIM r[8] = 0x00\n" - "\tEEUNLOCK r[9] = 0x00\n" - "\tALM0SEC r[A] = 0x01\n" - "\tALM0MIN r[B] = 0x45\n" - "\tALM0HOUR r[C] = 0x23\n" - "\tALM0WKDAY r[D] = 0x75 <-ALMOIF is cleared\n" - "\tALM0DATE r[E] = 0x09\n" - "\tALM0MTH r[F] = 0x04\n" - "\tRSRVED r[10] = 0x01\n" + "\tCONTROL r[7] =3D 0x90 (OUT=3D1, ALM0EN=3D1)\n" + "\tOSCTRIM r[8] =3D 0x00\n" + "\tEEUNLOCK r[9] =3D 0x00\n" + "\tALM0SEC r[A] =3D 0x01\n" + "\tALM0MIN r[B] =3D 0x45\n" + "\tALM0HOUR r[C] =3D 0x23\n" + "\tALM0WKDAY r[D] =3D 0x75 <-ALMOIF is cleared\n" + "\tALM0DATE r[E] =3D 0x09\n" + "\tALM0MTH r[F] =3D 0x04\n" + "\tRSRVED r[10] =3D 0x01\n" "\n" "with this patch, we do:\n" - "burst(\tCONTROL r[7] = 0x80 (OUT=1)\n" - "\tOSCTRIM r[8] = 0x00\n" - "\tEEUNLOCK r[9] = 0x00\n" - "\tALM0SEC r[A] = 0x01\n" - "\tALM0MIN r[B] = 0x45\n" - "\tALM0HOUR r[C] = 0x23\n" - "\tALM0WKDAY r[D] = 0x75 <-ALMOIF is cleared\n" - "\tALM0DATE r[E] = 0x09\n" - "\tALM0MTH r[F] = 0x04\n" - "\tRSRVED r[10] = 0x01\n" + "burst(\tCONTROL r[7] =3D 0x80 (OUT=3D1)\n" + "\tOSCTRIM r[8] =3D 0x00\n" + "\tEEUNLOCK r[9] =3D 0x00\n" + "\tALM0SEC r[A] =3D 0x01\n" + "\tALM0MIN r[B] =3D 0x45\n" + "\tALM0HOUR r[C] =3D 0x23\n" + "\tALM0WKDAY r[D] =3D 0x75 <-ALMOIF is cleared\n" + "\tALM0DATE r[E] =3D 0x09\n" + "\tALM0MTH r[F] =3D 0x04\n" + "\tRSRVED r[10] =3D 0x01\n" ")\n" - "\tCONTROL r[7] = 0x90 (OUT=1, ALM0EN=1)\n" + "\tCONTROL r[7] =3D 0x90 (OUT=3D1, ALM0EN=3D1)\n" "\n" "Which is slightly unoptimal way of what the app note recommends. - as\n" "I mentioned earlier in this thread, I will try and do optimizations in\n" @@ -132,28 +132,32 @@ ">> index 4ffabb322a9a..3cd4783375a5 100644\n" ">> --- a/drivers/rtc/rtc-ds1307.c\n" ">> +++ b/drivers/rtc/rtc-ds1307.c\n" - ">> @@ -742,17 +742,17 @@ static int mcp794xx_set_alarm(struct device *dev, struct rtc_wkalrm *t)\n" - ">> \tregs[6] &= ~MCP794XX_BIT_ALMX_IF;\n" + ">> @@ -742,17 +742,17 @@ static int mcp794xx_set_alarm(struct device *dev, =\n" + "struct rtc_wkalrm *t)\n" + ">> \tregs[6] &=3D ~MCP794XX_BIT_ALMX_IF;\n" ">> \t/* Set alarm match: second, minute, hour, day, date, month. */\n" - ">> \tregs[6] |= MCP794XX_MSK_ALMX_MATCH;\n" + ">> \tregs[6] |=3D MCP794XX_MSK_ALMX_MATCH;\n" ">> -\n" ">> -\tif (t->enabled)\n" - ">> -\t\tregs[0] |= MCP794XX_BIT_ALM0_EN;\n" + ">> -\t\tregs[0] |=3D MCP794XX_BIT_ALM0_EN;\n" ">> -\telse\n" - ">> -\t\tregs[0] &= ~MCP794XX_BIT_ALM0_EN;\n" - ">> +\t/* Disable interrupt. We will not enable until completely programmed */\n" - ">> +\tregs[0] &= ~MCP794XX_BIT_ALM0_EN;\n" - ">> \n" - ">> \tret = ds1307->write_block_data(client, MCP794XX_REG_CONTROL, 10, regs);\n" + ">> -\t\tregs[0] &=3D ~MCP794XX_BIT_ALM0_EN;\n" + ">> +\t/* Disable interrupt. We will not enable until completely programmed *=\n" + "/\n" + ">> +\tregs[0] &=3D ~MCP794XX_BIT_ALM0_EN;\n" + ">> =20\n" + ">> \tret =3D ds1307->write_block_data(client, MCP794XX_REG_CONTROL, 10, re=\n" + "gs);\n" ">> \tif (ret < 0)\n" ">> \t\treturn ret;\n" - ">> \n" + ">> =20\n" ">> -\treturn 0;\n" ">> +\tif (!t->enabled)\n" ">> +\t\treturn 0;\n" - ">> +\tregs[0] |= MCP794XX_BIT_ALM0_EN;\n" - ">> +\treturn i2c_smbus_write_byte_data(client, MCP794XX_REG_CONTROL, regs[0]);\n" - "> \n" + ">> +\tregs[0] |=3D MCP794XX_BIT_ALM0_EN;\n" + ">> +\treturn i2c_smbus_write_byte_data(client, MCP794XX_REG_CONTROL, regs[0]=\n" + ");\n" + ">=20\n" "> So, It seems, that right sequence should be:\n" "> - disable alarmX\n" "> - read alarmX regs\n" @@ -169,21 +173,36 @@ "\n" "Will have to think more about optimizing more later.\n" "\n" - "> \n" - "> More over, looks like, alarm/alarm IRQ should be enabled/disabled separately from set_alarm/RTC_ALM_SET\n" + ">=20\n" + "> More over, looks like, alarm/alarm IRQ should be enabled/disabled separat=\n" + "ely from set_alarm/RTC_ALM_SET\n" "> by RTC_AIE_ON, RTC_AIE_OFF. Should it?\n" "\n" - "> \n" + ">=20\n" ">> }\n" - ">> \n" - ">> static int mcp794xx_alarm_irq_enable(struct device *dev, unsigned int enabled)\n" + ">> =20\n" + ">> static int mcp794xx_alarm_irq_enable(struct device *dev, unsigned int =\n" + "enabled)\n" ">>\n" - "> \n" - "> \n" + ">=20\n" + ">=20\n" "\n" "\n" - "-- \n" + "--=20\n" "Regards,\n" - Nishanth Menon + "Nishanth Menon\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. -c5950b4560e9e66859fb70995b236828dbde693de03fdf4a3663e7d89d528fd0 +b84fdb3b23e36a1bb1dcc61a7e335fcbe3950ff9fba0ff5c19c537a871b1f02d
diff --git a/a/content_digest b/N2/content_digest index 30ce13f..d69baa7 100644 --- a/a/content_digest +++ b/N2/content_digest @@ -6,9 +6,9 @@ "To\0Grygorii.Strashko@linaro.org <grygorii.strashko@linaro.org>" Alexandre Belloni <alexandre.belloni@free-electrons.com> " Alessandro Zummo <a.zummo@towertech.it>\0" - "Cc\0linux-omap@vger.kernel.org" - linux-kernel@vger.kernel.org - " rtc-linux@googlegroups.com\0" + "Cc\0<linux-omap@vger.kernel.org>" + <linux-kernel@vger.kernel.org> + " <rtc-linux@googlegroups.com>\0" "\00:1\0" "b\0" "On 04/22/2015 08:26 AM, Grygorii.Strashko@linaro.org wrote:\n" @@ -186,4 +186,4 @@ "Regards,\n" Nishanth Menon -c5950b4560e9e66859fb70995b236828dbde693de03fdf4a3663e7d89d528fd0 +c83ec9247620a767c9a7cb843f4ba51c81ef658fa0fa5d3cfba3bbfab8087107
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.