Crystal Cove PMIC based Panel and Backlight Control
Subsystems (6)
v3 cover Crystal Cove PMIC based Panel and Backlight Control
Hi All
Please find modifed set of patches using regmap interface to accedd the PMIC registers. These patches implement a drm_panel as a platform driver for the mfd_cell device declared in intel_soc_pmic_core.c.
DRM is extended to provide a find panel by name in absence of OF.
Backlight control is pending. For now I am doing Backlight Enable/Disable also during panel/enable as this will at least save power.
Regards
Shobhit
Shobhit Kumar (4):
drm: Add support to find drm_panel by name
mfd: Add a new cell device for panel controlled by crystal cove pmic drm/i915: Add new panel driver based on crystal cove pmic drm/i915: Enable DSI panel enable/disable based on PMIC
drivers/gpu/drm/drm_panel.c | 18 +++ drivers/gpu/drm/i915/Kconfig | 13 ++ drivers/gpu/drm/i915/Makefile | 3 + drivers/gpu/drm/i915/intel-panel-crystalcove.c | 160 +++++++++++++++++++++++++ drivers/gpu/drm/i915/intel_dsi.c | 16 +++ drivers/gpu/drm/i915/intel_dsi.h | 6 + drivers/mfd/intel_soc_pmic_crc.c | 3 + include/drm/drm_panel.h | 3 + 8 files changed, 222 insertions(+) create mode 100644 drivers/gpu/drm/i915/intel-panel-crystalcove.c
Signature · 6 lines
1.9.1 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
RFC v3 1/4 drm: Add support to find drm_panel by name
For scenarios where OF is not available, we can use panel identification by name.
--- drivers/gpu/drm/drm_panel.c | 18 ++++++++++++++++++ include/drm/drm_panel.h | 3 +++ 2 files changed, 21 insertions(+)
drivers/gpu/drm/drm_panel.c +18 -0
@@ -95,6 +95,24 @@ struct drm_panel *of_drm_find_panel(struct device_node *np)EXPORT_SYMBOL (of_drm_find_panel);#endif +struct drm_panel *drm_find_panel_by_name (const char *name) +{ +struct drm_panel *panel; + +mutex_lock (&panel_lock); + +list_for_each_entry (panel, &panel_list, list) { +if (strcmp (panel->name, name) ==0 ) { +mutex_unlock (&panel_lock); +return panel; + } + } + +mutex_unlock (&panel_lock); +return NULL ; +} +EXPORT_SYMBOL (drm_find_panel_by_name); +MODULE_AUTHOR ("Thierry Reding <[email protected]>" );MODULE_DESCRIPTION ("DRM panel infrastructure" );MODULE_LICENSE ("GPL and additional rights" );
include/drm/drm_panel.h +3 -0
@@ -74,6 +74,7 @@ struct drm_panel {struct drm_device *drm;struct drm_connector *connector;struct device *dev; +char name[NAME_MAX ];const struct drm_panel_funcs *funcs;
@@ -137,4 +138,6 @@ static inline struct drm_panel *of_drm_find_panel(struct device_node *np) }#endif +struct drm_panel *drm_find_panel_by_name (const char *name); +#endif
Signature · 6 lines
1.9.1 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [RFC v3 1/4] drm: Add support to find drm_panel by name
Quoted 2 lines · Shobhit Kumar
For scenarios where OF is not available, we can use panel identification by name.
Any body had a look at this ?
Regards
Shobhit
Quoted 50 lines
Signed-off-by Shobhit Kumar <[email protected]>--- drivers/gpu/drm/drm_panel.c | 18 ++++++++++++++++++ include/drm/drm_panel.h | 3 +++ 2 files changed, 21 insertions(+)drivers/gpu/drm/drm_panel.c +18
-0@@ -95,6 +95,24 @@ struct drm_panel *of_drm_find_panel(struct device_node *np)EXPORT_SYMBOL (of_drm_find_panel);#endif +struct drm_panel *drm_find_panel_by_name (const char *name) +{ +struct drm_panel *panel; + +mutex_lock (&panel_lock); + +list_for_each_entry (panel, &panel_list, list) { +if (strcmp (panel->name, name) ==0 ) { +mutex_unlock (&panel_lock); +return panel; + } + } + +mutex_unlock (&panel_lock); +return NULL ; +} +EXPORT_SYMBOL (drm_find_panel_by_name); +MODULE_AUTHOR ("Thierry Reding <[email protected]>" );MODULE_DESCRIPTION ("DRM panel infrastructure" );MODULE_LICENSE ("GPL and additional rights" );include/drm/drm_panel.h +1
-0@@ -74,6 +74,7 @@ struct drm_panel {struct drm_device *drm;struct drm_connector *connector;struct device *dev; +char name[NAME_MAX ];const struct drm_panel_funcs *funcs;
include/drm/drm_panel.h static inline struct drm_panel *of_drm_find_panel(struct device_node *np) · line 143
Quoted 6 lines
include/drm/drm_panel.h +2
-0@@ -137,4 +138,6 @@ static inline struct drm_panel *of_drm_find_panel(struct device_node *np) }#endif +struct drm_panel *drm_find_panel_by_name (const char *name); +#endif
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
RFC v3 2/4 mfd: Add a new cell device for panel controlled by crystal cove pmic
In reply to Shobhit KumarOn BYT-T configuration, panel enable/disable signals are routed through PMIC. Add a cell device for the same.
--- drivers/mfd/intel_soc_pmic_crc.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/mfd/intel_soc_pmic_crc.c +3 -0
@@ -109,6 +109,9 @@ static struct mfd_cell crystal_cove_dev[] = { { .name = "crystal_cove_pmic", }, + { + .name = "crystal_cove_panel", + }, }; static struct regmap_config crystal_cove_regmap_config = {
Signature · 6 lines
1.9.1 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
RFC v3 3/4 drm/i915: Add new panel driver based on crystal cove pmic
In reply to Shobhit KumarThis driver provides support for the "crystal_cove_panel" cell device. On BYT-T pmic has to be used to enable/disable panel.
v2: Addressed Jani's comments
- Moved inside i915
- Correct licensing
- Remove unused stuff
- Do not initialize prepare/unprepare as they are not needed as of now
- Correct backlight off delay
--- drivers/gpu/drm/i915/Kconfig | 12 ++ drivers/gpu/drm/i915/Makefile | 3 + drivers/gpu/drm/i915/intel-panel-crystalcove.c | 159 +++++++++++++++++++++++++ 3 files changed, 174 insertions(+) create mode 100644 drivers/gpu/drm/i915/intel-panel-crystalcove.c
drivers/gpu/drm/i915/Kconfig +12 -0
@@ -69,3 +69,15 @@ config DRM_I915_PRELIMINARY_HW_SUPPORT option changes the default for that module option. If in doubt, say "N". + +config DRM_I915_PANEL_CRYSTALCOVE_PMIC + bool "Enable drm panel for crystal cove pmic based control" + depends on DRM_I915 + depends on DRM_PANEL + default n + help + Choose this option if you have BYT-T based device with DSI panel. On + BYT-T there a crystal cove PMIC which controls the PANEL EN/DISABLE + signals. + + If in doubt, say "N".
drivers/gpu/drm/i915/Makefile +3 -0
@@ -88,4 +88,7 @@ i915-y += i915_dma.o \ obj-$(CONFIG_DRM_I915) += i915.o +# I915 DRM Panels +obj-$(CONFIG_DRM_I915_PANEL_CRYSTALCOVE_PMIC) += intel-panel-crystalcove.o + CFLAGS_i915_trace_points.o := -I$(src)
drivers/gpu/drm/i915/intel-panel-crystalcove.c new file +159 -0
159 lines not on this page · raw message
Signature · 6 lines
1.9.1 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
RFC v3 4/4 drm/i915: Enable DSI panel enable/disable based on PMIC
In reply to Shobhit KumarThis allows for proper PPS during enable/disable of BYT-T platforms where these signals are routed through PMIC. Needs DRM_PANEL to be selected by default as well
v2: Adapt to panel find function name change in drm_panel
--- drivers/gpu/drm/i915/Kconfig | 1 + drivers/gpu/drm/i915/intel-panel-crystalcove.c | 1 + drivers/gpu/drm/i915/intel_dsi.c | 16 ++++++++++++++++ drivers/gpu/drm/i915/intel_dsi.h | 6 ++++++ 4 files changed, 24 insertions(+)
drivers/gpu/drm/i915/Kconfig +1 -0
@@ -18,6 +18,7 @@ config DRM_I915 select INPUT if ACPI select ACPI_VIDEO if ACPI select ACPI_BUTTON if ACPI + select DRM_PANEL help Choose this option if you have a system that has "Intel Graphics Media Accelerator" or "HD Graphics" integrated graphics,
drivers/gpu/drm/i915/intel-panel-crystalcove.c +1 -0
@@ -154,6 +154,7 @@ static struct platform_driver crystalcove_panel_driver = {module_platform_driver (crystalcove_panel_driver); +MODULE_ALIAS ();MODULE_AUTHOR ("Shobhit Kumar <[email protected]" );MODULE_DESCRIPTION ("Intel Crystal Cove Panel Driver" );MODULE_LICENSE ("GPL and additional rights" );
drivers/gpu/drm/i915/intel_dsi.c +16 -0
@@ -26,6 +26,7 @@#include <drm/drmP.h> #include <drm/drm_crtc.h> #include <drm/drm_edid.h> +#include <drm/drm_panel.h> #include <drm/i915_drm.h> #include <linux/slab.h> #include "i915_drv.h"
@@ -230,6 +231,8 @@ static void intel_dsi_pre_enable(struct intel_encoder *encoder)DRM_DEBUG_KMS ("\n" ); +drm_panel_enable (intel_dsi->panel); +/* Disable DPOunit clock gating, can stall pipe * and we need DPLL REFA always enabled */ tmp =I915_READ (DPLL (pipe));
@@ -392,6 +395,8 @@ static void intel_dsi_post_disable(struct intel_encoder *encoder)msleep (intel_dsi->panel_off_delay);msleep (intel_dsi->panel_pwr_cycle_delay); + +drm_panel_disable (intel_dsi->panel); } static bool intel_dsi_get_hw_state(struct intel_encoder *encoder,
@@ -896,6 +901,17 @@ void intel_dsi_init(struct drm_device *dev) fixed_mode->type |=DRM_MODE_TYPE_PREFERRED ;intel_panel_init (&intel_connector->panel, fixed_mode,NULL ); +/* Initialize the PMIC based drm_panel if available on the platform */ +if (dev_priv->vbt.dsi.config->pwm_blc ==PPS_BLC_PMIC ) { + intel_dsi->panel =drm_find_panel_by_name ("crystal_cove_panel" ); +if (!intel_dsi->panel) { +DRM_ERROR ("PMIC Panel control will not work !!\n" ); +return ; + } + +drm_panel_attach (intel_dsi->panel, connector); + } +return ; err:
drivers/gpu/drm/i915/intel_dsi.h +6 -0
@@ -33,6 +33,9 @@#define DSI_DUAL_LINK_FRONT_BACK 1#define DSI_DUAL_LINK_PIXEL_ALT 2 +#define PPS_BLC_PMIC 0 +#define PPS_BLC_SOC 1 +struct intel_dsi_device {unsigned int panel_id;const char *name;
@@ -83,6 +86,8 @@ struct intel_dsi {struct intel_connector *attached_connector; +struct drm_panel *panel; +/* bit mask of ports being driven */ u16 ports;
@@ -116,6 +121,7 @@ struct intel_dsi {u32 dphy_reg;u32 video_frmt_cfg_bits;u16 lp_byte_clk; +u8 pps_blc;/* timeouts in byte clocks */ u16 lp_rx_timeout;
Signature · 6 lines
1.9.1 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx