Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tinydrm backport #2119

Merged
merged 14 commits into from
Jul 22, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Documentation/gpu/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Linux GPU Driver Developer's Guide
drm-kms-helpers
drm-uapi
i915
tinydrm
vga-switcheroo
vgaarbiter

Expand Down
42 changes: 42 additions & 0 deletions Documentation/gpu/tinydrm.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
==========================
drm/tinydrm Driver library
==========================

.. kernel-doc:: drivers/gpu/drm/tinydrm/core/tinydrm-core.c
:doc: overview

Core functionality
==================

.. kernel-doc:: drivers/gpu/drm/tinydrm/core/tinydrm-core.c
:doc: core

.. kernel-doc:: include/drm/tinydrm/tinydrm.h
:internal:

.. kernel-doc:: drivers/gpu/drm/tinydrm/core/tinydrm-core.c
:export:

.. kernel-doc:: drivers/gpu/drm/tinydrm/core/tinydrm-pipe.c
:export:

Additional helpers
==================

.. kernel-doc:: include/drm/tinydrm/tinydrm-helpers.h
:internal:

.. kernel-doc:: drivers/gpu/drm/tinydrm/core/tinydrm-helpers.c
:export:

MIPI DBI Compatible Controllers
===============================

.. kernel-doc:: drivers/gpu/drm/tinydrm/mipi-dbi.c
:doc: overview

.. kernel-doc:: include/drm/tinydrm/mipi-dbi.h
:internal:

.. kernel-doc:: drivers/gpu/drm/tinydrm/mipi-dbi.c
:export:
12 changes: 12 additions & 0 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -4151,6 +4151,12 @@ S: Supported
F: drivers/gpu/drm/mediatek/
F: Documentation/devicetree/bindings/display/mediatek/

DRM DRIVER FOR MI0283QT
M: Noralf Trønnes <noralf@tronnes.org>
S: Maintained
F: drivers/gpu/drm/tinydrm/mi0283qt.c
F: Documentation/devicetree/bindings/display/multi-inno,mi0283qt.txt

DRM DRIVER FOR MSM ADRENO GPU
M: Rob Clark <robdclark@gmail.com>
L: linux-arm-msm@vger.kernel.org
Expand Down Expand Up @@ -4193,6 +4199,12 @@ M: Dave Airlie <airlied@redhat.com>
S: Odd Fixes
F: drivers/gpu/drm/mgag200/

DRM DRIVER FOR PERVASIVE DISPLAYS REPAPER PANELS
M: Noralf Trønnes <noralf@tronnes.org>
S: Maintained
F: drivers/gpu/drm/tinydrm/repaper.c
F: Documentation/devicetree/bindings/display/repaper.txt

DRM DRIVER FOR RAGE 128 VIDEO CARDS
S: Orphan / Obsolete
F: drivers/gpu/drm/r128/
Expand Down
1 change: 1 addition & 0 deletions arch/arm/boot/dts/overlays/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \
mmc.dtbo \
mpu6050.dtbo \
mz61581.dtbo \
papirus.dtbo \
pi3-act-led.dtbo \
pi3-disable-bt.dtbo \
pi3-disable-wifi.dtbo \
Expand Down
11 changes: 11 additions & 0 deletions arch/arm/boot/dts/overlays/README
Original file line number Diff line number Diff line change
Expand Up @@ -1001,6 +1001,17 @@ Params: speed Display SPI bus speed
xohms Touchpanel sensitivity (X-plate resistance)


Name: papirus
Info: PaPiRus ePaper Screen by Pi Supply (both HAT and pHAT)
Load: dtoverlay=papirus,<param>=<val>
Params: panel Display panel (required):
1.44": e1144cs021
2.0": e2200cs021
2.7": e2271cs021

speed Display SPI bus speed


[ The pcf2127-rtc overlay has been deleted. See i2c-rtc. ]


