lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <1420651215-3836-1-git-send-email-ezequiel.garcia@imgtec.com>
Date:	Wed, 7 Jan 2015 14:20:11 -0300
From:	Ezequiel Garcia <ezequiel.garcia@...tec.com>
To:	Andrew Bresticker <abrestic@...omium.org>,
	Thierry Reding <thierry.reding@...il.com>,
	James Hartley <james.hartley@...tec.com>,
	"Arnd Bergmann" <arnd@...db.de>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>
CC:	<devicetree@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
	<linux-pwm@...r.kernel.org>,
	Ezequiel Garcia <ezequiel.garcia@...tec.com>
Subject: [PATCH v7 0/4] Imagination Technologies PWM and PDM DACs support

This patchset is the seventh round for the IMG PWM and PDM DAC drivers.

The PWM driver is a typical PWM, and I don't think there's anything
controversial there.

The PDM driver -on the other side- is a bit ackward. At first, we tried
to support it as a PWM, but after some lengthy discussions, we came to the
conclusion the controller couldn't be configured with duty and period,
so it was agreed [1] to write a misc driver for it.

Given there won't be any framework (the controller is too rare to justify
a new framework), an internal API is needed. We've tried to keep this API
as simple as possible. Also, we've tried to follow a devicetree binding
similar to the PWM one.

Users of the PDM can call a couple functions to request a channel and
release the resource:

  struct img_pdm_channel *img_pdm_channel_get(struct device *dev);
  void img_pdm_channel_put(struct device *dev);

After requesting a PDM channel, users can enable or configure it:

  int img_pdm_channel_enable(struct img_pdm_channel *chan, bool state);
  int img_pdm_channel_config(struct img_pdm_channel *chan, unsigned int val);

Where 'val' is a hardware-specific quantity, namely, a 12-bit value
that is added to the PDM counter:

  counter [12:0] = counter [11:0] + value [11:0]
  PDM output = counter [12]

Hence, by changing the 'value' it's possible to control the pulse density
(lower values, correspond to lower densities).

Given this looks like very platform-specific, I feel the misc driver is a good
solution, but I'm open to discussion about it.

The reason why these two drivers are being sent together is because of the
peripheral register that is used to enable an output, and mux it as PWM or PDM.
Because this register is not part of the pin controller block, but rather
PWM/PDM specific, and because the register is also used to set the PDM value,
it is simpler to use a regmap-based syscon to deal with it.

The series is based on v3.19-rc3. My goal is to merge at least the PWM driver
for v3.20, if we fail to agree on the PDM driver.

[1] http://www.spinics.net/lists/linux-pwm/msg01990.html

Naidu Tellapati (4):
  pwm: Imagination Technologies PWM DAC driver
  DT: pwm: Add binding document for IMG PWM DAC
  pdm: Imagination Technologies PDM DAC driver
  DT: pdm: Add binding document for IMG PDM DAC

 Documentation/devicetree/bindings/misc/img-pdm.txt |  54 ++
 Documentation/devicetree/bindings/pwm/img-pwm.txt  |  24 +
 drivers/misc/Kconfig                               |  13 +
 drivers/misc/Makefile                              |   1 +
 drivers/misc/img-pdm.c                             | 608 +++++++++++++++++++++
 drivers/pwm/Kconfig                                |  13 +
 drivers/pwm/Makefile                               |   1 +
 drivers/pwm/pwm-img.c                              | 250 +++++++++
 include/linux/img_pdm.h                            |  27 +
 9 files changed, 991 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/misc/img-pdm.txt
 create mode 100644 Documentation/devicetree/bindings/pwm/img-pwm.txt
 create mode 100644 drivers/misc/img-pdm.c
 create mode 100644 drivers/pwm/pwm-img.c
 create mode 100644 include/linux/img_pdm.h

-- 
2.2.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