N950 and N9 ports

This commit is contained in:
David Derby 2018-04-19 20:58:32 -05:00 committed by Ivan J
parent 590d58644e
commit 966a8ecea4
40 changed files with 18004 additions and 0 deletions

View File

@ -66,6 +66,8 @@ Now is the time you choose the device and OS you want to build the image for.
* `chromeacer` - Acer ARM Chromebook
* `chromeveyron` - Veyron ARM Chromebook (RK3288)
* `n900` - Nokia N900
* `n950` - Nokia N950
* `n9` - Nokia N9
* `odroidxu` - ODROID-XU
* `odroidxu4` - ODROID-XU4
* `ouya` - OUYA gaming console

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

118
boards/nokia-n9.sh Normal file
View File

@ -0,0 +1,118 @@
#!/usr/bin/env zsh
# Copyright (c) 2016-2018 Dyne.org Foundation
# arm-sdk is written and maintained by Ivan J. <parazyd@dyne.org>
#
# This file is part of arm-sdk
#
# This source code is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This software is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this source code. If not, see <http://www.gnu.org/licenses/>.
## kernel build script for Nokia N950
## settings & config
vars+=(device_name arch size parted_type parted_boot parted_root bootfs inittab)
vars+=(gitkernel gitbranch)
arrs+=(custmodules)
device_name="n9"
arch="armhf"
size=1337
parted_type="dos"
parted_boot="fat32 8192s 270335s"
parted_root="ext4 270336s 100%"
bootfs="none"
extra_packages+=(firmware-ti-connectivity)
custmodules=()
gitkernel="https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git"
gitbranch="linux-4.16.y"
# patch series from linux-omap patchwork
# [PATCHv2 0/8] omapdrm: DSI command mode panel support
patchids=(
10207753 # [PATCHv2,1/8] drm/omap: add framedone interrupt support
10207763 # [PATCHv2,2/8] drm/omap: add manual update detection helper
10207759 # [PATCHv2,3/8] drm/omap: add support for manually updated displays
10207749 # [PATCHv2,4/8] dt-bindings: panel: common: document orientation property
10207733 # [PATCHv2,5/8] drm/omap: add support for orientation hints from display drivers
10207747 # [PATCHv2,6/8] drm/omap: panel-dsi-cm: add orientation support
10207755 # [PATCHv2,7/8] ARM: dts: omap4-droid4: Add LCD panel orientation property
10207743 # [PATCHv2,8/8] drm/omap: plane: update fifo size on ovl setup
)
pwclient=$R/extra/pwclient/pwclient
postbuild() {
fn postbuild
notice "executing $device_name postbuild"
copy-root-overlay
}
build_kernel_${arch}() {
fn build_kernel_${arch}
req=(R arch device_name gitkernel gitbranch MAKEOPTS)
req+=(strapdir)
req+=(loopdevice)
ckreq || return 1
notice "building $arch kernel"
mkdir -p $R/tmp/kernels/$device_name
get-kernel-sources
pushd $R/tmp/kernels/$device_name/${device_name}-linux
git checkout -- .
copy-kernel-config
notice "applying patches from patchwork"
cp $R/extra/pwclient/.pwclientrc ~
$pwclient git-am -p linux-omap $patchids
notice "applying addtional patches"
_patchdir="$R/extra/patches/linux-n9-patches"
_patchset="$(find ${_patchdir} -name '*.patch' | sort)"
for i in "${=_patchset}"; do
patch -p1 < "$i"
done
# Atmel maXTouch configuration
cp $_patchdir/RM-696_Pyrenees_SMD_V1_6.raw firmware/maxtouch.cfg
# remove "-dirty" from kernel version tag
touch .scmversion
# compile kernel and modules
make \
$MAKEOPTS \
ARCH=arm \
CROSS_COMPILE=$compiler \
zImage modules omap3-n9.dtb || zerr
cat arch/arm/boot/zImage arch/arm/boot/dts/omap3-n9.dtb > zImage || zerr
# install kernel modules
sudo -E PATH="$PATH" \
make \
$MAKEOPTS \
ARCH=arm \
CROSS_COMPILE=$compiler \
INSTALL_MOD_PATH=$strapdir \
INSTALL_MOD_STRIP=1 \
modules_install || zerr
sudo cp -v zImage $strapdir/boot
popd
postbuild || zerr
}

118
boards/nokia-n950.sh Normal file
View File

@ -0,0 +1,118 @@
#!/usr/bin/env zsh
# Copyright (c) 2016-2018 Dyne.org Foundation
# arm-sdk is written and maintained by Ivan J. <parazyd@dyne.org>
#
# This file is part of arm-sdk
#
# This source code is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This software is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this source code. If not, see <http://www.gnu.org/licenses/>.
## kernel build script for Nokia N950
## settings & config
vars+=(device_name arch size parted_type parted_boot parted_root bootfs inittab)
vars+=(gitkernel gitbranch)
arrs+=(custmodules)
device_name="n950"
arch="armhf"
size=1337
parted_type="dos"
parted_boot="fat32 8192s 270335s"
parted_root="ext4 270336s 100%"
bootfs="none"
extra_packages+=(firmware-ti-connectivity)
custmodules=()
gitkernel="https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git"
gitbranch="linux-4.16.y"
# patch series from linux-omap patchwork
# [PATCHv2 0/8] omapdrm: DSI command mode panel support
patchids=(
10207753 # [PATCHv2,1/8] drm/omap: add framedone interrupt support
10207763 # [PATCHv2,2/8] drm/omap: add manual update detection helper
10207759 # [PATCHv2,3/8] drm/omap: add support for manually updated displays
10207749 # [PATCHv2,4/8] dt-bindings: panel: common: document orientation property
10207733 # [PATCHv2,5/8] drm/omap: add support for orientation hints from display drivers
10207747 # [PATCHv2,6/8] drm/omap: panel-dsi-cm: add orientation support
10207755 # [PATCHv2,7/8] ARM: dts: omap4-droid4: Add LCD panel orientation property
10207743 # [PATCHv2,8/8] drm/omap: plane: update fifo size on ovl setup
)
pwclient=$R/extra/pwclient/pwclient
postbuild() {
fn postbuild
notice "executing $device_name postbuild"
copy-root-overlay
}
build_kernel_${arch}() {
fn build_kernel_${arch}
req=(R arch device_name gitkernel gitbranch MAKEOPTS)
req+=(strapdir)
req+=(loopdevice)
ckreq || return 1
notice "building $arch kernel"
mkdir -p $R/tmp/kernels/$device_name
get-kernel-sources
pushd $R/tmp/kernels/$device_name/${device_name}-linux
git checkout -- .
copy-kernel-config
notice "applying patches from patchwork"
cp $R/extra/pwclient/.pwclientrc ~
$pwclient git-am -p linux-omap $patchids
notice "applying addtional patches"
_patchdir="$R/extra/patches/linux-n950-patches"
_patchset="$(find ${_patchdir} -name '*.patch' | sort)"
for i in "${=_patchset}"; do
patch -p1 < "$i"
done
# Atmel maXTouch configuration
cp $_patchdir/RM-680_Himalaya_AUO_V1_1.raw firmware/maxtouch.cfg
# remove "-dirty" from kernel version tag
touch .scmversion
# compile kernel and modules
make \
$MAKEOPTS \
ARCH=arm \
CROSS_COMPILE=$compiler \
zImage modules omap3-n950.dtb || zerr
cat arch/arm/boot/zImage arch/arm/boot/dts/omap3-n950.dtb > zImage || zerr
# install kernel modules
sudo -E PATH="$PATH" \
make \
$MAKEOPTS \
ARCH=arm \
CROSS_COMPILE=$compiler \
INSTALL_MOD_PATH=$strapdir \
INSTALL_MOD_STRIP=1 \
modules_install || zerr
sudo cp -v zImage $strapdir/boot
popd
postbuild || zerr
}