Expand Down
89 changes: 89 additions & 0 deletions arch/arm/boot/dts/overlays/papirus-overlay.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
/* PaPiRus ePaper Screen by Pi Supply */

/dts-v1/;
/plugin/;

/ {
compatible = "brcm,bcm2708";

fragment@0 {
target = <&i2c_arm>;
__overlay__ {
#address-cells = <1>;
#size-cells = <0>;
status = "okay";

display_temp: lm75@48 {
compatible = "lm75b";
reg = <0x48>;
status = "okay";
#thermal-sensor-cells = <0>;
};
};
};

fragment@1 {
target-path = "/";
__overlay__ {
thermal-zones {
display {
polling-delay-passive = <0>;
polling-delay = <0>;
thermal-sensors = <&display_temp>;
};
};
};
};

fragment@2 {
target = <&spi0>;
__overlay__ {
status = "okay";

spidev@0{
status = "disabled";
};
};
};

fragment@3 {
target = <&gpio>;
__overlay__ {
repaper_pins: repaper_pins {
brcm,pins = <14 15 23 24 25>;
brcm,function = <1 1 1 1 0>; /* out out out out in */
};
};
};

fragment@4 {
target = <&spi0>;
__overlay__ {
/* needed to avoid dtc warning */
#address-cells = <1>;
#size-cells = <0>;

repaper: repaper@0{
compatible = "not_set";
reg = <0>;
pinctrl-names = "default";
pinctrl-0 = <&repaper_pins>;

spi-max-frequency = <8000000>;

panel-on-gpios = <&gpio 23 0>;
border-gpios = <&gpio 14 0>;
discharge-gpios = <&gpio 15 0>;
reset-gpios = <&gpio 24 0>;
busy-gpios = <&gpio 25 0>;

repaper-thermal-zone = "display";
};
};
};

__overrides__ {
panel = <&repaper>, "compatible";
speed = <&repaper>, "spi-max-frequency:0";
};
};
3 changes: 3 additions & 0 deletions arch/arm/configs/bcm2709_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -847,6 +847,9 @@ CONFIG_DRM_UDL=m
CONFIG_DRM_PANEL_SIMPLE=m
CONFIG_DRM_PANEL_RASPBERRYPI_TOUCHSCREEN=m
CONFIG_DRM_VC4=m
CONFIG_DRM_TINYDRM=m
CONFIG_TINYDRM_MI0283QT=m
CONFIG_TINYDRM_REPAPER=m
CONFIG_FB=y
CONFIG_FB_BCM2708=y
CONFIG_FB_UDL=m
Expand Down
3 changes: 3 additions & 0 deletions arch/arm/configs/bcmrpi_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -841,6 +841,9 @@ CONFIG_DRM_UDL=m
CONFIG_DRM_PANEL_SIMPLE=m
CONFIG_DRM_PANEL_RASPBERRYPI_TOUCHSCREEN=m
CONFIG_DRM_VC4=m
CONFIG_DRM_TINYDRM=m
CONFIG_TINYDRM_MI0283QT=m
CONFIG_TINYDRM_REPAPER=m
CONFIG_FB=y
CONFIG_FB_BCM2708=y
CONFIG_FB_UDL=m
Expand Down
2 changes: 2 additions & 0 deletions drivers/gpu/drm/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,8 @@ source "drivers/gpu/drm/hisilicon/Kconfig"

source "drivers/gpu/drm/mediatek/Kconfig"

source "drivers/gpu/drm/tinydrm/Kconfig"

# Keep legacy drivers last

