devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCHv2 0/3] phy: Add exynos-simple-phy driver
@ 2014-04-08 14:37 Tomasz Stanislawski
  2014-04-08 14:37 ` [PATCHv2 1/3] " Tomasz Stanislawski
                   ` (2 more replies)
  0 siblings, 3 replies; 21+ messages in thread
From: Tomasz Stanislawski @ 2014-04-08 14:37 UTC (permalink / raw)
  To: linux-kernel, linux-samsung-soc, devicetree, linux-media,
	dri-devel
  Cc: Tomasz Stanislawski, kgene.kim, kishon, kyungmin.park, robh+dt,
	grant.likely, sylvester.nawrocki, rahul.sharma

Hello everyone,

The Samsung SoCs from Exynos family are enhanced with a bunch of devices that
provide functionality of a physical layer for interfaces like USB, HDMI, SATA,
etc. They are controlled by a simple interface, often a single bit that enables
and/or resets the physical layer.

An IP driver should to control such a controller in an abstract manner.
Therefore, such 'enablers' were implemented as clocks in older versions of
Linux kernel.  With the dawn of PHY subsystems, PHYs become a natural way of
exporting the 'enabler' functionality to drivers.  However, there is an
unexpected consequence. Some of those 1-bit PHYs were implemented as separate
drivers.  This means that one has to create a struct device, struct phy, its
phy provider and 100-150 lines of driver code to basically set one bit.

The DP phy driver is a good example:
https://lkml.org/lkml/2013/7/18/53

And simple-phy RFC (shares only driver code but not other resources):
https://lkml.org/lkml/2013/10/21/313

To avoid waste of resources I propose to create all such 1-bit phys from Exynos
SoC using a single device, driver and phy provider.

This patchset contains a proposed solution.

All comment are welcome.

Hopefully in future the functionality introduced by this patch may be merged
into a larger Power Management Unit (PMU) gluer driver.  On Samsusng SoC , the
PMU part contains a number of register barely linked to power management (like
clock gating, clock dividers, CPU resetting, etc.).  It may be tempting to
create a hybrid driver that export clocks/phys/etc that are controlled by PMU
unit.

Alternative solutions might be:
* exporting a regmap to the IP driver and allow the driver to control the PHY layer
  like in the patch:
  http://thread.gmane.org/gmane.linux.kernel.samsung-soc/28617/focus=28648

* create a dedicated power domain for hdmiphy

Regards,
Tomasz Stanislawski

Changelog:
v2:
	* rename to exynos-simple-phy
	* fix usage of devm_ioremap()
	* add documentation for DT bindings
	* add patches to client drivers

v1: initial version

Tomasz Stanislawski (3):
  phy: Add exynos-simple-phy driver
  drm: exynos: hdmi: use hdmiphy as PHY
  s5p-tv: hdmi: use hdmiphy as PHY

 .../devicetree/bindings/phy/samsung-phy.txt        |   24 +++
 drivers/gpu/drm/exynos/exynos_hdmi.c               |   11 +-
 drivers/media/platform/s5p-tv/hdmi_drv.c           |   11 +-
 drivers/phy/Kconfig                                |    5 +
 drivers/phy/Makefile                               |    1 +
 drivers/phy/exynos-simple-phy.c                    |  154 ++++++++++++++++++++
 6 files changed, 196 insertions(+), 10 deletions(-)
 create mode 100644 drivers/phy/exynos-simple-phy.c

-- 
1.7.9.5

^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2014-05-13 11:20 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-08 14:37 [PATCHv2 0/3] phy: Add exynos-simple-phy driver Tomasz Stanislawski
2014-04-08 14:37 ` [PATCHv2 1/3] " Tomasz Stanislawski
2014-04-09  8:37   ` Andrzej Hajda
2014-04-09  9:12     ` Rahul Sharma
2014-04-09 10:01       ` Sylwester Nawrocki
2014-05-05  9:44         ` Kishon Vijay Abraham I
2014-05-07 10:38           ` Rahul Sharma
2014-05-07 13:36             ` Tomasz Stanislawski
2014-05-07 14:19               ` Rahul Sharma
2014-05-07 15:33                 ` Tomasz Figa
2014-05-13 11:20                   ` Rahul Sharma
2014-04-09 11:14       ` Tomasz Stanislawski
2014-04-09 11:47     ` Andreas Oberritter
2014-04-30  6:37       ` Rahul Sharma
2014-04-30  8:32         ` Tomasz Stanislawski
2014-04-30  8:43           ` Rahul Sharma
2014-04-08 14:37 ` [PATCHv2 2/3] drm: exynos: hdmi: use hdmiphy as PHY Tomasz Stanislawski
2014-04-09 10:30   ` Andrzej Hajda
2014-04-09 10:46     ` Rahul Sharma
2014-04-09 11:05     ` Tomasz Stanislawski
2014-04-08 14:37 ` [PATCHv2 3/3] s5p-tv: " Tomasz Stanislawski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).