View File

@ -0,0 +1,4 @@
Section "Monitor"
Identifier "DSI-1"
Option "Rotate" "right"
EndSection

1
extra/n9/etc/fstab Normal file
View File

@ -0,0 +1 @@
## <file system> <mount point> <type> <options> <dump><pass>

View File

@ -0,0 +1,20 @@
# interfaces(5) file used by ifup(8) and ifdown(8)
# Please note that this file is written to be used with dhcpcd
# For static IP, consult /etc/dhcpcd.conf and 'man dhcpcd.conf'
# Include files from /etc/network/interfaces.d:
# source-directory /etc/network/interfaces.d
auto lo
iface lo inet loopback
allow-hotplug usb0
iface usb0 inet static
address 192.168.2.15
netmask 255.255.255.0
gateway 192.168.2.14
allow-hotplug wlan0
iface wlan0 inet dhcp
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

21
extra/n9/sbin/preinit Executable file
View File

@ -0,0 +1,21 @@
#!/bin/sh
watchdog_kick() {
while true; do
for wd in /dev/watchdog*; do
test -c $wd && echo X > $wd
done
if [ -f /bin/sleep ]; then
/bin/sleep 2
else
return 0
fi
done
}
test -c /dev/null || mknod -m 666 /dev/null c 1 3
watchdog_kick &
exec /sbin/init

View File

@ -0,0 +1,4 @@
Section "Monitor"
Identifier "DSI-1"
Option "Rotate" "left"
EndSection

View File

@ -0,0 +1,10 @@
# KEYBOARD CONFIGURATION FILE
# Consult the keyboard(5) manual page.
XKBMODEL="nokiarm680"
XKBLAYOUT="us"
XKBVARIANT=""
XKBOPTIONS=""
BACKSPACE="guess"

1
extra/n950/etc/fstab Normal file
View File

@ -0,0 +1 @@
## <file system> <mount point> <type> <options> <dump><pass>

View File

@ -0,0 +1,20 @@
# interfaces(5) file used by ifup(8) and ifdown(8)
# Please note that this file is written to be used with dhcpcd
# For static IP, consult /etc/dhcpcd.conf and 'man dhcpcd.conf'
# Include files from /etc/network/interfaces.d:
# source-directory /etc/network/interfaces.d
auto lo
iface lo inet loopback
allow-hotplug usb0
iface usb0 inet static
address 192.168.2.15
netmask 255.255.255.0
gateway 192.168.2.14
allow-hotplug wlan0
iface wlan0 inet dhcp
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

21
extra/n950/sbin/preinit Executable file
View File

@ -0,0 +1,21 @@
#!/bin/sh
watchdog_kick() {
while true; do
for wd in /dev/watchdog*; do
test -c $wd && echo X > $wd
done
if [ -f /bin/sleep ]; then
/bin/sleep 2
else
return 0
fi
done
}
test -c /dev/null || mknod -m 666 /dev/null c 1 3
watchdog_kick &
exec /sbin/init

View File

