From: Conor Dooley <conor.dooley@microchip.com>
To: "Thierry Reding" <thierry.reding@gmail.com>,
"Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>,
"Lee Jones" <lee.jones@linaro.org>
Cc: Daire McNamara <daire.mcnamara@microchip.com>,
<linux-kernel@vger.kernel.org>, <linux-pwm@vger.kernel.org>,
<linux-riscv@lists.infradead.org>,
Conor Dooley <conor.dooley@microchip.com>
Subject: [PATCH v3 0/2] Add support for Microchip's pwm fpga core
Date: Fri, 17 Jun 2022 12:44:41 +0100 [thread overview]
Message-ID: <20220617114442.998357-1-conor.dooley@microchip.com> (raw)
Hey Uwe,
Got a ~v2~ v3 for you...
I added some comments explaining the calculations and a documentation link
so hopefully things are a bit easier to follow.
Code wise, I went through and sorted out a bunch of issues that cycling
through the different periods/duties threw up. Along the way I found
some other problems - especially with the longer periods which I have
fixed. I also added a write to the sync register in the apply function,
which will resolve to a NOP for channels without "shadow registers".
Other than that, I managed to ditch the mchp_core_pwm_registers struct
entirely but had to add a short delay before reading back the registers
in order to compute the duty.
Thanks,
Conor.
Changes from v2:
- fix percieved idempotency and rounding issues when shadow registers were
enabled
- use do_div() for divide of u64 tmp in apply_period()
Changes from v1:
- account for edge "quirk" while inverted
- block changing enabled channels' period
- document the hardware/driver limitations
- rearrange get_state() more logically
- fix cast sizes in get_state()
- fix remove() and probe error paths
- delete mchp_core_pwm_registers
- simplify .apply() logic
- don't warn in calculate_base()
- fix period calculation
- fix duty cycle calculation
- add COREPWM prefix to defines
- add a documentation link
Conor Dooley (2):
pwm: add microchip soft ip corePWM driver
MAINTAINERS: add pwm to PolarFire SoC entry
MAINTAINERS | 1 +
drivers/pwm/Kconfig | 10 +
drivers/pwm/Makefile | 1 +
drivers/pwm/pwm-microchip-core.c | 325 +++++++++++++++++++++++++++++++
4 files changed, 337 insertions(+)
create mode 100644 drivers/pwm/pwm-microchip-core.c
base-commit: 61114e734ccb804bc12561ab4020745e02c468c2
--
2.36.1
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
next reply other threads:[~2022-06-17 13:01 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-17 11:44 Conor Dooley [this message]
2022-06-17 11:44 ` [PATCH v3 1/2] pwm: add microchip soft ip corePWM driver Conor Dooley
2022-07-01 9:51 ` Uwe Kleine-König
2022-07-01 17:56 ` Conor.Dooley
2022-06-17 11:44 ` [PATCH v3 2/2] MAINTAINERS: add pwm to PolarFire SoC entry Conor Dooley
2022-07-01 12:56 ` Uwe Kleine-König
2022-06-17 11:50 ` [PATCH v3 0/2] Add support for Microchip's pwm fpga core Conor.Dooley
2022-06-17 13:09 ` Uwe Kleine-König
2022-06-17 13:13 ` Conor.Dooley
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220617114442.998357-1-conor.dooley@microchip.com \
--to=conor.dooley@microchip.com \
--cc=daire.mcnamara@microchip.com \
--cc=lee.jones@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pwm@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=thierry.reding@gmail.com \
--cc=u.kleine-koenig@pengutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox