diff for duplicates of <1499417865.15362.15.camel@baylibre.com> diff --git a/a/1.txt b/N1/1.txt index 2d4363d..8fb4b13 100644 --- a/a/1.txt +++ b/N1/1.txt @@ -4,7 +4,7 @@ On Thu, 2017-07-06 at 23:21 +0200, Thierry Reding wrote: > > fin_ns = NSEC_PER_SEC / fin_freq can introduce a significant error. > > > > Ex: fin_freq = 166666667, NSEC_PER_SEC = 1000000000 -> > ????fin_ns = 5,9999999 +> > fin_ns = 5,9999999 > > > > which is, of course, rounded down to 5. This introduce an error of ~20% > > on the period requested from the pwm. @@ -15,27 +15,27 @@ On Thu, 2017-07-06 at 23:21 +0200, Thierry Reding wrote: > > Fixes: 211ed630753d ("pwm: Add support for Meson PWM Controller") > > Signed-off-by: Jerome Brunet <jbrunet@baylibre.com> > > --- -> > ?drivers/pwm/pwm-meson.c | 15 +++++++++------ -> > ?1 file changed, 9 insertions(+), 6 deletions(-) +> > drivers/pwm/pwm-meson.c | 15 +++++++++------ +> > 1 file changed, 9 insertions(+), 6 deletions(-) > > > > diff --git a/drivers/pwm/pwm-meson.c b/drivers/pwm/pwm-meson.c > > index b911a944744a..4cdc66f7f718 100644 > > --- a/drivers/pwm/pwm-meson.c > > +++ b/drivers/pwm/pwm-meson.c > > @@ -163,7 +163,8 @@ static int meson_pwm_calc(struct meson_pwm *meson, -> > ? ??unsigned int duty, unsigned int period) -> > ?{ -> > ? unsigned int pre_div, cnt, duty_cnt; +> > unsigned int duty, unsigned int period) +> > { +> > unsigned int pre_div, cnt, duty_cnt; > > - unsigned long fin_freq = -1, fin_ns; > > + unsigned long fin_freq = -1; > > + u64 fin_ps; -> > ? -> > ? if (~(meson->inverter_mask >> id) & 0x1) -> > ? duty = period - duty; +> > +> > if (~(meson->inverter_mask >> id) & 0x1) +> > duty = period - duty; > > @@ -179,13 +180,14 @@ static int meson_pwm_calc(struct meson_pwm *meson, -> > ? } -> > ? -> > ? dev_dbg(meson->chip.dev, "fin_freq: %lu Hz\n", fin_freq); +> > } +> > +> > dev_dbg(meson->chip.dev, "fin_freq: %lu Hz\n", fin_freq); > > - fin_ns = NSEC_PER_SEC / fin_freq; > > + fin_ps = ((u64)NSEC_PER_SEC * 1000) / fin_freq; > diff --git a/a/content_digest b/N1/content_digest index 79714f0..218f76b 100644 --- a/a/content_digest +++ b/N1/content_digest @@ -1,10 +1,16 @@ "ref\020170608122416.1993-1-jbrunet@baylibre.com\0" "ref\020170608122416.1993-4-jbrunet@baylibre.com\0" "ref\020170706212154.GA28918@mithrandir\0" - "From\0jbrunet@baylibre.com (Jerome Brunet)\0" - "Subject\0[PATCH v2 3/3] pwm: meson: improve pwm calculation precision.\0" + "From\0Jerome Brunet <jbrunet@baylibre.com>\0" + "Subject\0Re: [PATCH v2 3/3] pwm: meson: improve pwm calculation precision.\0" "Date\0Fri, 07 Jul 2017 10:57:45 +0200\0" - "To\0linus-amlogic@lists.infradead.org\0" + "To\0Thierry Reding <thierry.reding@gmail.com>\0" + "Cc\0Kevin Hilman <khilman@baylibre.com>" + Neil Armstrong <narmstrong@baylibre.com> + Carlo Caione <carlo@caione.org> + linux-pwm@vger.kernel.org + linux-amlogic@lists.infradead.org + " linux-kernel@vger.kernel.org\0" "\00:1\0" "b\0" "On Thu, 2017-07-06 at 23:21 +0200, Thierry Reding wrote:\n" @@ -13,7 +19,7 @@ "> > fin_ns = NSEC_PER_SEC / fin_freq can introduce a significant error.\n" "> > \n" "> > Ex: fin_freq = 166666667, NSEC_PER_SEC = 1000000000\n" - "> > ????fin_ns = 5,9999999\n" + "> > \302\240\302\240\302\240\302\240fin_ns = 5,9999999\n" "> > \n" "> > which is, of course, rounded down to 5. This introduce an error of ~20%\n" "> > on the period requested from the pwm.\n" @@ -24,27 +30,27 @@ "> > Fixes: 211ed630753d (\"pwm: Add support for Meson PWM Controller\")\n" "> > Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>\n" "> > ---\n" - "> > ?drivers/pwm/pwm-meson.c | 15 +++++++++------\n" - "> > ?1 file changed, 9 insertions(+), 6 deletions(-)\n" + "> > \302\240drivers/pwm/pwm-meson.c | 15 +++++++++------\n" + "> > \302\2401 file changed, 9 insertions(+), 6 deletions(-)\n" "> > \n" "> > diff --git a/drivers/pwm/pwm-meson.c b/drivers/pwm/pwm-meson.c\n" "> > index b911a944744a..4cdc66f7f718 100644\n" "> > --- a/drivers/pwm/pwm-meson.c\n" "> > +++ b/drivers/pwm/pwm-meson.c\n" "> > @@ -163,7 +163,8 @@ static int meson_pwm_calc(struct meson_pwm *meson,\n" - "> > ?\t\t\t??unsigned int duty, unsigned int period)\n" - "> > ?{\n" - "> > ?\tunsigned int pre_div, cnt, duty_cnt;\n" + "> > \302\240\t\t\t\302\240\302\240unsigned int duty, unsigned int period)\n" + "> > \302\240{\n" + "> > \302\240\tunsigned int pre_div, cnt, duty_cnt;\n" "> > -\tunsigned long fin_freq = -1, fin_ns;\n" "> > +\tunsigned long fin_freq = -1;\n" "> > +\tu64 fin_ps;\n" - "> > ?\n" - "> > ?\tif (~(meson->inverter_mask >> id) & 0x1)\n" - "> > ?\t\tduty = period - duty;\n" + "> > \302\240\n" + "> > \302\240\tif (~(meson->inverter_mask >> id) & 0x1)\n" + "> > \302\240\t\tduty = period - duty;\n" "> > @@ -179,13 +180,14 @@ static int meson_pwm_calc(struct meson_pwm *meson,\n" - "> > ?\t}\n" - "> > ?\n" - "> > ?\tdev_dbg(meson->chip.dev, \"fin_freq: %lu Hz\\n\", fin_freq);\n" + "> > \302\240\t}\n" + "> > \302\240\n" + "> > \302\240\tdev_dbg(meson->chip.dev, \"fin_freq: %lu Hz\\n\", fin_freq);\n" "> > -\tfin_ns = NSEC_PER_SEC / fin_freq;\n" "> > +\tfin_ps = ((u64)NSEC_PER_SEC * 1000) / fin_freq;\n" "> \n" @@ -61,4 +67,4 @@ "> \n" > Thierry -9376c971010bc85a1ec601a6672e9e18c5164dce0aa30ce2e0808089c228d70e +941b7d720c02510f753086bdbbee1b1d9c438e0f0fdbbe03b0bc1f0590a45d36
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.