@ -0,0 +1,110 @@
// The geomeries are zoomed about 3x because of text size in xkbprint. An
// example for visualizing a keyboard layout is given below.
//
// setxkbmap -model nokiarm680 -layout us -print > rm680.xkb
// xkbcomp rm680.xkb
// xkbprint -color rm680.xkm
xkb_geometry "nokiarm680" {
description= "Nokia RM-680";
width= 346.5; // 11x8.5mm + 2x11mm border
height= 102.0; // 4x7mm + 2x3mm border
shape.cornerRadius= 1.5;
shape "NORM" { { [25.5,21.0] } };
shape "SPCE" { { [76.5,21.0] } };
section.left= 33.0;
row.left= 0.0;
key.shape= "NORM";
key.gap= 0;
section "Keys" {
top= 0;
row {
top= 9.0;
keys { <AD01>, <AD02>, <AD03>, <AD04>, <AD05>,
<AD06>, <AD07>, <AD08>, <AD09>, <AD10>,
{ <BKSP>, "NORM", color="grey20" }
};
};
row {
top= 30.0;
keys { <AC01>, <AC02>, <AC03>, <AC04>, <AC05>,
<AC06>, <AC07>, <AC08>, <AC09>, <AC11>,
{ <RTRN>, "NORM", color="grey20" }
};
};
row {
top= 51.0;
keys { <AB01>, <AB02>, <AB03>, <AB04>, <AB05>,
<AB06>, <AB07>, <AB08>, <AB09>, <UP>,
{ <RCTL>, "NORM", color="grey20" }
};
};
row {
top= 72.0;
keys { { <LWIN>, "NORM", color="grey20" },
{ <LFSH>, "NORM", color="grey20" },
{ <COMP>, "NORM", color="grey20" },
<AB10>,
{ <SPCE>, "SPCE", color="white" },
<AC12>,
<LEFT>, <DOWN>, <RGHT>
};
};
}; // End of "Keys" section
}; // End of "rm680" geometry
xkb_geometry "nokiarx51" {
description= "Nokia RX-51";
width= 273; // 13x6mm + 2x1.5mm border + 2x5mm border
height= 54; // 3x5mm + 2x1.5mm border
shape.cornerRadius= 1.5;
shape "NORM" { { [18,15] } };
shape "SPCE" { { [36,15] } };
shape "FRAME" { cornerRadius= 2.5, { [243,54] } };
solid "FRAME" {
shape= "FRAME";
color= "white";
top= 0;
left= 15;
};
section.left= 15;
row.left= 4.5;
key.shape= "NORM";
key.gap= 0;
section "Keys" {
top= 0;
row {
top= 4.5;
keys { { <LCTL>, "NORM", color="grey20" },
<AD01>, <AD02>, <AD03>, <AD04>, <AD05>,
<AD06>, <AD07>, <AD08>, <AD09>, <AD10>, <AB08>,
{ <BKSP>, "NORM", color="grey20" }
};
};
row {
top= 19.5;
keys { { <RALT>, "NORM", color="grey20" },
<AC01>, <AC02>, <AC03>, <AC04>, <AC05>,
<AC06>, <AC07>, <AC08>, <AC09>, <AB09>, <UP>,
{ <RTRN>, "NORM", color="grey20" }
};
};
row {
top= 34.5;
keys { { <LFSH>, "NORM", color="grey20" },
<AB01>, <AB02>, <AB03>, <AB04>, <AB05>, <AB06>, <AB07>,
{ <SPCE>, "SPCE", color="white" },
<LEFT>, <DOWN>, <RGHT>
};
};
}; // End of "Keys" section
}; // End of "rx51" geometry

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,33 @@
From b6faf8e49d3ce7b8b94d56a88e70926fb35de918 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Filip=20Matijevi=C4=87?= <filip.matijevic.pz@gmail.com>
Date: Sat, 28 Oct 2017 09:18:10 +0200
Subject: [PATCH 02/11] drm: add/rename MIPI_DCS_SET_PARTIAL_XXX
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Rename MIPI_DCS_SET_PARTIAL_AREA to MIPI_DCS_SET_PARTIAL_ROWS
Add MIPI_DCS_SET_PARTIAL_COLUMNS
Signed-off-by: Filip Matijević <filip.matijevic.pz@gmail.com>
---
include/video/mipi_display.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/include/video/mipi_display.h b/include/video/mipi_display.h
index 19aa65a35546..1d9fdd685ded 100644
--- a/include/video/mipi_display.h
+++ b/include/video/mipi_display.h
@@ -102,7 +102,8 @@ enum {
MIPI_DCS_WRITE_MEMORY_START = 0x2C,
MIPI_DCS_WRITE_LUT = 0x2D,
MIPI_DCS_READ_MEMORY_START = 0x2E,
- MIPI_DCS_SET_PARTIAL_AREA = 0x30,
+ MIPI_DCS_SET_PARTIAL_ROWS = 0x30,
+ MIPI_DCS_SET_PARTIAL_COLUMNS = 0x31,
MIPI_DCS_SET_SCROLL_AREA = 0x33,
MIPI_DCS_SET_TEAR_OFF = 0x34,
MIPI_DCS_SET_TEAR_ON = 0x35,
--
2.14.1

View File

@ -0,0 +1,63 @@
From 013999e09d13087a9eb4922df3099f5e71035031 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Filip=20Matijevi=C4=87?= <filip.matijevic.pz@gmail.com>
Date: Sat, 28 Oct 2017 14:39:23 +0200
Subject: [PATCH 03/11] drm/omap: panel-dsi-cm: use defines from mipi_display.h
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Filip Matijević <filip.matijevic.pz@gmail.com>
---
drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c b/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c
index 7a63d6775a27..418cf5dd2d69 100644
--- a/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c
+++ b/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c
@@ -33,8 +33,6 @@
#define TCH 0
#define DCS_READ_NUM_ERRORS 0x05
-#define DCS_BRIGHTNESS 0x51
-#define DCS_CTRL_DISPLAY 0x53
#define DCS_GET_ID1 0xda
#define DCS_GET_ID2 0xdb
#define DCS_GET_ID3 0xdc
@@ -386,7 +384,8 @@ static int dsicm_bl_update_status(struct backlight_device *dev)
r = dsicm_wake_up(ddata);
if (!r)
- r = dsicm_dcs_write_1(ddata, DCS_BRIGHTNESS, level);
+ r = dsicm_dcs_write_1(ddata, MIPI_DCS_SET_DISPLAY_BRIGHTNESS,
+ level);
in->ops.dsi->bus_unlock(in);
}
@@ -668,11 +667,11 @@ static int dsicm_power_on(struct panel_drv_data *ddata)
if (r)
goto err;
- r = dsicm_dcs_write_1(ddata, DCS_BRIGHTNESS, 0xff);
+ r = dsicm_dcs_write_1(ddata, MIPI_DCS_SET_DISPLAY_BRIGHTNESS, 0xff);
if (r)
goto err;
- r = dsicm_dcs_write_1(ddata, DCS_CTRL_DISPLAY,
+ r = dsicm_dcs_write_1(ddata, MIPI_DCS_WRITE_CONTROL_DISPLAY,
(1<<2) | (1<<5)); /* BL | BCTRL */
if (r)
goto err;
@@ -1101,7 +1100,8 @@ static int dsicm_memory_read(struct omap_dss_device *dssdev,
goto err2;
while (buf_used < size) {
- u8 dcs_cmd = first ? 0x2e : 0x3e;
+ u8 dcs_cmd = first ? MIPI_DCS_READ_MEMORY_START :
+ MIPI_DCS_READ_MEMORY_CONTINUE;
first = 0;
r = in->ops.dsi->dcs_read(in, ddata->channel, dcs_cmd,
--
2.14.1

View File

@ -0,0 +1,118 @@
From 3390d6d1009dc6cdd166638be4af242e4469bcd1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Filip=20Matijevi=C4=87?= <filip.matijevic.pz@gmail.com>
Date: Sat, 28 Oct 2017 14:32:54 +0200
Subject: [PATCH 04/11] ARM: dts: n9: add display support
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Add basic panel support for the Nokia N9.
Signed-off-by: Filip Matijević <filip.matijevic.pz@gmail.com>
---
arch/arm/boot/dts/omap3-n9.dts | 91 ++++++++++++++++++++++++++++++++++++++++++
1 file changed, 91 insertions(+)
diff --git a/arch/arm/boot/dts/omap3-n9.dts b/arch/arm/boot/dts/omap3-n9.dts
index e44d93fc644c..613ada9a982a 100644
--- a/arch/arm/boot/dts/omap3-n9.dts
+++ b/arch/arm/boot/dts/omap3-n9.dts
@@ -18,6 +18,26 @@
compatible = "nokia,omap3-n9", "ti,omap36xx", "ti,omap3";
};
+&omap3_pmx_core {
+ dsi_pins: pinmux_dsi_pins {
+ pinctrl-single,pins = <
+ OMAP3_CORE1_IOPAD(0x20dc, PIN_OUTPUT | MUX_MODE1) /* dsi_dx0 - data0+ */
+ OMAP3_CORE1_IOPAD(0x20de, PIN_OUTPUT | MUX_MODE1) /* dsi_dy0 - data0- */
+ OMAP3_CORE1_IOPAD(0x20e0, PIN_OUTPUT | MUX_MODE1) /* dsi_dx1 - clk+ */
+ OMAP3_CORE1_IOPAD(0x20e2, PIN_OUTPUT | MUX_MODE1) /* dsi_dy1 - clk- */
+ OMAP3_CORE1_IOPAD(0x20e4, PIN_OUTPUT | MUX_MODE1) /* dsi_dx2 - data1+ */
+ OMAP3_CORE1_IOPAD(0x20e6, PIN_OUTPUT | MUX_MODE1) /* dsi_dy2 - data1- */
+ >;
+ };
+
+ display_pins: pinmux_display_pins {
+ pinctrl-single,pins = <
+ OMAP3_CORE1_IOPAD(0x20ca, PIN_INPUT | MUX_MODE4) /* gpio 62 - display te */
+ OMAP3_CORE1_IOPAD(0x20fe, PIN_OUTPUT | MUX_MODE4) /* gpio 87 - display reset */
+ >;
+ };
+};
+
&i2c2 {
smia_1: camera@10 {
compatible = "nokia,smia";
@@ -79,3 +99,74 @@
MATRIX_KEY(7, 8, KEY_VOLUMEDOWN)
>;
};
+
+&dss {
+ status = "ok";
+
+ vdda_video-supply = <&vdac>;
+};
+
+&dsi {
+ status = "ok";
+
+ pinctrl-names = "default";
+ pinctrl-0 = <&dsi_pins>;
+
+ vdd-supply = <&vpll2>;
+
+ port {
+ dsi_out_ep: endpoint {
+ remote-endpoint = <&lcd0_in>;
+ lanes = <2 3 4 5 0 1>;
+ };
+ };
+
+ lcd0: display {
+ compatible = "nokia,pyrenees", "panel-dsi-cm";
+ label = "lcd0";
+
+ pinctrl-names = "default";
+ pinctrl-0 = <&display_pins>;
+
+ vpnl-supply = <&vmmc2>;
+ vddi-supply = <&vio>;
+
+ reset-gpios = <&gpio3 23 GPIO_ACTIVE_HIGH>; /* 87 */
+ te-gpios = <&gpio2 30 GPIO_ACTIVE_HIGH>; /* 62 */
+
+ width-mm = <48>; /* 48.240 mm */
+ height-mm = <87>; /* 86.832 mm */
+
+ panel-timing {
+ clock-frequency = <0>; /* Calculated by dsi */
+
+ hback-porch = <2>;
+ hactive = <480>;
+ hfront-porch = <0>;
+ hsync-len = <2>;
+
+ vback-porch = <1>;
+ vactive = <864>;
+ vfront-porch = <0>;
+ vsync-len = <1>;
+
+ hsync-active = <0>;
+ vsync-active = <0>;
+ de-active = <1>;
+ pixelclk-active = <1>;
+
+ };
+
+ port {
+ lcd0_in: endpoint {
+ remote-endpoint = <&dsi_out_ep>;
+ };
+ };
+ };
+};
--
2.14.1

View File

@ -0,0 +1,71 @@
From 324c0340c85dee1a2ae3eb6c71bcd9e47c9f03f7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Filip=20Matijevi=C4=87?= <filip.matijevic.pz@gmail.com>
Date: Thu, 2 Nov 2017 18:46:21 +0100
Subject: [PATCH 05/11] Revert "drm/omap: work-around for omap3 display enable"
This reverts commit fc5cc9678e130196012c17b37e555d53d3d3476b.
---
drivers/gpu/drm/omapdrm/omap_drv.c | 47 ++++++++++++++------------------------
1 file changed, 17 insertions(+), 30 deletions(-)
diff --git a/drivers/gpu/drm/omapdrm/omap_drv.c b/drivers/gpu/drm/omapdrm/omap_drv.c
index dd68b2556f5b..bc5b68ecd0f7 100644
--- a/drivers/gpu/drm/omapdrm/omap_drv.c
+++ b/drivers/gpu/drm/omapdrm/omap_drv.c
@@ -74,36 +74,23 @@ static void omap_atomic_commit_tail(struct drm_atomic_state *old_state)
/* Apply the atomic update. */
drm_atomic_helper_commit_modeset_disables(dev, old_state);
- if (priv->omaprev != 0x3430) {
- /* With the current dss dispc implementation we have to enable
- * the new modeset before we can commit planes. The dispc ovl
- * configuration relies on the video mode configuration been
- * written into the HW when the ovl configuration is
- * calculated.
- *
- * This approach is not ideal because after a mode change the
- * plane update is executed only after the first vblank
- * interrupt. The dispc implementation should be fixed so that
- * it is able use uncommitted drm state information.
- */
- drm_atomic_helper_commit_modeset_enables(dev, old_state);
- omap_atomic_wait_for_completion(dev, old_state);
-
- drm_atomic_helper_commit_planes(dev, old_state, 0);
-
- drm_atomic_helper_commit_hw_done(old_state);
- } else {
- /*
- * OMAP3 DSS seems to have issues with the work-around above,
- * resulting in endless sync losts if a crtc is enabled without
- * a plane. For now, skip the WA for OMAP3.
- */
- drm_atomic_helper_commit_planes(dev, old_state, 0);
-
- drm_atomic_helper_commit_modeset_enables(dev, old_state);
-
- drm_atomic_helper_commit_hw_done(old_state);
- }
+ /* With the current dss dispc implementation we have to enable
+ * the new modeset before we can commit planes. The dispc ovl
+ * configuration relies on the video mode configuration been
+ * written into the HW when the ovl configuration is
+ * calculated.
+ *
+ * This approach is not ideal because after a mode change the
+ * plane update is executed only after the first vblank
+ * interrupt. The dispc implementation should be fixed so that
+ * it is able use uncommitted drm state information.
+ */
+ drm_atomic_helper_commit_modeset_enables(dev, old_state);
+ omap_atomic_wait_for_completion(dev, old_state);
+
+ drm_atomic_helper_commit_planes(dev, old_state, 0);
+
+ drm_atomic_helper_commit_hw_done(old_state);
/*
* Wait for completion of the page flips to ensure that old buffers
--
2.14.1

View File

@ -0,0 +1,29 @@
From 8087f305187140d20b7903ba7486f243a2d470d2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Filip=20Matijevi=C4=87?= <filip.matijevic.pz@gmail.com>
Date: Wed, 1 Nov 2017 18:25:45 +0100
Subject: [PATCH 06/11] HACK: drm/omap: panel-dsi-cm: force 0xff for brigthness
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Filip Matijević <filip.matijevic.pz@gmail.com>
---
drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c b/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c
index 418cf5dd2d69..069fad8d89b2 100644
--- a/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c
+++ b/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c
@@ -375,6 +375,8 @@ static int dsicm_bl_update_status(struct backlight_device *dev)
else
level = 0;
+ level = 0xff;
+
dev_dbg(&ddata->pdev->dev, "update brightness to %d\n", level);
mutex_lock(&ddata->lock);
--
2.14.1

View File

@ -0,0 +1,70 @@
From 15b1d44e2e17ace2ac229a062993e5b530208402 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Filip=20Matijevi=C4=87?= <filip.matijevic.pz@gmail.com>
Date: Mon, 13 Nov 2017 17:20:42 +0100
Subject: [PATCH 07/11] ARM: dts: N9/N950: Add touchscreen support
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Filip Matijević <filip.matijevic.pz@gmail.com>
---
arch/arm/boot/dts/omap3-n950-n9.dtsi | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git a/arch/arm/boot/dts/omap3-n950-n9.dtsi b/arch/arm/boot/dts/omap3-n950-n9.dtsi
index 0d9b85317529..219519812050 100644
--- a/arch/arm/boot/dts/omap3-n950-n9.dtsi
+++ b/arch/arm/boot/dts/omap3-n950-n9.dtsi
@@ -141,6 +141,14 @@
OMAP3_CORE1_IOPAD(0x217a, PIN_INPUT | MUX_MODE0) /* uart2_rx */
>;
};
+
+ ts_pins: pinmux_ts_pins {
+ pinctrl-single,pins = <
+ /* REVISIT pinmuxing gpmc_nbe1 to gpio_61 breaks Atmel maXTouch */
+ /*OMAP3_CORE1_IOPAD(0x20c8, PIN_INPUT | MUX_MODE4)*/ /* gpmc_nbe1.gpio_61 -> TINTX */
+ OMAP3_CORE1_IOPAD(0x20f2, PIN_OUTPUT | MUX_MODE4) /* dss_data11.gpio_81 -> TRESX */
+ >;
+ };
};
&omap3_pmx_core2 {
@@ -199,6 +207,7 @@
regulator-name = "vaux1";
regulator-min-microvolt = <2800000>;
regulator-max-microvolt = <2800000>;
+ regulator-always-on; /* needed for Atmel maXTouch */
};
/* CSI-2 receiver */
@@ -261,6 +270,7 @@
regulator-name = "vio";
regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <1800000>;
+ regulator-always-on; /* needed for Atmel maXTouch */
};
&i2c2 {
@@ -283,6 +293,18 @@
led-max-microamp = <10000>;
};
};
+
+ touch@4b {
+ compatible = "atmel,maxtouch";
+ reg = <0x4b>;
+
+ pinctrl-names = "default";
+ pinctrl-0 = <&ts_pins>;
+
+ interrupt-parent = <&gpio2>;
+ interrupts = <29 IRQ_TYPE_EDGE_FALLING>; /* gpio_61 */
+ reset-gpios = <&gpio3 17 0>; /* gpio_81 */
+ };
};
&i2c3 {
--
2.14.1

View File

@ -0,0 +1,193 @@
From aca9cbfc6f2bf8a3dc6b30d6b7e78e9790a9875f Mon Sep 17 00:00:00 2001
From: filippz <filip.matijevic.pz@gmail.com>
Date: Thu, 28 Dec 2017 06:57:45 +0100
Subject: [PATCH 08/11] misc: apds990x: Add device tree support
Signed-off-by: filippz <filip.matijevic.pz@gmail.com>
---
.../devicetree/bindings/misc/avago-apds990x.txt | 41 +++++++++++
drivers/misc/apds990x.c | 85 +++++++++++++++++++++-
2 files changed, 123 insertions(+), 3 deletions(-)
create mode 100644 Documentation/devicetree/bindings/misc/avago-apds990x.txt
diff --git a/Documentation/devicetree/bindings/misc/avago-apds990x.txt b/Documentation/devicetree/bindings/misc/avago-apds990x.txt
new file mode 100644
index 000000000000..480c0b1c570d
--- /dev/null
+++ b/Documentation/devicetree/bindings/misc/avago-apds990x.txt
@@ -0,0 +1,41 @@
+Avago APDS990X driver
+
+https://docs.broadcom.com/docs/AV02-2867EN
+
+Required properties:
+- compatible: "avago,apds990x"
+- reg: address on the I2C bus
+- interrupts: external interrupt line number
+- vdd-supply: power supply for VDD
+- vled-supply: power supply for LEDA
+- avago,ga: Glass attenuation
+- avago,cf1: Clear channel factor 1
+- avago,irf1: IR channel factor 1
+- avago,cf2: Clear channel factor 2
+- avago,irf2: IR channel factor 2
+- avago,df: Device factor
+- avago,pdrive: IR current, one of APDS_IRLED_CURR_XXXmA values
+- avago,ppcount: Proximity pulse count
+
+Example (Nokia N9):
+
+ als_ps@39 {
+ compatible = "avago,apds990x";
+ reg = <0x39>;
+
+ interrupt-parent = <&gpio3>;
+ interrupts = <19 (IRQ_TYPE_EDGE_FALLING | IRQ_TYPE_LEVEL_LOW)>; /* gpio_83 */
+
+ vdd-supply = <&vaux1>;
+ vled-supply = <&vbat>;
+
+ avago,ga = <168834>;
+ avago,cf1 = <4096>;
+ avago,irf1 = <7824>;
+ avago,cf2 = <877>;
+ avago,irf2 = <1575>;
+ avago,df = <52>;
+
+ avago,pdrive = <0x2>; /* APDS_IRLED_CURR_25mA */
+ avago,ppcount = <5>;
+ };
diff --git a/drivers/misc/apds990x.c b/drivers/misc/apds990x.c
index ed9412d750b7..7bb9cd76110a 100644
--- a/drivers/misc/apds990x.c
+++ b/drivers/misc/apds990x.c
@@ -33,6 +33,8 @@
#include <linux/wait.h>
#include <linux/slab.h>
#include <linux/platform_data/apds990x.h>
+#include <linux/gpio.h>
+#include <linux/of_gpio.h>
/* Register map */
#define APDS990X_ENABLE 0x00 /* Enable of states and interrupts */
@@ -195,8 +197,8 @@ static const u16 arates_hz[] = {10, 5, 2, 1};
static const u8 apersis[] = {1, 2, 4, 5};
/* Regulators */
-static const char reg_vcc[] = "Vdd";
-static const char reg_vled[] = "Vled";
+static const char reg_vcc[] = "vdd";
+static const char reg_vled[] = "vled";
static int apds990x_read_byte(struct apds990x_chip *chip, u8 reg, u8 *data)
{
@@ -1066,11 +1068,71 @@ static const struct attribute_group apds990x_attribute_group[] = {
{.attrs = sysfs_attrs_ctrl },
};
+static const int apds990x_parse_dt(struct device *dev,
+ struct apds990x_platform_data *pdata)
+{
+ struct device_node *np = dev->of_node;
+ int res;
+
+ if (!np)
+ return -EINVAL;
+
+ res = of_property_read_s32(np, "avago,ga", &pdata->cf.ga);
+ if (res < 0) {
+ dev_err(dev, "Failed to retrieve ga from device tree\n");
+ return -EINVAL;
+ }
+
+ res = of_property_read_s32(np, "avago,cf1", &pdata->cf.cf1);
+ if (res < 0) {
+ dev_err(dev, "Failed to retrieve cf1 from device tree\n");
+ return -EINVAL;
+ }
+
+ res = of_property_read_s32(np, "avago,irf1", &pdata->cf.irf1);
+ if (res < 0) {
+ dev_err(dev, "Failed to retrieve irf1 from device tree\n");
+ return -EINVAL;
+ }
+
+ res = of_property_read_s32(np, "cf2", &pdata->cf.cf2);
+ if (res < 0) {
+ dev_err(dev, "Failed to retrieve cf2 from device tree\n");
+ return -EINVAL;
+ }
+
+ res = of_property_read_s32(np, "avago,irf2", &pdata->cf.irf2);
+ if (res < 0) {
+ dev_err(dev, "Failed to retrieve irf2 from device tree\n");
+ return -EINVAL;
+ }
+
+ res = of_property_read_s32(np, "avago,df", &pdata->cf.df);
+ if (res < 0) {
+ dev_err(dev, "Failed to retrieve irf1 from device tree\n");
+ return -EINVAL;
+ }
+
+ res = of_property_read_u8(np, "avago,pdrive", &pdata->pdrive);
+ if (res < 0) {
+ dev_err(dev, "Failed to retrieve pdrive from device tree\n");
+ return -EINVAL;
+ }
+
+ res = of_property_read_u8(np, "avago,ppcount", &pdata->ppcount);
+ if (res < 0) {
+ dev_err(dev, "Failed to retrieve ppcount from device tree\n");
+ return -EINVAL;
+ }
+
+ return 0;
+}
+
static int apds990x_probe(struct i2c_client *client,
const struct i2c_device_id *id)
{
struct apds990x_chip *chip;
- int err;
+ int err = 0;
chip = kzalloc(sizeof *chip, GFP_KERNEL);
if (!chip)
@@ -1083,6 +1145,16 @@ static int apds990x_probe(struct i2c_client *client,
mutex_init(&chip->mutex);
chip->pdata = client->dev.platform_data;
+ if (chip->pdata == NULL) {
+ chip->pdata = devm_kzalloc(&client->dev, sizeof(*chip->pdata),
+ GFP_KERNEL);
+ if (!chip->pdata)
+ return -ENOMEM;
+ err = apds990x_parse_dt(&client->dev, chip->pdata);
+ }
+ if (err < 0)
+ return err;
+
if (chip->pdata == NULL) {
dev_err(&client->dev, "platform data is mandatory\n");
err = -EINVAL;
@@ -1283,9 +1355,16 @@ static const struct dev_pm_ops apds990x_pm_ops = {
NULL)
};
+static const struct of_device_id apds990x_of_match[] = {
+ {.compatible = "avago,apds990x" },
+ {}
+};
+MODULE_DEVICE_TABLE(of, apds990x_of_match);
+
static struct i2c_driver apds990x_driver = {
.driver = {
.name = "apds990x",
+ .of_match_table = apds990x_of_match,
.pm = &apds990x_pm_ops,
},
.probe = apds990x_probe,
--
2.14.1

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,81 @@
From ad23767da90b149a650ebb38a797056f81728507 Mon Sep 17 00:00:00 2001
From: filippz <filip.matijevic.pz@gmail.com>
Date: Thu, 28 Dec 2017 07:00:11 +0100
Subject: [PATCH 10/11] ARM: dts: N9: Add support for apds990x ALS/PS
Signed-off-by: filippz <filip.matijevic.pz@gmail.com>
---
arch/arm/boot/dts/omap3-n9.dts | 24 ++++++++++++++++++++++++
arch/arm/boot/dts/omap3-n950-n9.dtsi | 14 ++++++++++++++
2 files changed, 38 insertions(+)
diff --git a/arch/arm/boot/dts/omap3-n9.dts b/arch/arm/boot/dts/omap3-n9.dts
index 613ada9a982a..1143a6eef736 100644
--- a/arch/arm/boot/dts/omap3-n9.dts
+++ b/arch/arm/boot/dts/omap3-n9.dts
@@ -57,6 +57,30 @@
};
};
};
+
+ als_ps@39 {
+ compatible = "avago,apds990x";
+ reg = <0x39>;
+
+ pinctrl-names = "default";
+ pinctrl-0 = <&als_ps_gpio>;
+
+ interrupt-parent = <&gpio3>;
+ interrupts = <19 (IRQ_TYPE_EDGE_FALLING | IRQ_TYPE_LEVEL_LOW)>; /* gpio_83 */
+
+ vdd-supply = <&vaux1>;
+ vled-supply = <&vbat>;
+
+ avago,ga = <168834>;
+ avago,cf1 = <4096>;
+ avago,irf1 = <7824>;
+ avago,cf2 = <877>;
+ avago,irf2 = <1575>;
+ avago,df = <52>;
+
+ avago,pdrive = /bits/ 8 <2>; /* APDS_IRLED_CURR_25mA */
+ avago,ppcount = /bits/ 8 <5>;
+ };
};
&isp {
diff --git a/arch/arm/boot/dts/omap3-n950-n9.dtsi b/arch/arm/boot/dts/omap3-n950-n9.dtsi
index 219519812050..7ac45b833d1d 100644
--- a/arch/arm/boot/dts/omap3-n950-n9.dtsi
+++ b/arch/arm/boot/dts/omap3-n950-n9.dtsi
@@ -39,6 +39,14 @@
enable-active-high;
};
+ vbat: fixedregulator1 {
+ compatible = "regulator-fixed";
+ regulator-name = "VBAT";
+ regulator-min-microvolt = <3700000>;
+ regulator-max-microvolt = <3700000>;
+ regulator-boot-on;
+ };
+
vwlan_fixed: fixedregulator2 {
compatible = "regulator-fixed";
regulator-name = "VWLAN";
@@ -157,6 +165,12 @@
OMAP3630_CORE2_IOPAD(0x25ec, PIN_OUTPUT | MUX_MODE4) /* gpio_23 (cmt_en) */
>;
};
+
+ als_ps_gpio: pinmux_als_ps_gpio {
+ pinctrl-single,pins = <
+ OMAP3_CORE1_IOPAD(0x20f6, PIN_INPUT | MUX_MODE4) /* dss_data13.gpio_83 -> APDS990X/BHSFH IRQ */
+ >;
+ };
};
&i2c1 {
--
2.14.1

View File

@ -0,0 +1,27 @@
From d619104c857f0938801a34acf1ba2d46fd41e521 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Filip=20Matijevi=C4=87?= <filip.matijevic.pz@gmail.com>
Date: Sat, 16 Dec 2017 07:41:32 +0100
Subject: [PATCH 11/11] HACK: export dma access functions needed by PVR drivers
---
arch/arm/mm/dma-mapping.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c
index ada8eb206a90..877f7f96462d 100644
--- a/arch/arm/mm/dma-mapping.c
+++ b/arch/arm/mm/dma-mapping.c
@@ -2409,3 +2409,10 @@ void arch_teardown_dma_ops(struct device *dev)
arm_teardown_iommu_dma_ops(dev);
}
+
+/* export the cache management functions */
+#ifndef MULTI_CACHE
+EXPORT_SYMBOL(__glue(_CACHE,_dma_map_area));
+EXPORT_SYMBOL(__glue(_CACHE,_dma_unmap_area));
+EXPORT_SYMBOL(__glue(_CACHE,_dma_flush_range));
+#endif
--
2.14.1