menuconfig DRM_LEGACY
Expand Down
1 change: 1 addition & 0 deletions drivers/gpu/drm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -86,3 +86,4 @@ obj-$(CONFIG_DRM_FSL_DCU) += fsl-dcu/
obj-$(CONFIG_DRM_ETNAVIV) += etnaviv/
obj-$(CONFIG_DRM_ARCPGU)+= arc/
obj-y += hisilicon/
obj-$(CONFIG_DRM_TINYDRM) += tinydrm/
20 changes: 17 additions & 3 deletions drivers/gpu/drm/drm_debugfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ static const struct file_operations drm_debugfs_fops = {
* \return Zero on success, non-zero on failure
*
* Create a given set of debugfs files represented by an array of
* gdm_debugfs_lists in the given root directory.
* &drm_info_list in the given root directory. These files will be removed
* automatically on drm_debugfs_cleanup().
*/
int drm_debugfs_create_files(const struct drm_info_list *files, int count,
struct dentry *root, struct drm_minor *minor)
Expand Down Expand Up @@ -208,6 +209,19 @@ int drm_debugfs_remove_files(const struct drm_info_list *files, int count,
}
EXPORT_SYMBOL(drm_debugfs_remove_files);

static void drm_debugfs_remove_all_files(struct drm_minor *minor)
{
struct drm_info_node *node, *tmp;

mutex_lock(&minor->debugfs_lock);
list_for_each_entry_safe(node, tmp, &minor->debugfs_list, list) {
debugfs_remove(node->dent);
list_del(&node->list);
kfree(node);
}
mutex_unlock(&minor->debugfs_lock);
}

/**
* Cleanup the debugfs filesystem resources.
*
Expand All @@ -226,9 +240,9 @@ int drm_debugfs_cleanup(struct drm_minor *minor)
if (dev->driver->debugfs_cleanup)
dev->driver->debugfs_cleanup(minor);

drm_debugfs_remove_files(drm_debugfs_list, DRM_DEBUGFS_ENTRIES, minor);
drm_debugfs_remove_all_files(minor);

debugfs_remove(minor->debugfs_root);
debugfs_remove_recursive(minor->debugfs_root);
minor->debugfs_root = NULL;

return 0;
Expand Down
33 changes: 33 additions & 0 deletions drivers/gpu/drm/tinydrm/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
menuconfig DRM_TINYDRM
tristate "Support for simple displays"
depends on DRM
select DRM_KMS_HELPER
select DRM_KMS_CMA_HELPER
select BACKLIGHT_LCD_SUPPORT
select BACKLIGHT_CLASS_DEVICE
help
Choose this option if you have a tinydrm supported display.
If M is selected the module will be called tinydrm.

config TINYDRM_MIPI_DBI
tristate

config TINYDRM_MI0283QT
tristate "DRM support for MI0283QT"
depends on DRM_TINYDRM && SPI
select TINYDRM_MIPI_DBI
help
DRM driver for the Multi-Inno MI0283QT display panel
If M is selected the module will be called mi0283qt.

config TINYDRM_REPAPER
tristate "DRM support for Pervasive Displays RePaper panels (V231)"
depends on DRM_TINYDRM && SPI
help
DRM driver for the following Pervasive Displays panels:
1.44" TFT EPD Panel (E1144CS021)
1.90" TFT EPD Panel (E1190CS021)
2.00" TFT EPD Panel (E2200CS021)
2.71" TFT EPD Panel (E2271CS021)

If M is selected the module will be called repaper.
8 changes: 8 additions & 0 deletions drivers/gpu/drm/tinydrm/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
obj-$(CONFIG_DRM_TINYDRM) += core/

# Controllers
obj-$(CONFIG_TINYDRM_MIPI_DBI) += mipi-dbi.o

# Displays
obj-$(CONFIG_TINYDRM_MI0283QT) += mi0283qt.o
obj-$(CONFIG_TINYDRM_REPAPER) += repaper.o
3 changes: 3 additions & 0 deletions drivers/gpu/drm/tinydrm/core/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
tinydrm-y := tinydrm-core.o tinydrm-pipe.o tinydrm-helpers.o

obj-$(CONFIG_DRM_TINYDRM) += tinydrm.o
Loading