View File

@ -0,0 +1,19 @@
OBP_RAW V1
80 01 16 AB 13 0B 11
FF341C
000000
0026 0000 0008 00 00 00 00 00 00 00 00
0007 0000 0003 14 07 32
0008 0000 0008 08 00 14 14 00 00 0A 0F
0009 0000 001F 8F 00 00 13 0B 00 11 23 02 01 00 08 06 0F 0A 0A 0A 0A 55 03 DF 01 00 11 05 0A 94 32 9A 55 00
000F 0000 000B 00 00 00 00 00 00 00 00 00 00 00
0012 0000 0002 00 00
0013 0000 0010 01 00 00 0C 00 00 00 00 00 00 00 00 00 00 00 00
0014 0000 000C 00 00 00 00 00 00 00 00 00 00 00 00
0016 0000 0011 05 00 00 00 00 00 00 00 0F 00 00 00 0A 0F FF FF 00
0017 0000 000F 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0018 0000 0013 00 01 08 00 08 50 64 00 64 00 00 E8 03 C8 00 64 00 E8 03
0019 0000 000E 03 00 EC 2C 7C 15 00 00 00 00 00 00 00 00
001B 0000 0007 00 00 00 00 00 00 00
001C 0000 0006 00 00 03 04 08 0A
0025 0000 0082 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

View File

@ -0,0 +1,33 @@
From b6faf8e49d3ce7b8b94d56a88e70926fb35de918 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Filip=20Matijevi=C4=87?= <filip.matijevic.pz@gmail.com>
Date: Sat, 28 Oct 2017 09:18:10 +0200
Subject: [PATCH 02/11] drm: add/rename MIPI_DCS_SET_PARTIAL_XXX
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Rename MIPI_DCS_SET_PARTIAL_AREA to MIPI_DCS_SET_PARTIAL_ROWS
Add MIPI_DCS_SET_PARTIAL_COLUMNS
Signed-off-by: Filip Matijević <filip.matijevic.pz@gmail.com>
---
include/video/mipi_display.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/include/video/mipi_display.h b/include/video/mipi_display.h
index 19aa65a35546..1d9fdd685ded 100644
--- a/include/video/mipi_display.h
+++ b/include/video/mipi_display.h
@@ -102,7 +102,8 @@ enum {
MIPI_DCS_WRITE_MEMORY_START = 0x2C,
MIPI_DCS_WRITE_LUT = 0x2D,
MIPI_DCS_READ_MEMORY_START = 0x2E,
- MIPI_DCS_SET_PARTIAL_AREA = 0x30,
+ MIPI_DCS_SET_PARTIAL_ROWS = 0x30,
+ MIPI_DCS_SET_PARTIAL_COLUMNS = 0x31,
MIPI_DCS_SET_SCROLL_AREA = 0x33,
MIPI_DCS_SET_TEAR_OFF = 0x34,
MIPI_DCS_SET_TEAR_ON = 0x35,
--
2.14.1

View File

@ -0,0 +1,63 @@
From 013999e09d13087a9eb4922df3099f5e71035031 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Filip=20Matijevi=C4=87?= <filip.matijevic.pz@gmail.com>
Date: Sat, 28 Oct 2017 14:39:23 +0200
Subject: [PATCH 03/11] drm/omap: panel-dsi-cm: use defines from mipi_display.h
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Filip Matijević <filip.matijevic.pz@gmail.com>
---
drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c b/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c
index 7a63d6775a27..418cf5dd2d69 100644
--- a/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c
+++ b/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c
@@ -33,8 +33,6 @@
#define TCH 0
#define DCS_READ_NUM_ERRORS 0x05
-#define DCS_BRIGHTNESS 0x51
-#define DCS_CTRL_DISPLAY 0x53
#define DCS_GET_ID1 0xda
#define DCS_GET_ID2 0xdb
#define DCS_GET_ID3 0xdc
@@ -386,7 +384,8 @@ static int dsicm_bl_update_status(struct backlight_device *dev)
r = dsicm_wake_up(ddata);
if (!r)
- r = dsicm_dcs_write_1(ddata, DCS_BRIGHTNESS, level);
+ r = dsicm_dcs_write_1(ddata, MIPI_DCS_SET_DISPLAY_BRIGHTNESS,
+ level);
in->ops.dsi->bus_unlock(in);
}
@@ -668,11 +667,11 @@ static int dsicm_power_on(struct panel_drv_data *ddata)
if (r)
goto err;
- r = dsicm_dcs_write_1(ddata, DCS_BRIGHTNESS, 0xff);
+ r = dsicm_dcs_write_1(ddata, MIPI_DCS_SET_DISPLAY_BRIGHTNESS, 0xff);
if (r)
goto err;
- r = dsicm_dcs_write_1(ddata, DCS_CTRL_DISPLAY,
+ r = dsicm_dcs_write_1(ddata, MIPI_DCS_WRITE_CONTROL_DISPLAY,
(1<<2) | (1<<5)); /* BL | BCTRL */
if (r)
goto err;
@@ -1101,7 +1100,8 @@ static int dsicm_memory_read(struct omap_dss_device *dssdev,
goto err2;
while (buf_used < size) {
- u8 dcs_cmd = first ? 0x2e : 0x3e;
+ u8 dcs_cmd = first ? MIPI_DCS_READ_MEMORY_START :
+ MIPI_DCS_READ_MEMORY_CONTINUE;
first = 0;
r = in->ops.dsi->dcs_read(in, ddata->channel, dcs_cmd,
--
2.14.1

View File

@ -0,0 +1,71 @@
From 324c0340c85dee1a2ae3eb6c71bcd9e47c9f03f7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Filip=20Matijevi=C4=87?= <filip.matijevic.pz@gmail.com>
Date: Thu, 2 Nov 2017 18:46:21 +0100
Subject: [PATCH 05/11] Revert "drm/omap: work-around for omap3 display enable"
This reverts commit fc5cc9678e130196012c17b37e555d53d3d3476b.
---
drivers/gpu/drm/omapdrm/omap_drv.c | 47 ++++++++++++++------------------------
1 file changed, 17 insertions(+), 30 deletions(-)
diff --git a/drivers/gpu/drm/omapdrm/omap_drv.c b/drivers/gpu/drm/omapdrm/omap_drv.c
index dd68b2556f5b..bc5b68ecd0f7 100644
--- a/drivers/gpu/drm/omapdrm/omap_drv.c
+++ b/drivers/gpu/drm/omapdrm/omap_drv.c
@@ -74,36 +74,23 @@ static void omap_atomic_commit_tail(struct drm_atomic_state *old_state)
/* Apply the atomic update. */
drm_atomic_helper_commit_modeset_disables(dev, old_state);
- if (priv->omaprev != 0x3430) {
- /* With the current dss dispc implementation we have to enable
- * the new modeset before we can commit planes. The dispc ovl
- * configuration relies on the video mode configuration been
- * written into the HW when the ovl configuration is
- * calculated.
- *
- * This approach is not ideal because after a mode change the
- * plane update is executed only after the first vblank
- * interrupt. The dispc implementation should be fixed so that
- * it is able use uncommitted drm state information.
- */
- drm_atomic_helper_commit_modeset_enables(dev, old_state);
- omap_atomic_wait_for_completion(dev, old_state);
-
- drm_atomic_helper_commit_planes(dev, old_state, 0);
-
- drm_atomic_helper_commit_hw_done(old_state);
- } else {
- /*
- * OMAP3 DSS seems to have issues with the work-around above,
- * resulting in endless sync losts if a crtc is enabled without
- * a plane. For now, skip the WA for OMAP3.
- */
- drm_atomic_helper_commit_planes(dev, old_state, 0);
-
- drm_atomic_helper_commit_modeset_enables(dev, old_state);
-
- drm_atomic_helper_commit_hw_done(old_state);
- }
+ /* With the current dss dispc implementation we have to enable
+ * the new modeset before we can commit planes. The dispc ovl
+ * configuration relies on the video mode configuration been
+ * written into the HW when the ovl configuration is
+ * calculated.
+ *
+ * This approach is not ideal because after a mode change the
+ * plane update is executed only after the first vblank
+ * interrupt. The dispc implementation should be fixed so that
+ * it is able use uncommitted drm state information.
+ */
+ drm_atomic_helper_commit_modeset_enables(dev, old_state);
+ omap_atomic_wait_for_completion(dev, old_state);
+
+ drm_atomic_helper_commit_planes(dev, old_state, 0);
+
+ drm_atomic_helper_commit_hw_done(old_state);
/*
* Wait for completion of the page flips to ensure that old buffers
--
2.14.1

View File

@ -0,0 +1,29 @@
From 8087f305187140d20b7903ba7486f243a2d470d2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Filip=20Matijevi=C4=87?= <filip.matijevic.pz@gmail.com>
Date: Wed, 1 Nov 2017 18:25:45 +0100
Subject: [PATCH 06/11] HACK: drm/omap: panel-dsi-cm: force 0xff for brigthness
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Filip Matijević <filip.matijevic.pz@gmail.com>
---
drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c b/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c
index 418cf5dd2d69..069fad8d89b2 100644
--- a/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c
+++ b/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c
@@ -375,6 +375,8 @@ static int dsicm_bl_update_status(struct backlight_device *dev)
else
level = 0;
+ level = 0xff;
+
dev_dbg(&ddata->pdev->dev, "update brightness to %d\n", level);
mutex_lock(&ddata->lock);
--
2.14.1

View File

@ -0,0 +1,70 @@
From 15b1d44e2e17ace2ac229a062993e5b530208402 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Filip=20Matijevi=C4=87?= <filip.matijevic.pz@gmail.com>
Date: Mon, 13 Nov 2017 17:20:42 +0100
Subject: [PATCH 07/11] ARM: dts: N9/N950: Add touchscreen support
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Filip Matijević <filip.matijevic.pz@gmail.com>
---
arch/arm/boot/dts/omap3-n950-n9.dtsi | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git a/arch/arm/boot/dts/omap3-n950-n9.dtsi b/arch/arm/boot/dts/omap3-n950-n9.dtsi
index 0d9b85317529..219519812050 100644
--- a/arch/arm/boot/dts/omap3-n950-n9.dtsi
+++ b/arch/arm/boot/dts/omap3-n950-n9.dtsi
@@ -141,6 +141,14 @@
OMAP3_CORE1_IOPAD(0x217a, PIN_INPUT | MUX_MODE0) /* uart2_rx */
>;
};
+
+ ts_pins: pinmux_ts_pins {
+ pinctrl-single,pins = <
+ /* REVISIT pinmuxing gpmc_nbe1 to gpio_61 breaks Atmel maXTouch */
+ /*OMAP3_CORE1_IOPAD(0x20c8, PIN_INPUT | MUX_MODE4)*/ /* gpmc_nbe1.gpio_61 -> TINTX */
+ OMAP3_CORE1_IOPAD(0x20f2, PIN_OUTPUT | MUX_MODE4) /* dss_data11.gpio_81 -> TRESX */
+ >;
+ };
};
&omap3_pmx_core2 {
@@ -199,6 +207,7 @@
regulator-name = "vaux1";
regulator-min-microvolt = <2800000>;
regulator-max-microvolt = <2800000>;
+ regulator-always-on; /* needed for Atmel maXTouch */
};
/* CSI-2 receiver */
@@ -261,6 +270,7 @@
regulator-name = "vio";
regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <1800000>;
+ regulator-always-on; /* needed for Atmel maXTouch */
};
&i2c2 {
@@ -283,6 +293,18 @@
led-max-microamp = <10000>;
};
};
+
+ touch@4b {
+ compatible = "atmel,maxtouch";
+ reg = <0x4b>;
+
+ pinctrl-names = "default";
+ pinctrl-0 = <&ts_pins>;
+
+ interrupt-parent = <&gpio2>;
+ interrupts = <29 IRQ_TYPE_EDGE_FALLING>; /* gpio_61 */
+ reset-gpios = <&gpio3 17 0>; /* gpio_81 */
+ };
};
&i2c3 {
--
2.14.1

View File

@ -0,0 +1,81 @@
From ad23767da90b149a650ebb38a797056f81728507 Mon Sep 17 00:00:00 2001
From: filippz <filip.matijevic.pz@gmail.com>
Date: Thu, 28 Dec 2017 07:00:11 +0100
Subject: [PATCH 10/11] ARM: dts: N9: Add support for apds990x ALS/PS
Signed-off-by: filippz <filip.matijevic.pz@gmail.com>
---
arch/arm/boot/dts/omap3-n9.dts | 24 ++++++++++++++++++++++++
arch/arm/boot/dts/omap3-n950-n9.dtsi | 14 ++++++++++++++
2 files changed, 38 insertions(+)
diff --git a/arch/arm/boot/dts/omap3-n9.dts b/arch/arm/boot/dts/omap3-n9.dts
index 613ada9a982a..1143a6eef736 100644
--- a/arch/arm/boot/dts/omap3-n9.dts
+++ b/arch/arm/boot/dts/omap3-n9.dts
@@ -57,6 +57,30 @@
};
};
};
+
+ als_ps@39 {
+ compatible = "avago,apds990x";
+ reg = <0x39>;
+
+ pinctrl-names = "default";
+ pinctrl-0 = <&als_ps_gpio>;
+
+ interrupt-parent = <&gpio3>;
+ interrupts = <19 (IRQ_TYPE_EDGE_FALLING | IRQ_TYPE_LEVEL_LOW)>; /* gpio_83 */
+
+ vdd-supply = <&vaux1>;
+ vled-supply = <&vbat>;
+
+ avago,ga = <168834>;
+ avago,cf1 = <4096>;
+ avago,irf1 = <7824>;
+ avago,cf2 = <877>;
+ avago,irf2 = <1575>;
+ avago,df = <52>;
+
+ avago,pdrive = /bits/ 8 <2>; /* APDS_IRLED_CURR_25mA */
+ avago,ppcount = /bits/ 8 <5>;
+ };
};
&isp {
diff --git a/arch/arm/boot/dts/omap3-n950-n9.dtsi b/arch/arm/boot/dts/omap3-n950-n9.dtsi
index 219519812050..7ac45b833d1d 100644
--- a/arch/arm/boot/dts/omap3-n950-n9.dtsi
+++ b/arch/arm/boot/dts/omap3-n950-n9.dtsi
@@ -39,6 +39,14 @@
enable-active-high;
};
+ vbat: fixedregulator1 {
+ compatible = "regulator-fixed";
+ regulator-name = "VBAT";
+ regulator-min-microvolt = <3700000>;
+ regulator-max-microvolt = <3700000>;
+ regulator-boot-on;
+ };
+
vwlan_fixed: fixedregulator2 {
compatible = "regulator-fixed";
regulator-name = "VWLAN";
@@ -157,6 +165,12 @@
OMAP3630_CORE2_IOPAD(0x25ec, PIN_OUTPUT | MUX_MODE4) /* gpio_23 (cmt_en) */
>;
};
+
+ als_ps_gpio: pinmux_als_ps_gpio {
+ pinctrl-single,pins = <
+ OMAP3_CORE1_IOPAD(0x20f6, PIN_INPUT | MUX_MODE4) /* dss_data13.gpio_83 -> APDS990X/BHSFH IRQ */
+ >;
+ };
};
&i2c1 {
--
2.14.1

View File

@ -0,0 +1,23 @@
diff --git a/arch/arm/boot/dts/omap3-n950.dts b/arch/arm/boot/dts/omap3-n950.dts
index 2354e0934..1eae3fc65 100644
--- a/arch/arm/boot/dts/omap3-n950.dts
+++ b/arch/arm/boot/dts/omap3-n950.dts
@@ -12,6 +12,7 @@
#include "omap3-n950-n9.dtsi"
#include <dt-bindings/input/input.h>
+#include <dt-bindings/display/common.h>
/ {
model = "Nokia N950";
@@ -244,8 +245,9 @@
width-mm = <49>; /* 48.960 mm */
height-mm = <88>; /* 88.128 mm */
+ orientation = <PANEL_ORIENTATION_LEFT_UP>;
+
/* TODO:
- * - panel is upside-down
* - top + bottom 5px are not visible
*/
panel-timing {

View File

@ -0,0 +1,17 @@
OBP_RAW V1
80 0C 11 AC 13 0B 0F
136A6F
000000
0026 0000 0008 00 00 00 00 00 00 00 00
0007 0000 0003 FF FF 32
0008 0000 000A 06 00 32 32 00 00 00 00 0A C0
0009 0000 001F 8F 00 00 13 0B 00 30 46 02 02 00 08 06 0F 0A 05 0F 0A 55 03 DF 01 06 06 00 00 D7 2E 98 54 0A
0012 0000 0002 00 00
0013 0000 0010 01 00 00 30 00 00 00 00 00 00 00 00 00 00 00 00
0014 0000 000C 00 00 00 00 00 00 00 00 00 00 00 00
0016 0000 0011 05 60 00 00 00 00 00 00 23 00 00 00 0A 0F FF FF 00
0018 0000 0013 00 01 08 00 08 3C 64 00 64 00 00 E8 03 C8 00 50 00 E8 03
0019 0000 0006 03 00 80 2F 06 18
001B 0000 0007 00 00 00 00 00 00 00
001C 0000 0006 00 00 03 04 08 0A
0025 0000 0082 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

2
sdk
View File

@ -69,6 +69,8 @@ load() {
"chromeacer" "$R/boards/chromebook-acer.sh"
"chromeveyron" "$R/boards/chromebook-veyron.sh"
"n900" "$R/boards/nokia-n900.sh"
"n950" "$R/boards/nokia-n950.sh"
"n9" "$R/boards/nokia-n9.sh"
"droid4" "$R/boards/droid4.sh"
"odroidxu" "$R/boards/odroid-xu.sh"
"odroidxu4" "$R/boards/odroid-xu4.sh"