aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSubramaniam Chanderashekarapuram2014-04-21 13:23:52 -0500
committerSubramaniam Chanderashekarapuram2014-04-21 13:23:52 -0500
commit859ff113556cedc0f46ec5317204e64514c1958d (patch)
treed36ac5fe1c0ba56a2c82524368d1c7d7d924d2e0
parent0b7e9f076db4f9da2885c0f35b2fcb3372d58eb6 (diff)
parent7b6e2837ff6d83c33cd93b7b4e630704f11cfe77 (diff)
downloadkernel-omap-p-ti-android-3.8.y-j6eco-wip-v1.tar.gz
kernel-omap-p-ti-android-3.8.y-j6eco-wip-v1.tar.xz
kernel-omap-p-ti-android-3.8.y-j6eco-wip-v1.zip
Merge branch 'p-ti-linux-3.8.y-j6eco-wip-v1' into p-ti-android-3.8.y-j6eco-wip-v1p-ti-android-3.8.y-j6eco-wip-v1
Conflicts: arch/arm/boot/dts/dra7-evm.dts Change-Id: Icd18c0153edda819628b2f3d0f62edfb30ff064f Signed-off-by: Subramaniam Chanderashekarapuram <subramaniam.ca@ti.com>
-rwxr-xr-xarch/arm/boot/dts/dra7-evm.dts27
-rw-r--r--arch/arm/boot/dts/dra7.dtsi13
-rw-r--r--arch/arm/configs/omap2plus_defconfig26
-rw-r--r--arch/arm/configs/omap5_earlyboot_defconfig301
-rw-r--r--arch/arm/mach-omap2/Kconfig6
-rw-r--r--arch/arm/mach-omap2/cclock54xx_data.c8
-rw-r--r--arch/arm/mach-omap2/cclock7xx_data.c2
-rw-r--r--arch/arm/mach-omap2/common.c16
-rw-r--r--arch/arm/mach-omap2/sata.c26
-rw-r--r--drivers/extcon/extcon-gpio-usbvid.c4
-rw-r--r--drivers/gpu/drm/omapdrm/omap_crtc.c50
-rw-r--r--drivers/gpu/drm/omapdrm/omap_dmm_tiler.c4
-rw-r--r--drivers/gpu/drm/omapdrm/omap_gem.c46
-rw-r--r--drivers/gpu/drm/omapdrm/omap_plane.c5
-rw-r--r--drivers/media/i2c/ov1063x.c6
-rw-r--r--drivers/media/i2c/tvp5158.c32
-rw-r--r--drivers/media/platform/ti-vps/vip.c123
-rw-r--r--drivers/media/platform/ti-vps/vpdma.c21
-rw-r--r--drivers/media/platform/ti-vps/vpdma.h3
-rw-r--r--drivers/media/platform/ti-vps/vpe.c247
-rw-r--r--drivers/mmc/host/Kconfig6
-rw-r--r--drivers/net/ethernet/ti/davinci_mdio.c6
-rw-r--r--drivers/usb/dwc3/core.c1
-rw-r--r--drivers/usb/dwc3/debugfs.c9
-rw-r--r--drivers/usb/musb/omap2430.c3
-rw-r--r--drivers/usb/otg/palmas-usb.c4
-rw-r--r--drivers/usb/otg/twl4030-usb.c3
-rw-r--r--drivers/usb/otg/twl6030-usb.c3
-rw-r--r--drivers/usb/phy/omap-usb2.c105
-rw-r--r--drivers/video/omap2/dss/dss.h4
-rw-r--r--drivers/video/omap2/dss/hdmi.c15
-rw-r--r--include/linux/platform_data/remoteproc-omap.h2
-rw-r--r--include/linux/usb/omap_usb.h13
-rw-r--r--include/uapi/linux/videodev2.h2
-rw-r--r--include/video/omapdss.h4
35 files changed, 957 insertions, 189 deletions
diff --git a/arch/arm/boot/dts/dra7-evm.dts b/arch/arm/boot/dts/dra7-evm.dts
index 922315eb58d7..90f429faf371 100755
--- a/arch/arm/boot/dts/dra7-evm.dts
+++ b/arch/arm/boot/dts/dra7-evm.dts
@@ -193,14 +193,14 @@
193 compatible = "ti,gpio-usb-id"; 193 compatible = "ti,gpio-usb-id";
194 gpios = <&pcf_lcd3 1 0>; 194 gpios = <&pcf_lcd3 1 0>;
195 interrupt_mode = <0>; 195 interrupt_mode = <0>;
196 dr_mode = "peripheral"; 196 dr_mode = "host";
197 }; 197 };
198 198
199 extcon2: gpio_usbvid_extcon2 { 199 extcon2: gpio_usbvid_extcon2 {
200 compatible = "ti,gpio-usb-id"; 200 compatible = "ti,gpio-usb-id";
201 gpios = <&pcf_lcd3 2 0>; 201 gpios = <&pcf_lcd3 2 0>;
202 interrupt_mode = <0>; 202 interrupt_mode = <0>;
203 dr_mode = "host"; 203 dr_mode = "otg";
204 }; 204 };
205}; 205};
206 206
@@ -644,6 +644,24 @@
644 reg = <0x4a>; 644 reg = <0x4a>;
645 }; 645 };
646 646
647
648 /* TLC chip for LCD panel power and backlight */
649 tlc59108: tlc59108@40 {
650 compatible = "ti,tlc59108";
651 reg = <0x40>;
652 gpios = <&pcf_lcd 15 0>; /* P15, CON_LCD_PWR_DN */
653 };
654
655 tlv320aic3106: tlv320aic3106@18 {
656 compatible = "ti,tlv320aic3x";
657 reg = <0x18>;
658 adc-settle-ms = <40>;
659 IOVDD-supply = <&vaudio_3v3>;
660 DVDD-supply = <&vaudio_1v8>;
661 AVDD-supply = <&vaudio_3v3>;
662 DRVDD-supply = <&vaudio_3v3>;
663 };
664
647 tps65217: tps65217@58 { 665 tps65217: tps65217@58 {
648 compatible = "ti,tps65917"; 666 compatible = "ti,tps65917";
649 reg = <0x58>; 667 reg = <0x58>;
@@ -900,6 +918,7 @@
900 reg = <0x39>; 918 reg = <0x39>;
901 deserializer = <&vis_des2>; 919 deserializer = <&vis_des2>;
902 serializer = <&vis_ser2>; 920 serializer = <&vis_ser2>;
921 status = "disabled";
903 922
904 port { 923 port {
905 cam2: endpoint { 924 cam2: endpoint {
@@ -1089,11 +1108,11 @@
1089}; 1108};
1090 1109
1091&usb1 { 1110&usb1 {
1092 dr_mode = "peripheral"; 1111 dr_mode = "host";
1093}; 1112};
1094 1113
1095&usb2 { 1114&usb2 {
1096 dr_mode = "host"; 1115 dr_mode = "otg";
1097}; 1116};
1098 1117
1099&omap_dwc31 { 1118&omap_dwc31 {
diff --git a/arch/arm/boot/dts/dra7.dtsi b/arch/arm/boot/dts/dra7.dtsi
index b708f4f10954..2037164ce167 100644
--- a/arch/arm/boot/dts/dra7.dtsi
+++ b/arch/arm/boot/dts/dra7.dtsi
@@ -580,7 +580,7 @@
580 #address-cells = <1>; 580 #address-cells = <1>;
581 #size-cells = <1>; 581 #size-cells = <1>;
582 utmi-mode = <2>; 582 utmi-mode = <2>;
583 dr_mode = "peripheral"; 583 dr_mode = "host";
584 ranges; 584 ranges;
585 usb1: dwc3@48890000 { 585 usb1: dwc3@48890000 {
586 compatible = "synopsys,dra7xx-dwc3"; 586 compatible = "synopsys,dra7xx-dwc3";
@@ -588,7 +588,7 @@
588 interrupts = <0 76 4>, <0 77 4>; 588 interrupts = <0 76 4>, <0 77 4>;
589 usb-phy = <&usb2_phy1>, <&usb3_phy>; 589 usb-phy = <&usb2_phy1>, <&usb3_phy>;
590 tx-fifo-resize; 590 tx-fifo-resize;
591 dr_mode = "peripheral"; 591 dr_mode = "host";
592 maximum-speed = "superspeed"; 592 maximum-speed = "superspeed";
593 gpios = <&gpio6 12 0>; 593 gpios = <&gpio6 12 0>;
594 }; 594 };
@@ -610,7 +610,7 @@
610 #address-cells = <1>; 610 #address-cells = <1>;
611 #size-cells = <1>; 611 #size-cells = <1>;
612 utmi-mode = <2>; 612 utmi-mode = <2>;
613 dr_mode = "host"; 613 dr_mode = "otg";
614 ranges; 614 ranges;
615 usb2: dwc3@488d0000 { 615 usb2: dwc3@488d0000 {
616 compatible = "synopsys,dra7xx-dwc3"; 616 compatible = "synopsys,dra7xx-dwc3";
@@ -618,7 +618,7 @@
618 interrupts = <0 78 4>, <0 92 4>; 618 interrupts = <0 78 4>, <0 92 4>;
619 usb-phy = <&usb2_phy2>; 619 usb-phy = <&usb2_phy2>;
620 tx-fifo-resize; 620 tx-fifo-resize;
621 dr_mode = "host"; 621 dr_mode = "otg";
622 maximum-speed = "highspeed"; 622 maximum-speed = "highspeed";
623 gpios = <&gpio6 13 0>; 623 gpios = <&gpio6 13 0>;
624 }; 624 };
@@ -631,7 +631,7 @@
631 ranges; 631 ranges;
632 ti,hwmods = "ocp2scp1"; 632 ti,hwmods = "ocp2scp1";
633 usb2_phy1: usb2_phy1@4a084000 { 633 usb2_phy1: usb2_phy1@4a084000 {
634 compatible = "ti,omap-usb2"; 634 compatible = "ti,dra7x-usb2";
635 reg = <0x4a084000 0x7c>; 635 reg = <0x4a084000 0x7c>;
636 ctrl-module = <&omap_control_usb1>; 636 ctrl-module = <&omap_control_usb1>;
637 wkupclk = "usb_phy1_always_on_clk32k"; 637 wkupclk = "usb_phy1_always_on_clk32k";
@@ -650,7 +650,7 @@
650 }; 650 };
651 651
652 usb2_phy2: usb2_phy2@4a085000 { 652 usb2_phy2: usb2_phy2@4a085000 {
653 compatible = "ti,omap-usb2"; 653 compatible = "ti,dra7x-usb2";
654 reg = <0x4a085000 0x7c>; 654 reg = <0x4a085000 0x7c>;
655 ctrl-module = <&omap_control_usb2>; 655 ctrl-module = <&omap_control_usb2>;
656 wkupclk = "usb_phy2_always_on_clk32k"; 656 wkupclk = "usb_phy2_always_on_clk32k";
@@ -1039,6 +1039,7 @@
1039 <0 52 0x4>, 1039 <0 52 0x4>,
1040 <0 53 0x4>; 1040 <0 53 0x4>;
1041 ranges; 1041 ranges;
1042 status = "disabled";
1042 1043
1043 davinci_mdio: mdio@48485000 { 1044 davinci_mdio: mdio@48485000 {
1044 compatible = "ti,davinci_mdio"; 1045 compatible = "ti,davinci_mdio";
diff --git a/arch/arm/configs/omap2plus_defconfig b/arch/arm/configs/omap2plus_defconfig
index d3d3628861c8..e0896a193b7f 100644
--- a/arch/arm/configs/omap2plus_defconfig
+++ b/arch/arm/configs/omap2plus_defconfig
@@ -26,6 +26,7 @@ CONFIG_OMAP_RESET_CLOCKS=y
26CONFIG_OMAP_MUX_DEBUG=y 26CONFIG_OMAP_MUX_DEBUG=y
27CONFIG_SOC_OMAP5=y 27CONFIG_SOC_OMAP5=y
28CONFIG_SOC_DRA7XX=y 28CONFIG_SOC_DRA7XX=y
29CONFIG_IVA_HIGH_OPP=y
29CONFIG_ARM_THUMBEE=y 30CONFIG_ARM_THUMBEE=y
30CONFIG_ARM_ERRATA_411920=y 31CONFIG_ARM_ERRATA_411920=y
31CONFIG_SMP=y 32CONFIG_SMP=y
@@ -104,6 +105,7 @@ CONFIG_MTD_ONENAND=y
104CONFIG_MTD_ONENAND_VERIFY_WRITE=y 105CONFIG_MTD_ONENAND_VERIFY_WRITE=y
105CONFIG_MTD_ONENAND_OMAP2=y 106CONFIG_MTD_ONENAND_OMAP2=y
106CONFIG_MTD_UBI=y 107CONFIG_MTD_UBI=y
108CONFIG_SPI_TI_QSPI=y
107CONFIG_BLK_DEV_LOOP=y 109CONFIG_BLK_DEV_LOOP=y
108CONFIG_BLK_DEV_RAM=y 110CONFIG_BLK_DEV_RAM=y
109CONFIG_BLK_DEV_RAM_SIZE=16384 111CONFIG_BLK_DEV_RAM_SIZE=16384
@@ -191,13 +193,21 @@ CONFIG_REGULATOR_TPS65217=y
191CONFIG_REGULATOR_TPS65910=y 193CONFIG_REGULATOR_TPS65910=y
192CONFIG_REGULATOR_TI_ABB=y 194CONFIG_REGULATOR_TI_ABB=y
193CONFIG_REGULATOR_TIAVSCLASS0=y 195CONFIG_REGULATOR_TIAVSCLASS0=y
194CONFIG_MEDIA_SUPPORT=m 196CONFIG_MEDIA_SUPPORT=y
195CONFIG_MEDIA_CAMERA_SUPPORT=y 197CONFIG_MEDIA_CAMERA_SUPPORT=y
196CONFIG_VIDEO_DEV=m 198CONFIG_VIDEO_DEV=y
197CONFIG_VIDEO_V4L2=m 199CONFIG_VIDEO_V4L2=y
198CONFIG_VIDEOBUF2_CORE=m 200CONFIG_VIDEOBUF2_CORE=y
199CONFIG_VIDEOBUF2_MEMOPS=m 201CONFIG_VIDEOBUF2_MEMOPS=y
200CONFIG_VIDEOBUF2_VMALLOC=m 202CONFIG_VIDEOBUF2_VMALLOC=y
203CONFIG_V4L_PLATFORM_DRIVERS=y
204CONFIG_VIDEO_TI_VIP=y
205CONFIG_VIDEO_LOAD_KERNEL_VPDMA=y
206CONFIG_MEDIA_SUBDRV_AUTOSELECT=n
207CONFIG_VIDEO_OV1063X=y
208CONFIG_VIDEO_TVP5158=y
209CONFIG_V4L_MEM2MEM_DRIVERS=y
210CONFIG_VIDEO_TI_VPE=y
201CONFIG_MEDIA_USB_SUPPORT=y 211CONFIG_MEDIA_USB_SUPPORT=y
202CONFIG_USB_VIDEO_CLASS=m 212CONFIG_USB_VIDEO_CLASS=m
203CONFIG_USB_VIDEO_CLASS_INPUT_EVDEV=y 213CONFIG_USB_VIDEO_CLASS_INPUT_EVDEV=y
@@ -225,6 +235,9 @@ CONFIG_PANEL_LG4591=y
225CONFIG_PANEL_TPO_TD043MTEA1=y 235CONFIG_PANEL_TPO_TD043MTEA1=y
226CONFIG_PANEL_ACX565AKM=y 236CONFIG_PANEL_ACX565AKM=y
227CONFIG_PANEL_N8X0=y 237CONFIG_PANEL_N8X0=y
238CONFIG_PANEL_LG_101=y
239CONFIG_PANEL_SERLINK=y
240CONFIG_PANEL_DSERLINK=y
228CONFIG_BACKLIGHT_LCD_SUPPORT=y 241CONFIG_BACKLIGHT_LCD_SUPPORT=y
229CONFIG_LCD_CLASS_DEVICE=y 242CONFIG_LCD_CLASS_DEVICE=y
230CONFIG_LCD_PLATFORM=y 243CONFIG_LCD_PLATFORM=y
@@ -261,6 +274,7 @@ CONFIG_SND_SOC_TLV320AIC3X=y
261CONFIG_USB=y 274CONFIG_USB=y
262CONFIG_USB_ANNOUNCE_NEW_DEVICES=y 275CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
263CONFIG_USB_SUSPEND=y 276CONFIG_USB_SUSPEND=y
277CONFIG_USB_XHCI_HCD=m
264CONFIG_USB_EHCI_HCD=y 278CONFIG_USB_EHCI_HCD=y
265CONFIG_USB_DWC3=m 279CONFIG_USB_DWC3=m
266CONFIG_USB_DWC3_DUAL_ROLE=y 280CONFIG_USB_DWC3_DUAL_ROLE=y
diff --git a/arch/arm/configs/omap5_earlyboot_defconfig b/arch/arm/configs/omap5_earlyboot_defconfig
new file mode 100644
index 000000000000..33f8cbbe9446
--- /dev/null
+++ b/arch/arm/configs/omap5_earlyboot_defconfig
@@ -0,0 +1,301 @@
1CONFIG_EXPERIMENTAL=y
2CONFIG_KERNEL_LZO=y
3CONFIG_SYSVIPC=y
4CONFIG_POSIX_MQUEUE=y
5CONFIG_NO_HZ=y
6CONFIG_HIGH_RES_TIMERS=y
7CONFIG_BSD_PROCESS_ACCT=y
8CONFIG_IKCONFIG=y
9CONFIG_IKCONFIG_PROC=y
10CONFIG_LOG_BUF_SHIFT=16
11CONFIG_BLK_DEV_INITRD=y
12CONFIG_INITRAMFS_SOURCE="initramfs"
13CONFIG_EXPERT=y
14# CONFIG_PRINTK is not set
15# CONFIG_BUG is not set
16CONFIG_PERF_EVENTS=y
17CONFIG_SLAB=y
18CONFIG_KPROBES=y
19CONFIG_MODULES=y
20CONFIG_MODULE_FORCE_LOAD=y
21CONFIG_MODULE_UNLOAD=y
22CONFIG_MODULE_FORCE_UNLOAD=y
23CONFIG_MODVERSIONS=y
24CONFIG_MODULE_SRCVERSION_ALL=y
25# CONFIG_BLK_DEV_BSG is not set
26CONFIG_PARTITION_ADVANCED=y
27CONFIG_ARCH_OMAP=y
28CONFIG_OMAP_RESET_CLOCKS=y
29CONFIG_OMAP_MUX_DEBUG=y
30CONFIG_SOC_HAS_OMAP2_SDRC=y
31# CONFIG_ARCH_OMAP2 is not set
32# CONFIG_ARCH_OMAP3 is not set
33# CONFIG_ARCH_OMAP4 is not set
34CONFIG_SOC_OMAP5=y
35CONFIG_SOC_DRA7XX=y
36CONFIG_ARM_THUMBEE=y
37CONFIG_ARM_ERRATA_720789=y
38CONFIG_SMP=y
39CONFIG_NR_CPUS=2
40CONFIG_PREEMPT=y
41CONFIG_ZBOOT_ROM_TEXT=0x0
42CONFIG_ZBOOT_ROM_BSS=0x0
43CONFIG_CMDLINE="elevator=noop console=ttyO2,115200n8 earlyprintk=0 fixrtc quiet"
44CONFIG_KEXEC=y
45CONFIG_CPU_FREQ=y
46CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y
47CONFIG_CPU_FREQ_GOV_USERSPACE=y
48CONFIG_GENERIC_CPUFREQ_CPU0=y
49# CONFIG_ARM_OMAP2PLUS_CPUFREQ is not set
50CONFIG_FPE_NWFPE=y
51CONFIG_BINFMT_MISC=y
52CONFIG_PM_DEBUG=y
53CONFIG_NET=y
54CONFIG_PACKET=y
55CONFIG_UNIX=y
56CONFIG_XFRM_USER=y
57CONFIG_NET_KEY=y
58CONFIG_NET_KEY_MIGRATE=y
59CONFIG_INET=y
60CONFIG_IP_MULTICAST=y
61CONFIG_IP_PNP=y
62CONFIG_IP_PNP_DHCP=y
63CONFIG_IP_PNP_BOOTP=y
64CONFIG_IP_PNP_RARP=y
65# CONFIG_INET_LRO is not set
66# CONFIG_IPV6 is not set
67CONFIG_NETFILTER=y
68CONFIG_CAN=m
69CONFIG_CAN_RAW=m
70CONFIG_CAN_BCM=m
71CONFIG_CAN_C_CAN=m
72CONFIG_CAN_C_CAN_PLATFORM=m
73CONFIG_BT=m
74CONFIG_BT_HCIUART=m
75CONFIG_BT_HCIUART_H4=y
76CONFIG_BT_HCIUART_BCSP=y
77CONFIG_BT_HCIUART_LL=y
78CONFIG_BT_HCIBCM203X=m
79CONFIG_BT_HCIBPA10X=m
80CONFIG_CFG80211=m
81CONFIG_MAC80211=m
82CONFIG_MAC80211_RC_PID=y
83CONFIG_MAC80211_RC_DEFAULT_PID=y
84CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
85CONFIG_DEVTMPFS=y
86CONFIG_DEVTMPFS_MOUNT=y
87CONFIG_OMAP_OCP2SCP=y
88CONFIG_OMAP_INTERCONNECT=y
89CONFIG_CONNECTOR=y
90CONFIG_BLK_DEV_LOOP=y
91CONFIG_BLK_DEV_RAM=y
92CONFIG_BLK_DEV_RAM_SIZE=16384
93CONFIG_SENSORS_TSL2550=m
94CONFIG_EEPROM_93CX6=y
95CONFIG_SENSORS_LIS3_I2C=m
96CONFIG_BLK_DEV_SD=m
97CONFIG_SCSI_MULTI_LUN=y
98CONFIG_SCSI_SCAN_ASYNC=y
99CONFIG_ATA=m
100# CONFIG_SATA_PMP is not set
101CONFIG_SATA_AHCI_PLATFORM=m
102# CONFIG_ATA_SFF is not set
103CONFIG_MD=y
104CONFIG_NETDEVICES=y
105# CONFIG_NET_CADENCE is not set
106# CONFIG_NET_VENDOR_BROADCOM is not set
107# CONFIG_NET_VENDOR_CIRRUS is not set
108# CONFIG_NET_VENDOR_FARADAY is not set
109# CONFIG_NET_VENDOR_INTEL is not set
110# CONFIG_NET_VENDOR_MARVELL is not set
111# CONFIG_NET_VENDOR_MICREL is not set
112# CONFIG_NET_VENDOR_NATSEMI is not set
113# CONFIG_NET_VENDOR_SEEQ is not set
114CONFIG_SMC91X=y
115CONFIG_SMSC911X=y
116# CONFIG_NET_VENDOR_STMICRO is not set
117# CONFIG_NET_VENDOR_TI is not set
118# CONFIG_NET_VENDOR_WIZNET is not set
119CONFIG_SMSC_PHY=y
120CONFIG_USB_USBNET=m
121CONFIG_USB_NET_SMSC95XX=m
122CONFIG_USB_ALI_M5632=y
123CONFIG_USB_AN2720=y
124CONFIG_USB_EPSON2888=y
125CONFIG_USB_KC2190=y
126# CONFIG_WLAN is not set
127CONFIG_INPUT_JOYDEV=m
128CONFIG_INPUT_EVDEV=y
129CONFIG_KEYBOARD_GPIO=y
130CONFIG_KEYBOARD_MATRIX=m
131CONFIG_KEYBOARD_TWL4030=y
132CONFIG_INPUT_MISC=y
133CONFIG_INPUT_TWL4030_PWRBUTTON=y
134CONFIG_VT_HW_CONSOLE_BINDING=y
135# CONFIG_LEGACY_PTYS is not set
136CONFIG_SERIAL_8250=y
137CONFIG_SERIAL_8250_CONSOLE=y
138CONFIG_SERIAL_8250_NR_UARTS=32
139CONFIG_SERIAL_8250_EXTENDED=y
140CONFIG_SERIAL_8250_MANY_PORTS=y
141CONFIG_SERIAL_8250_SHARE_IRQ=y
142CONFIG_SERIAL_8250_DETECT_IRQ=y
143CONFIG_SERIAL_8250_RSA=y
144CONFIG_HW_RANDOM=y
145CONFIG_I2C_CHARDEV=y
146CONFIG_DEBUG_PINCTRL=y
147CONFIG_DEBUG_GPIO=y
148CONFIG_GPIO_SYSFS=y
149CONFIG_GPIO_PCF857X=y
150CONFIG_GPIO_TWL4030=y
151CONFIG_W1=y
152CONFIG_POWER_SUPPLY=y
153CONFIG_SENSORS_LM75=m
154CONFIG_THERMAL=y
155CONFIG_THERMAL_GOV_FAIR_SHARE=y
156CONFIG_THERMAL_GOV_USER_SPACE=y
157CONFIG_CPU_THERMAL=y
158CONFIG_WATCHDOG=y
159CONFIG_PALMAS_WATCHDOG=y
160CONFIG_OMAP_WATCHDOG=y
161CONFIG_TWL4030_WATCHDOG=y
162CONFIG_MFD_TPS65217=y
163CONFIG_MFD_TPS65910=y
164CONFIG_TWL4030_CORE=y
165CONFIG_TWL4030_POWER=y
166CONFIG_TWL6040_CORE=y
167CONFIG_MFD_PALMAS_GPADC=y
168CONFIG_MFD_PALMAS_PWM=y
169CONFIG_MFD_PALMAS_RESOURCE=y
170CONFIG_REGULATOR_FIXED_VOLTAGE=y
171CONFIG_REGULATOR_TPS65023=y
172CONFIG_REGULATOR_TPS6507X=y
173CONFIG_REGULATOR_TPS65217=y
174CONFIG_REGULATOR_TPS65910=y
175CONFIG_REGULATOR_TWL4030=y
176CONFIG_REGULATOR_TIAVSCLASS0=y
177CONFIG_MEDIA_SUPPORT=m
178CONFIG_MEDIA_CAMERA_SUPPORT=y
179CONFIG_MEDIA_USB_SUPPORT=y
180CONFIG_USB_VIDEO_CLASS=m
181CONFIG_DRM=y
182CONFIG_DRM_OMAP=y
183CONFIG_DRM_OMAP_NUM_CRTCS=3
184CONFIG_FIRMWARE_EDID=y
185CONFIG_FB_MODE_HELPERS=y
186CONFIG_FB_TILEBLITTING=y
187CONFIG_OMAP2_DSS=y
188CONFIG_OMAP2_DSS_DRA7XX_DPI=y
189CONFIG_OMAP2_DSS_RFBI=y
190CONFIG_OMAP2_DSS_SDI=y
191CONFIG_OMAP2_DSS_DSI=y
192CONFIG_PANEL_GENERIC_DPI=y
193CONFIG_PANEL_TFP410=y
194CONFIG_PANEL_SHARP_LS037V7DW01=y
195CONFIG_PANEL_PICODLP=y
196CONFIG_PANEL_TFCS9700=y
197CONFIG_PANEL_TAAL=y
198CONFIG_PANEL_LG4591=y
199CONFIG_BACKLIGHT_LCD_SUPPORT=y
200CONFIG_LCD_CLASS_DEVICE=y
201CONFIG_LCD_PLATFORM=y
202CONFIG_BACKLIGHT_CLASS_DEVICE=y
203CONFIG_FRAMEBUFFER_CONSOLE=y
204CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y
205CONFIG_FONTS=y
206CONFIG_FONT_8x8=y
207CONFIG_FONT_8x16=y
208CONFIG_LOGO=y
209CONFIG_SOUND=m
210CONFIG_SND=m
211CONFIG_SND_MIXER_OSS=m
212CONFIG_SND_PCM_OSS=m
213CONFIG_SND_VERBOSE_PRINTK=y
214CONFIG_SND_DEBUG=y
215CONFIG_SND_USB_AUDIO=m
216CONFIG_SND_SOC=m
217CONFIG_SND_OMAP_SOC=m
218CONFIG_SND_OMAP_SOC_OMAP_TWL4030=m
219CONFIG_SND_OMAP_SOC_OMAP_ABE_TWL6040=m
220CONFIG_SND_OMAP_SOC_OMAP_HDMI=m
221CONFIG_SND_SOC_DRA7_EVM=m
222CONFIG_USB=m
223CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
224CONFIG_USB_SUSPEND=y
225CONFIG_USB_DWC3=m
226CONFIG_USB_MON=m
227CONFIG_USB_XHCI_HCD=m
228CONFIG_USB_EHCI_HCD=m
229CONFIG_USB_WDM=m
230CONFIG_USB_STORAGE=m
231CONFIG_USB_TEST=m
232CONFIG_OMAP_USB2=m
233CONFIG_OMAP_USB3=m
234CONFIG_OMAP_CONTROL_USB=y
235CONFIG_USB_GADGET=y
236CONFIG_USB_GADGET_DEBUG_FILES=y
237CONFIG_USB_GADGET_DEBUG_FS=y
238CONFIG_USB_ZERO=m
239CONFIG_USB_ETH=m
240CONFIG_USB_ETH_EEM=y
241CONFIG_USB_MASS_STORAGE=m
242CONFIG_USB_G_MULTI=m
243CONFIG_USB_G_MULTI_CDC=y
244CONFIG_NOP_USB_XCEIV=y
245CONFIG_PALMAS_USB=m
246CONFIG_MMC=y
247CONFIG_MMC_UNSAFE_RESUME=y
248CONFIG_SDIO_UART=y
249CONFIG_MMC_OMAP=y
250CONFIG_MMC_OMAP_HS=y
251CONFIG_NEW_LEDS=y
252CONFIG_LEDS_CLASS=y
253CONFIG_LEDS_GPIO=y
254CONFIG_LEDS_TRIGGERS=y
255CONFIG_LEDS_TRIGGER_TIMER=y
256CONFIG_LEDS_TRIGGER_ONESHOT=y
257CONFIG_LEDS_TRIGGER_HEARTBEAT=y
258CONFIG_LEDS_TRIGGER_BACKLIGHT=y
259CONFIG_LEDS_TRIGGER_CPU=y
260CONFIG_LEDS_TRIGGER_GPIO=y
261CONFIG_LEDS_TRIGGER_DEFAULT_ON=y
262CONFIG_RTC_CLASS=y
263CONFIG_RTC_DRV_PALMAS=y
264CONFIG_RTC_DRV_TWL4030=y
265CONFIG_RTC_DRV_OMAP=y
266CONFIG_DMADEVICES=y
267CONFIG_TI_EDMA=y
268CONFIG_DMA_OMAP=y
269CONFIG_STAGING=y
270CONFIG_TI_SOC_THERMAL=y
271CONFIG_TI_THERMAL=y
272CONFIG_OMAP5_THERMAL=y
273CONFIG_DRA752_THERMAL=y
274CONFIG_EXT4_FS=y
275CONFIG_QUOTA=y
276CONFIG_QFMT_V2=y
277CONFIG_MSDOS_FS=y
278CONFIG_VFAT_FS=y
279CONFIG_TMPFS=y
280# CONFIG_MISC_FILESYSTEMS is not set
281CONFIG_NFS_FS=y
282CONFIG_NFS_V3_ACL=y
283CONFIG_NFS_V4=y
284CONFIG_ROOT_NFS=y
285CONFIG_NLS_CODEPAGE_437=y
286CONFIG_NLS_ISO8859_1=y
287CONFIG_MAGIC_SYSRQ=y
288CONFIG_DEBUG_FS=y
289# CONFIG_SCHED_DEBUG is not set
290CONFIG_PROVE_LOCKING=y
291# CONFIG_FTRACE is not set
292CONFIG_SECURITY=y
293CONFIG_CRYPTO_MICHAEL_MIC=y
294CONFIG_CRYPTO_DEFLATE=y
295CONFIG_CRYPTO_LZO=y
296# CONFIG_CRYPTO_ANSI_CPRNG is not set
297CONFIG_CRC_CCITT=y
298CONFIG_CRC_T10DIF=y
299CONFIG_CRC_ITU_T=y
300CONFIG_CRC7=y
301CONFIG_LIBCRC32C=y
diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
index 751d889a59cd..398e5fdc21de 100644
--- a/arch/arm/mach-omap2/Kconfig
+++ b/arch/arm/mach-omap2/Kconfig
@@ -471,6 +471,12 @@ config IVA_HIGH_OPP
471 help 471 help
472 Lock IVA DPLL for HIGH OPP (532 MHz) 472 Lock IVA DPLL for HIGH OPP (532 MHz)
473 473
474config RADIO_CMEM_BUF
475 bool "CMEM buffers for Radio"
476 depends on SOC_DRA7XX && OMAP_REMOTEPROC_DSP
477 default y
478 help
479 Use CMEM Allocator for large buffer sharing in Radio
474endmenu 480endmenu
475 481
476endif 482endif
diff --git a/arch/arm/mach-omap2/cclock54xx_data.c b/arch/arm/mach-omap2/cclock54xx_data.c
index db6f676b5e32..9366bb88f750 100644
--- a/arch/arm/mach-omap2/cclock54xx_data.c
+++ b/arch/arm/mach-omap2/cclock54xx_data.c
@@ -67,10 +67,14 @@
67 * M & N divider values. The output clock values are based on the OPP_NOM 67 * M & N divider values. The output clock values are based on the OPP_NOM
68 * frequencies for DSP and IVAHD subsystems. 68 * frequencies for DSP and IVAHD subsystems.
69 */ 69 */
70#ifdef CONFIG_IVA_HIGH_OPP
71#define OMAP5_DPLL_IVA_DEFFREQ 1062400000
72#define OMAP5_IVA_GCLK_NOMFREQ 531200000
73#else
70#define OMAP5_DPLL_IVA_DEFFREQ 1164800000 74#define OMAP5_DPLL_IVA_DEFFREQ 1164800000
71#define OMAP5_DSP_GCLK_NOMFREQ 466000000
72#define OMAP5_IVA_GCLK_NOMFREQ 388300000 75#define OMAP5_IVA_GCLK_NOMFREQ 388300000
73 76#endif
77#define OMAP5_DSP_GCLK_NOMFREQ 466000000
74/* Root clocks */ 78/* Root clocks */
75 79
76DEFINE_CLK_FIXED_RATE(pad_clks_src_ck, CLK_IS_ROOT, 12000000, 0x0); 80DEFINE_CLK_FIXED_RATE(pad_clks_src_ck, CLK_IS_ROOT, 12000000, 0x0);
diff --git a/arch/arm/mach-omap2/cclock7xx_data.c b/arch/arm/mach-omap2/cclock7xx_data.c
index 308bd669268e..79b136088fbe 100644
--- a/arch/arm/mach-omap2/cclock7xx_data.c
+++ b/arch/arm/mach-omap2/cclock7xx_data.c
@@ -43,6 +43,7 @@
43#define DRA7_DPLL_ABE_DEFFREQ 180633600 43#define DRA7_DPLL_ABE_DEFFREQ 180633600
44#define DRA7_DPLL_GMAC_DEFFREQ 1000000000 44#define DRA7_DPLL_GMAC_DEFFREQ 1000000000
45#define DRA7_DPLL_USB_DEFFREQ 960000000 45#define DRA7_DPLL_USB_DEFFREQ 960000000
46#define DRA7_L3INIT_480_GFCLK 480000000
46#define DRA7_DPLL_DSP_DEFFREQ 600000000 47#define DRA7_DPLL_DSP_DEFFREQ 600000000
47#define DRA7_DPLL_DSP_GFCLK_NOMFREQ 600000000 48#define DRA7_DPLL_DSP_GFCLK_NOMFREQ 600000000
48#define DRA7_DPLL_EVE_GCLK_NOMFREQ 400000000 49#define DRA7_DPLL_EVE_GCLK_NOMFREQ 400000000
@@ -2141,6 +2142,7 @@ static struct rate_init_clks rate_clks[] = {
2141 { .name = "dpll_abe_m2x2_ck", .rate = DRA7_DPLL_ABE_DEFFREQ * 2 }, 2142 { .name = "dpll_abe_m2x2_ck", .rate = DRA7_DPLL_ABE_DEFFREQ * 2 },
2142 { .name = "dpll_gmac_ck", .rate = DRA7_DPLL_GMAC_DEFFREQ }, 2143 { .name = "dpll_gmac_ck", .rate = DRA7_DPLL_GMAC_DEFFREQ },
2143 { .name = "dpll_usb_ck", .rate = DRA7_DPLL_USB_DEFFREQ }, 2144 { .name = "dpll_usb_ck", .rate = DRA7_DPLL_USB_DEFFREQ },
2145 { .name = "dpll_usb_m2_ck", .rate = DRA7_L3INIT_480_GFCLK},
2144 { .name = "dpll_dsp_ck", .rate = DRA7_DPLL_DSP_DEFFREQ }, 2146 { .name = "dpll_dsp_ck", .rate = DRA7_DPLL_DSP_DEFFREQ },
2145 { .name = "dpll_dsp_m2_ck", .rate = DRA7_DPLL_DSP_GFCLK_NOMFREQ }, 2147 { .name = "dpll_dsp_m2_ck", .rate = DRA7_DPLL_DSP_GFCLK_NOMFREQ },
2146 { .name = "dpll_dsp_m3x2_ck", .rate = DRA7_DPLL_EVE_GCLK_NOMFREQ }, 2148 { .name = "dpll_dsp_m3x2_ck", .rate = DRA7_DPLL_EVE_GCLK_NOMFREQ },
diff --git a/arch/arm/mach-omap2/common.c b/arch/arm/mach-omap2/common.c
index b47379e10270..d6d2d872436a 100644
--- a/arch/arm/mach-omap2/common.c
+++ b/arch/arm/mach-omap2/common.c
@@ -16,10 +16,21 @@
16#include <linux/init.h> 16#include <linux/init.h>
17#include <linux/platform_data/dsp-omap.h> 17#include <linux/platform_data/dsp-omap.h>
18#include <linux/platform_data/remoteproc-omap.h> 18#include <linux/platform_data/remoteproc-omap.h>
19#include <linux/memblock.h>
19 20
20#include "common.h" 21#include "common.h"
21#include "omap-secure.h" 22#include "omap-secure.h"
22 23
24#ifdef CONFIG_RADIO_CMEM_BUF
25/*
26 * Define the CMEM base address explicitly.
27 * Consider system memory map before changing this address
28 */
29#define DRA7_PHYS_ADDR_CMEM_BASE (0x95400000)
30#define DRA7_CMEM_SIZE (SZ_4M)
31
32#endif
33
23/* 34/*
24 * Stub function for OMAP2 so that common files 35 * Stub function for OMAP2 so that common files
25 * continue to build when custom builds are used 36 * continue to build when custom builds are used
@@ -43,6 +54,11 @@ void __init omap5_reserve(void)
43 54
44void __init dra7_reserve(void) 55void __init dra7_reserve(void)
45{ 56{
57#ifdef CONFIG_RADIO_CMEM_BUF
58 /* Reserve memory for CMEM pool used by Radio application */
59 if (memblock_remove(DRA7_PHYS_ADDR_CMEM_BASE, DRA7_CMEM_SIZE))
60 pr_err("Failed to reserve memory pool for CMEM Allocator\n");
61#endif
46 omap_rproc_reserve_cma(RPROC_CMA_DRA7); 62 omap_rproc_reserve_cma(RPROC_CMA_DRA7);
47 omap_reserve(); 63 omap_reserve();
48} 64}
diff --git a/arch/arm/mach-omap2/sata.c b/arch/arm/mach-omap2/sata.c
index 9377af56f02d..9775a9970512 100644
--- a/arch/arm/mach-omap2/sata.c
+++ b/arch/arm/mach-omap2/sata.c
@@ -120,10 +120,14 @@
120/* Enable Tx and Rx phys */ 120/* Enable Tx and Rx phys */
121#define SATA_PWRCTL_CLK_CMD 3 121#define SATA_PWRCTL_CLK_CMD 3
122 122
123/* skip idle during suspend */
124#define SATA_SKIP_IDLE_WHILE_SUSPEND (1 << 0)
125
123struct omap_sata_platdata { 126struct omap_sata_platdata {
124 void __iomem *ocp2scp3, *phyrx, *pll; 127 void __iomem *ocp2scp3, *phyrx, *pll;
125 struct omap_ocp2scp_dev *dev_attr; 128 struct omap_ocp2scp_dev *dev_attr;
126 struct clk *ref_clk; 129 struct clk *ref_clk;
130 u32 flags;
127}; 131};
128 132
129static struct omap_sata_platdata omap_sata_data; 133static struct omap_sata_platdata omap_sata_data;
@@ -422,6 +426,9 @@ static int sata_phy_init(struct device *dev)
422 goto rx_err_end; 426 goto rx_err_end;
423 } 427 }
424 428
429 /* Fix for Errata, SATA DPLL unlock/lock issue during resume */
430 spdata->flags = SATA_SKIP_IDLE_WHILE_SUSPEND;
431
425 clk_enable(spdata->ref_clk); 432 clk_enable(spdata->ref_clk);
426 433
427 omap_ocp2scp_init(dev, spdata->ocp2scp3); 434 omap_ocp2scp_init(dev, spdata->ocp2scp3);
@@ -503,6 +510,14 @@ static int omap_sata_suspend(struct device *dev)
503 return -EPERM; 510 return -EPERM;
504 } 511 }
505 512
513 /* Fix for Errata, SATA DPLL unlock/lock issue during resume.
514 * SATA DPLL cannot be powerdown during suspend.
515 * SATA controller does not interop with devices during
516 * resume, when dpll powerdown during suspend operation.
517 */
518 if (spdata->flags & SATA_SKIP_IDLE_WHILE_SUSPEND)
519 goto skip_idle;
520
506 reg = omap_sata_readl(spdata->pll, OMAP_SATA_PLL_CFG2); 521 reg = omap_sata_readl(spdata->pll, OMAP_SATA_PLL_CFG2);
507 reg &= ~OMAP_SATA_PLL_CFG2_IDLE_MASK; 522 reg &= ~OMAP_SATA_PLL_CFG2_IDLE_MASK;
508 reg |= OMAP_SATA_PLL_CFG2_IDLE; 523 reg |= OMAP_SATA_PLL_CFG2_IDLE;
@@ -522,6 +537,7 @@ static int omap_sata_suspend(struct device *dev)
522 } 537 }
523 } while (!reg); 538 } while (!reg);
524 539
540skip_idle:
525#ifdef OMAP_SATA_PHY_PWR 541#ifdef OMAP_SATA_PHY_PWR
526 sataphy_pwr_off(); 542 sataphy_pwr_off();
527#endif 543#endif
@@ -558,8 +574,14 @@ static int omap_sata_resume(struct device *dev)
558 omap_sata_writel(spdata->pll, OMAP_SATA_PLL_CFG2, reg); 574 omap_sata_writel(spdata->pll, OMAP_SATA_PLL_CFG2, reg);
559 } else { 575 } else {
560 dev_err(dev, "sata pll not in idle, so reconfigure pll\n"); 576 dev_err(dev, "sata pll not in idle, so reconfigure pll\n");
561 omap_sataphyrx_init(dev, spdata->phyrx); 577
562 sata_dpll_config(dev, spdata->pll); 578 /* reconfigure pll if pll not locked */
579 reg = omap_sata_readl(spdata->pll, OMAP_SATA_PLL_STATUS);
580 if (!(reg & (OMAP_SATA_PLL_STATUS_LOCK
581 << OMAP_SATA_PLL_STATUS_LOCK_SHIFT))) {
582 omap_sataphyrx_init(dev, spdata->phyrx);
583 sata_dpll_config(dev, spdata->pll);
584 }
563 } 585 }
564 sata_dpll_wait_lock(dev, spdata->pll); 586 sata_dpll_wait_lock(dev, spdata->pll);
565 587
diff --git a/drivers/extcon/extcon-gpio-usbvid.c b/drivers/extcon/extcon-gpio-usbvid.c
index d235fd6bfe49..289db193dda6 100644
--- a/drivers/extcon/extcon-gpio-usbvid.c
+++ b/drivers/extcon/extcon-gpio-usbvid.c
@@ -228,6 +228,7 @@ static int gpio_usbvid_probe(struct platform_device *pdev)
228 int ret, gpio; 228 int ret, gpio;
229 int intr_mode; 229 int intr_mode;
230 enum usb_dr_mode mode; 230 enum usb_dr_mode mode;
231 int id_current;
231 232
232 if (!node) 233 if (!node)
233 return -EINVAL; 234 return -EINVAL;
@@ -300,7 +301,8 @@ static int gpio_usbvid_probe(struct platform_device *pdev)
300 return ret; 301 return ret;
301 gpio_usbvid_set_initial_state(gpio_usbvid); 302 gpio_usbvid_set_initial_state(gpio_usbvid);
302 } else { 303 } else {
303 gpio_usbvid->id_current = -1; 304 id_current = gpio_get_value_cansleep(gpio_usbvid->id_gpio);
305 gpio_usbvid->id_current = id_current;
304 gpio_usbvid->usbid_thread = kthread_run(poll_usbvbus_id_task, 306 gpio_usbvid->usbid_thread = kthread_run(poll_usbvbus_id_task,
305 gpio_usbvid, "extcon-usbid"); 307 gpio_usbvid, "extcon-usbid");
306 if (IS_ERR(gpio_usbvid->usbid_thread)) 308 if (IS_ERR(gpio_usbvid->usbid_thread))
diff --git a/drivers/gpu/drm/omapdrm/omap_crtc.c b/drivers/gpu/drm/omapdrm/omap_crtc.c
index 461ecee0d0d2..c9d4cab13580 100644
--- a/drivers/gpu/drm/omapdrm/omap_crtc.c
+++ b/drivers/gpu/drm/omapdrm/omap_crtc.c
@@ -196,13 +196,35 @@ static bool omap_crtc_mode_fixup(struct drm_crtc *crtc,
196 return true; 196 return true;
197} 197}
198 198
199int crtc_wait_vsync(struct drm_crtc *crtc)
200{
201 struct drm_device *dev = crtc->dev;
202 struct omap_crtc *omap_crtc = to_omap_crtc(crtc);
203 enum omap_channel channel = omap_crtc->channel;
204 struct omap_irq_wait *wait = NULL;
205 int r = 0;
206
207 dispc_runtime_get();
208
209 if (dispc_mgr_is_enabled(channel)) {
210 wait = omap_irq_wait_init(dev, dispc_mgr_get_vsync_irq(channel), 1);
211 r = omap_irq_wait(dev, wait, msecs_to_jiffies(100));
212 }
213
214 dispc_runtime_put();
215
216 return r;
217}
218
199static int omap_crtc_mode_set(struct drm_crtc *crtc, 219static int omap_crtc_mode_set(struct drm_crtc *crtc,
200 struct drm_display_mode *mode, 220 struct drm_display_mode *mode,
201 struct drm_display_mode *adjusted_mode, 221 struct drm_display_mode *adjusted_mode,
202 int x, int y, 222 int x, int y,
203 struct drm_framebuffer *old_fb) 223 struct drm_framebuffer *old_fb)
204{ 224{
225 struct drm_device *dev = crtc->dev;
205 struct omap_crtc *omap_crtc = to_omap_crtc(crtc); 226 struct omap_crtc *omap_crtc = to_omap_crtc(crtc);
227 int r;
206 228
207 mode = adjusted_mode; 229 mode = adjusted_mode;
208 230
@@ -218,11 +240,19 @@ static int omap_crtc_mode_set(struct drm_crtc *crtc,
218 copy_timings_drm_to_omap(&omap_crtc->timings, mode); 240 copy_timings_drm_to_omap(&omap_crtc->timings, mode);
219 omap_crtc->full_update = true; 241 omap_crtc->full_update = true;
220 242
221 return omap_plane_mode_set(omap_crtc->plane, crtc, crtc->fb, 243 r = omap_plane_mode_set(omap_crtc->plane, crtc, crtc->fb,
222 0, 0, mode->hdisplay, mode->vdisplay, 244 0, 0, mode->hdisplay, mode->vdisplay,
223 x << 16, y << 16, 245 x << 16, y << 16,
224 mode->hdisplay << 16, mode->vdisplay << 16, 246 mode->hdisplay << 16, mode->vdisplay << 16,
225 NULL, NULL); 247 NULL, NULL);
248 if (r)
249 return r;
250
251 r = crtc_wait_vsync(crtc);
252 if (r)
253 dev_err(dev->dev, "didn't get a vsync\n");
254
255 return r;
226} 256}
227 257
228static void omap_crtc_prepare(struct drm_crtc *crtc) 258static void omap_crtc_prepare(struct drm_crtc *crtc)
@@ -242,15 +272,25 @@ static void omap_crtc_commit(struct drm_crtc *crtc)
242static int omap_crtc_mode_set_base(struct drm_crtc *crtc, int x, int y, 272static int omap_crtc_mode_set_base(struct drm_crtc *crtc, int x, int y,
243 struct drm_framebuffer *old_fb) 273 struct drm_framebuffer *old_fb)
244{ 274{
275 struct drm_device *dev = crtc->dev;
245 struct omap_crtc *omap_crtc = to_omap_crtc(crtc); 276 struct omap_crtc *omap_crtc = to_omap_crtc(crtc);
246 struct drm_plane *plane = omap_crtc->plane; 277 struct drm_plane *plane = omap_crtc->plane;
247 struct drm_display_mode *mode = &crtc->mode; 278 struct drm_display_mode *mode = &crtc->mode;
279 int r;
248 280
249 return omap_plane_mode_set(plane, crtc, crtc->fb, 281 r = omap_plane_mode_set(plane, crtc, crtc->fb,
250 0, 0, mode->hdisplay, mode->vdisplay, 282 0, 0, mode->hdisplay, mode->vdisplay,
251 x << 16, y << 16, 283 x << 16, y << 16,
252 mode->hdisplay << 16, mode->vdisplay << 16, 284 mode->hdisplay << 16, mode->vdisplay << 16,
253 NULL, NULL); 285 NULL, NULL);
286 if (r)
287 return r;
288
289 r = crtc_wait_vsync(crtc);
290 if (r)
291 dev_err(dev->dev, "didn't get a vsync\n");
292
293 return r;
254} 294}
255 295
256static void omap_crtc_load_lut(struct drm_crtc *crtc) 296static void omap_crtc_load_lut(struct drm_crtc *crtc)
@@ -314,6 +354,7 @@ static int omap_crtc_page_flip_locked(struct drm_crtc *crtc,
314 struct drm_device *dev = crtc->dev; 354 struct drm_device *dev = crtc->dev;
315 struct omap_crtc *omap_crtc = to_omap_crtc(crtc); 355 struct omap_crtc *omap_crtc = to_omap_crtc(crtc);
316 struct drm_gem_object *bo; 356 struct drm_gem_object *bo;
357 unsigned long flags;
317 358
318 DBG("%d -> %d (event=%p)", crtc->fb ? crtc->fb->base.id : -1, 359 DBG("%d -> %d (event=%p)", crtc->fb ? crtc->fb->base.id : -1,
319 fb->base.id, event); 360 fb->base.id, event);
@@ -323,9 +364,12 @@ static int omap_crtc_page_flip_locked(struct drm_crtc *crtc,
323 return -EINVAL; 364 return -EINVAL;
324 } 365 }
325 366
367 spin_lock_irqsave(&dev->event_lock, flags);
368
326 omap_crtc->event = event; 369 omap_crtc->event = event;
327 crtc->fb = fb; 370 omap_crtc->old_fb = crtc->fb = fb;
328 371
372 spin_unlock_irqrestore(&dev->event_lock, flags);
329 /* 373 /*
330 * Hold a reference temporarily until the crtc is updated 374 * Hold a reference temporarily until the crtc is updated
331 * and takes the reference to the bo. This avoids it 375 * and takes the reference to the bo. This avoids it
diff --git a/drivers/gpu/drm/omapdrm/omap_dmm_tiler.c b/drivers/gpu/drm/omapdrm/omap_dmm_tiler.c
index a00e80b71c61..8e92a1c2f4d4 100644
--- a/drivers/gpu/drm/omapdrm/omap_dmm_tiler.c
+++ b/drivers/gpu/drm/omapdrm/omap_dmm_tiler.c
@@ -144,7 +144,7 @@ static irqreturn_t omap_dmm_irq_handler(int irq, void *arg)
144 if (status & DMM_IRQSTAT_LST) { 144 if (status & DMM_IRQSTAT_LST) {
145 wake_up_interruptible(&dmm->engines[i].wait_for_refill); 145 wake_up_interruptible(&dmm->engines[i].wait_for_refill);
146 146
147 if (dmm->engines[i].async) 147 if (xchg(&dmm->engines[i].async, false))
148 release_engine(&dmm->engines[i]); 148 release_engine(&dmm->engines[i]);
149 } 149 }
150 150
@@ -277,7 +277,7 @@ static int dmm_txn_commit(struct dmm_txn *txn, bool wait)
277 } 277 }
278 278
279 /* mark whether it is async to denote list management in IRQ handler */ 279 /* mark whether it is async to denote list management in IRQ handler */
280 engine->async = wait ? false : true; 280 (void)xchg(&engine->async, wait ? false : true);
281 281
282 /* kick reload */ 282 /* kick reload */
283 writel(engine->refill_pa, 283 writel(engine->refill_pa,
diff --git a/drivers/gpu/drm/omapdrm/omap_gem.c b/drivers/gpu/drm/omapdrm/omap_gem.c
index 0a5b97836a81..f86e542b1860 100644
--- a/drivers/gpu/drm/omapdrm/omap_gem.c
+++ b/drivers/gpu/drm/omapdrm/omap_gem.c
@@ -1067,6 +1067,11 @@ void omap_gem_describe_objects(struct list_head *list, struct seq_file *m)
1067/* Buffer Synchronization: 1067/* Buffer Synchronization:
1068 */ 1068 */
1069 1069
1070enum added_by_func {
1071 ADDED_BY_OP_SYNC,
1072 ADDED_BY_OP_ASYNC
1073};
1074
1070struct omap_gem_sync_waiter { 1075struct omap_gem_sync_waiter {
1071 struct list_head list; 1076 struct list_head list;
1072 struct omap_gem_object *omap_obj; 1077 struct omap_gem_object *omap_obj;
@@ -1075,6 +1080,8 @@ struct omap_gem_sync_waiter {
1075 /* notify called w/ sync_lock held */ 1080 /* notify called w/ sync_lock held */
1076 void (*notify)(void *arg); 1081 void (*notify)(void *arg);
1077 void *arg; 1082 void *arg;
1083 struct work_struct notifier;
1084 enum added_by_func added_by;
1078}; 1085};
1079 1086
1080/* list of omap_gem_sync_waiter.. the notify fxn gets called back when 1087/* list of omap_gem_sync_waiter.. the notify fxn gets called back when
@@ -1106,13 +1113,25 @@ static inline bool is_waiting(struct omap_gem_sync_waiter *waiter)
1106 1113
1107static void sync_op_update(void) 1114static void sync_op_update(void)
1108{ 1115{
1116 struct omap_gem_object *omap_obj;
1117 struct drm_gem_object *drm_obj;
1118 struct drm_device *dev;
1119
1109 struct omap_gem_sync_waiter *waiter, *n; 1120 struct omap_gem_sync_waiter *waiter, *n;
1110 list_for_each_entry_safe(waiter, n, &waiters, list) { 1121 list_for_each_entry_safe(waiter, n, &waiters, list) {
1111 if (!is_waiting(waiter)) { 1122 if (!is_waiting(waiter)) {
1112 list_del(&waiter->list); 1123 list_del(&waiter->list);
1113 SYNC("notify: %p", waiter); 1124 SYNC("notify: %p", waiter);
1114 waiter->notify(waiter->arg); 1125 /* This is where we push the notify part to worker
1115 kfree(waiter); 1126 * thread. That way, we dont end up in a spinlock
1127 * recursion.
1128 */
1129 omap_obj = waiter->omap_obj;
1130 drm_obj = &omap_obj->base;
1131 dev = drm_obj->dev;
1132 queue_work(
1133 ((struct omap_drm_private *)dev->dev_private)->wq,
1134 &waiter->notifier);
1116 } 1135 }
1117 } 1136 }
1118} 1137}
@@ -1189,6 +1208,24 @@ static void sync_notify(void *arg)
1189 wake_up_all(&sync_event); 1208 wake_up_all(&sync_event);
1190} 1209}
1191 1210
1211void notify_worker(struct work_struct *work)
1212{
1213 /*here we do the actual notify work*/
1214 struct omap_gem_sync_waiter *waiter = container_of(work,
1215 struct omap_gem_sync_waiter, notifier);
1216 waiter->notify(waiter->arg);
1217 spin_lock(&sync_lock);
1218 /* This check is required as op_sync is gonna wait
1219 * for this notify completion and delete the waiter
1220 * itself. For op_async, we can safely delete it,
1221 * as it has been removed from list in update
1222 */
1223 if (waiter->added_by == ADDED_BY_OP_ASYNC)
1224 kfree(waiter);
1225 spin_unlock(&sync_lock);
1226
1227}
1228
1192int omap_gem_op_sync(struct drm_gem_object *obj, enum omap_gem_op op) 1229int omap_gem_op_sync(struct drm_gem_object *obj, enum omap_gem_op op)
1193{ 1230{
1194 struct omap_gem_object *omap_obj = to_omap_bo(obj); 1231 struct omap_gem_object *omap_obj = to_omap_bo(obj);
@@ -1207,6 +1244,8 @@ int omap_gem_op_sync(struct drm_gem_object *obj, enum omap_gem_op op)
1207 waiter->write_target = omap_obj->sync->write_pending; 1244 waiter->write_target = omap_obj->sync->write_pending;
1208 waiter->notify = sync_notify; 1245 waiter->notify = sync_notify;
1209 waiter->arg = &waiter_task; 1246 waiter->arg = &waiter_task;
1247 INIT_WORK(&waiter->notifier, notify_worker);
1248 waiter->added_by = ADDED_BY_OP_SYNC;
1210 1249
1211 spin_lock(&sync_lock); 1250 spin_lock(&sync_lock);
1212 if (is_waiting(waiter)) { 1251 if (is_waiting(waiter)) {
@@ -1261,6 +1300,8 @@ int omap_gem_op_async(struct drm_gem_object *obj, enum omap_gem_op op,
1261 waiter->write_target = omap_obj->sync->write_pending; 1300 waiter->write_target = omap_obj->sync->write_pending;
1262 waiter->notify = fxn; 1301 waiter->notify = fxn;
1263 waiter->arg = arg; 1302 waiter->arg = arg;
1303 INIT_WORK(&waiter->notifier, notify_worker);
1304 waiter->added_by = ADDED_BY_OP_ASYNC;
1264 1305
1265 spin_lock(&sync_lock); 1306 spin_lock(&sync_lock);
1266 if (is_waiting(waiter)) { 1307 if (is_waiting(waiter)) {
@@ -1276,6 +1317,7 @@ int omap_gem_op_async(struct drm_gem_object *obj, enum omap_gem_op op,
1276 * also, if added, the function will return, so this part is 1317 * also, if added, the function will return, so this part is
1277 * not reached. 1318 * not reached.
1278 */ 1319 */
1320
1279 kfree(waiter); 1321 kfree(waiter);
1280 1322
1281 spin_unlock(&sync_lock); 1323 spin_unlock(&sync_lock);
diff --git a/drivers/gpu/drm/omapdrm/omap_plane.c b/drivers/gpu/drm/omapdrm/omap_plane.c
index 5752952310da..83e5f06746a1 100644
--- a/drivers/gpu/drm/omapdrm/omap_plane.c
+++ b/drivers/gpu/drm/omapdrm/omap_plane.c
@@ -122,6 +122,7 @@ static void omap_plane_pre_apply(struct omap_drm_apply *apply)
122 enum omap_channel channel; 122 enum omap_channel channel;
123 bool enabled = omap_plane->enabled && crtc; 123 bool enabled = omap_plane->enabled && crtc;
124 bool ilace, replication; 124 bool ilace, replication;
125 u32 low, high;
125 int ret; 126 int ret;
126 127
127 DBG("%s, enabled=%d", omap_plane->name, enabled); 128 DBG("%s, enabled=%d", omap_plane->name, enabled);
@@ -149,6 +150,10 @@ static void omap_plane_pre_apply(struct omap_drm_apply *apply)
149 ilace = false; 150 ilace = false;
150 replication = false; 151 replication = false;
151 152
153 dispc_ovl_compute_fifo_thresholds(omap_plane->id, &low, &high,
154 false, false);
155 dispc_ovl_set_fifo_threshold(omap_plane->id, low, high);
156
152 /* and finally, update omapdss: */ 157 /* and finally, update omapdss: */
153 ret = dispc_ovl_setup(omap_plane->id, info, 158 ret = dispc_ovl_setup(omap_plane->id, info,
154 replication, omap_crtc_timings(crtc), false); 159 replication, omap_crtc_timings(crtc), false);
diff --git a/drivers/media/i2c/ov1063x.c b/drivers/media/i2c/ov1063x.c
index 51398a6aae10..8fb028520764 100644
--- a/drivers/media/i2c/ov1063x.c
+++ b/drivers/media/i2c/ov1063x.c
@@ -1629,10 +1629,10 @@ static int ov1063x_init_sensor(struct i2c_client *client)
1629 ret = ov1063x_set_gpios(client, X, 1, 1, 0, 0, 0, 1); 1629 ret = ov1063x_set_gpios(client, X, 1, 1, 0, 0, 0, 1);
1630 break; 1630 break;
1631 case VIS_SERDES: 1631 case VIS_SERDES:
1632 if (client->addr == 0x38 || client->addr == 0x3a || client->addr == 0x3b) 1632 if (client->addr == 0x39)
1633 ret = ov1063x_set_gpios(client, X, 1, X, X, 0, 1, 1);
1634 else if (client->addr == 0x39)
1635 ret = ov1063x_set_gpios(client, 0, 1, X, X, X, X, 1); 1633 ret = ov1063x_set_gpios(client, 0, 1, X, X, X, X, 1);
1634 else
1635 ret = ov1063x_set_gpios(client, X, 1, X, X, 0, 1, 1);
1636 break; 1636 break;
1637 case VIS_LI: 1637 case VIS_LI:
1638 ret = ov1063x_set_gpios(client, X, 1, 0, 0, 1, 0, 1); 1638 ret = ov1063x_set_gpios(client, X, 1, 0, 0, 1, 0, 1);
diff --git a/drivers/media/i2c/tvp5158.c b/drivers/media/i2c/tvp5158.c
index 674fefa367ca..ff74a3365be3 100644
--- a/drivers/media/i2c/tvp5158.c
+++ b/drivers/media/i2c/tvp5158.c
@@ -336,8 +336,6 @@ static int tvp5158_g_parm(struct v4l2_subdev *sd, struct v4l2_streamparm *parms)
336 if (parms->type != V4L2_BUF_TYPE_VIDEO_CAPTURE) 336 if (parms->type != V4L2_BUF_TYPE_VIDEO_CAPTURE)
337 /* only capture is supported */ 337 /* only capture is supported */
338 return -EINVAL; 338 return -EINVAL;
339 tvp5158_set_default(client, TVP_DECODER_1);
340 tvp5158_get_video_std(client, TVP_DECODER_1);
341 if (priv->current_std == STD_INVALID) 339 if (priv->current_std == STD_INVALID)
342 return -EINVAL; 340 return -EINVAL;
343 /* get the current standard */ 341 /* get the current standard */
@@ -403,9 +401,6 @@ static int tvp5158_g_fmt(struct v4l2_subdev *sd,
403 struct tvp5158_priv *priv = to_tvp5158(client); 401 struct tvp5158_priv *priv = to_tvp5158(client);
404 enum tvp5158_std current_std; 402 enum tvp5158_std current_std;
405 403
406 tvp5158_set_default(client, TVP_DECODER_1);
407 tvp5158_get_video_std(client, TVP_DECODER_1);
408
409 if (priv->current_std == STD_INVALID) 404 if (priv->current_std == STD_INVALID)
410 return -EINVAL; 405 return -EINVAL;
411 /* Calculate height and width based on current standard */ 406 /* Calculate height and width based on current standard */
@@ -635,14 +630,29 @@ static int tvp5158_probe(struct i2c_client *client,
635 tvp5158_write(client, REG_DEC_WR_EN, TVP_DECODER_1); 630 tvp5158_write(client, REG_DEC_WR_EN, TVP_DECODER_1);
636 tvp5158_write(client, REG_OFM_CTRL, 631 tvp5158_write(client, REG_OFM_CTRL,
637 (TVP_VIDEO_PORT_ENABLE | TVP_OUT_CLK_P_EN)); 632 (TVP_VIDEO_PORT_ENABLE | TVP_OUT_CLK_P_EN));
638 /* V4l2 asyn subdev register */ 633 } else {
639 sd->dev = &client->dev; 634 dev_err(&client->dev, "ERROR: Chip id is not TVP5158");
640 ret = v4l2_async_register_subdev(sd); 635 return -ENODEV;
641 if (!ret) 636 }
642 v4l2_info(&priv->subdev, "Camera sensor driver registered\n"); 637
643 pm_runtime_enable(&client->dev); 638 tvp5158_set_default(client, TVP_DECODER_1);
639 tvp5158_get_video_std(client, TVP_DECODER_1);
640
641 if (priv->signal_present != TVP5158_SIGNAL_PRESENT) {
642 dev_err(&client->dev, "Camera not connected");
643 return -ENODEV;
644 } 644 }
645 645
646 /* V4l2 asyn subdev register */
647 sd->dev = &client->dev;
648 ret = v4l2_async_register_subdev(sd);
649 if (!ret)
650 v4l2_info(&priv->subdev, "Camera sensor driver registered\n");
651 else
652 return ret;
653
654 pm_runtime_enable(&client->dev);
655
646 return ret; 656 return ret;
647} 657}
648 658
diff --git a/drivers/media/platform/ti-vps/vip.c b/drivers/media/platform/ti-vps/vip.c
index c6a46c4d76b8..648baceb3cfa 100644
--- a/drivers/media/platform/ti-vps/vip.c
+++ b/drivers/media/platform/ti-vps/vip.c
@@ -755,6 +755,7 @@ static int add_out_dtd(struct vip_stream *stream, int srce_type)
755 struct vb2_buffer *vb = &stream->cur_buf->vb; 755 struct vb2_buffer *vb = &stream->cur_buf->vb;
756 struct v4l2_rect *c_rect = &port->c_rect; 756 struct v4l2_rect *c_rect = &port->c_rect;
757 struct vip_fmt *fmt = port->fmt; 757 struct vip_fmt *fmt = port->fmt;
758 struct vpdma_dtd *dtd;
758 int channel, plane = 0; 759 int channel, plane = 0;
759 dma_addr_t dma_addr; 760 dma_addr_t dma_addr;
760 u32 flags; 761 u32 flags;
@@ -794,10 +795,31 @@ static int add_out_dtd(struct vip_stream *stream, int srce_type)
794 return -1; 795 return -1;
795 } 796 }
796 797
797 vpdma_vip_set_max_size(dev->shared->vpdma, 1);
798 vpdma_add_out_dtd(&dev->desc_list, c_rect->width, 798 vpdma_add_out_dtd(&dev->desc_list, c_rect->width,
799 fmt->vpdma_fmt[plane], dma_addr, channel, flags); 799 fmt->vpdma_fmt[plane], dma_addr, channel, flags);
800 800
801 /*
802 * add_out_dtd sets the max WIDTH and HEIGHT to be 1920x1080
803 * Change this later so that max WIDTH and HEIGHT are taken from
804 * VPDMA_MAX_SIZE1 or VPDMA_MAX_SIZE2 register
805 * This allows to use different sets for different slices
806 */
807
808 dtd = dev->desc_list.buf.addr;
809 if (dev->slice_id == VIP_SLICE1) {
810 vpdma_set_max_size(dev->shared->vpdma, VPDMA_MAX_SIZE1,
811 stream->width, stream->height);
812
813 dtd_set_max_width_height(dtd,
814 MAX_OUT_WIDTH_REG1, MAX_OUT_HEIGHT_REG1);
815 } else {
816 vpdma_set_max_size(dev->shared->vpdma, VPDMA_MAX_SIZE2,
817 stream->width, stream->height);
818
819 dtd_set_max_width_height(dtd,
820 MAX_OUT_WIDTH_REG2, MAX_OUT_HEIGHT_REG2);
821 }
822
801 return 0; 823 return 0;
802} 824}
803 825
@@ -1038,6 +1060,62 @@ static int vip_enuminput(struct file *file, void *priv,
1038 return 0; 1060 return 0;
1039} 1061}
1040 1062
1063static int vip_g_input(struct file *file, void *priv, unsigned int *i)
1064{
1065 *i = 0;
1066 return 0;
1067}
1068
1069static int vip_s_input(struct file *file, void *priv, unsigned int i)
1070{
1071 if (i != 0)
1072 return -EINVAL;
1073 return 0;
1074}
1075
1076static int vip_querystd(struct file *file, void *fh, v4l2_std_id *std)
1077{
1078 struct vip_stream *stream = file2stream(file);
1079 struct vip_dev *dev = stream->port->dev;
1080
1081 v4l2_subdev_call(dev->sensor, video, querystd, std);
1082 return 0;
1083}
1084
1085static int vip_g_std(struct file *file, void *fh, v4l2_std_id *std)
1086{
1087 struct vip_stream *stream = file2stream(file);
1088 struct vip_dev *dev = stream->port->dev;
1089
1090 *std = 0;
1091 v4l2_subdev_call(dev->sensor, video, g_std_output, std);
1092 return 0;
1093}
1094
1095static int vip_s_std(struct file *file, void *fh, v4l2_std_id *std)
1096{
1097 struct vip_stream *stream = file2stream(file);
1098 struct vip_dev *dev = stream->port->dev;
1099
1100 v4l2_subdev_call(dev->sensor, video, s_std_output, *std);
1101 return 0;
1102}
1103
1104static int vip_queryctrl(struct file *file, void *fh, struct v4l2_queryctrl *a)
1105{
1106 return 0;
1107}
1108
1109static int vip_g_ctrl(struct file *file, void *fh, struct v4l2_control *a)
1110{
1111 return 0;
1112}
1113
1114static int vip_s_ctrl(struct file *file, void *fh, struct v4l2_control *a)
1115{
1116 return 0;
1117}
1118
1041static int vip_enum_fmt_vid_cap(struct file *file, void *priv, 1119static int vip_enum_fmt_vid_cap(struct file *file, void *priv,
1042 struct v4l2_fmtdesc *f) 1120 struct v4l2_fmtdesc *f)
1043{ 1121{
@@ -1319,6 +1397,16 @@ static long vip_ioctl_default(struct file *file, void *fh, bool valid_prio,
1319static const struct v4l2_ioctl_ops vip_ioctl_ops = { 1397static const struct v4l2_ioctl_ops vip_ioctl_ops = {
1320 .vidioc_querycap = vip_querycap, 1398 .vidioc_querycap = vip_querycap,
1321 .vidioc_enum_input = vip_enuminput, 1399 .vidioc_enum_input = vip_enuminput,
1400 .vidioc_g_input = vip_g_input,
1401 .vidioc_s_input = vip_s_input,
1402
1403 .vidioc_querystd = vip_querystd,
1404 .vidioc_g_std = vip_g_std,
1405 .vidioc_s_std = vip_s_std,
1406
1407 .vidioc_queryctrl = vip_queryctrl,
1408 .vidioc_g_ctrl = vip_g_ctrl,
1409 .vidioc_s_ctrl = vip_s_ctrl,
1322 1410
1323 .vidioc_enum_fmt_vid_cap = vip_enum_fmt_vid_cap, 1411 .vidioc_enum_fmt_vid_cap = vip_enum_fmt_vid_cap,
1324 .vidioc_g_fmt_vid_cap = vip_g_fmt_vid_cap, 1412 .vidioc_g_fmt_vid_cap = vip_g_fmt_vid_cap,
@@ -1379,7 +1467,6 @@ static int vip_buf_prepare(struct vb2_buffer *vb)
1379 return -EINVAL; 1467 return -EINVAL;
1380 } 1468 }
1381 1469
1382 mdelay(33);
1383 vb2_set_plane_payload(vb, 0, stream->sizeimage); 1470 vb2_set_plane_payload(vb, 0, stream->sizeimage);
1384 1471
1385 return 0; 1472 return 0;
@@ -1808,13 +1895,21 @@ static int alloc_stream(struct vip_port *port, int stream_id, int vfl_type)
1808 *vfd = vip_videodev; 1895 *vfd = vip_videodev;
1809 vfd->v4l2_dev = &dev->v4l2_dev; 1896 vfd->v4l2_dev = &dev->v4l2_dev;
1810 vfd->queue = q; 1897 vfd->queue = q;
1811 vfd->num = -1;
1812 1898
1813 vfd->lock = &dev->mutex; 1899 vfd->lock = &dev->mutex;
1814 video_set_drvdata(vfd, stream); 1900 video_set_drvdata(vfd, stream);
1815 1901
1902 ret = video_register_device(vfd, vfl_type, -1);
1903 if (ret) {
1904 v4l2_err(&dev->v4l2_dev, "Failed to register video device\n");
1905 goto do_free_stream;
1906 }
1907
1908 snprintf(vfd->name, sizeof(vfd->name), "%s", vip_videodev.name);
1816 stream->vfd = vfd; 1909 stream->vfd = vfd;
1817 1910
1911 v4l2_info(&dev->v4l2_dev, VIP_MODULE_NAME
1912 " Device registered as /dev/video%d\n", vfd->num);
1818 return 0; 1913 return 0;
1819 1914
1820do_free_stream: 1915do_free_stream:
@@ -1973,8 +2068,6 @@ static int vip_async_bound(struct v4l2_async_notifier *notifier,
1973{ 2068{
1974 struct vip_dev *dev = notifier_to_vip_dev(notifier); 2069 struct vip_dev *dev = notifier_to_vip_dev(notifier);
1975 unsigned int idx = asd - &dev->config->asd[0]; 2070 unsigned int idx = asd - &dev->config->asd[0];
1976 struct video_device *vfd;
1977 int ret;
1978 2071
1979 if (idx > dev->config->asd_sizes) 2072 if (idx > dev->config->asd_sizes)
1980 return -EINVAL; 2073 return -EINVAL;
@@ -1989,22 +2082,8 @@ static int vip_async_bound(struct v4l2_async_notifier *notifier,
1989 asd->match.i2c.address); 2082 asd->match.i2c.address);
1990 return 0; 2083 return 0;
1991 } 2084 }
1992 } 2085 } else
1993 2086 alloc_port(dev, 0);
1994 vfd = dev->ports[0]->cap_streams[0]->vfd;
1995 if (((u16)-1) == vfd->num) {
1996 ret = video_register_device(vfd, VFL_TYPE_GRABBER, -1);
1997 if (ret) {
1998 v4l2_err(&dev->v4l2_dev, "Failed to register video device\n");
1999 return 0;
2000 }
2001
2002 snprintf(vfd->name, sizeof(vfd->name), "%s", vip_videodev.name);
2003
2004 v4l2_info(&dev->v4l2_dev, VIP_MODULE_NAME
2005 " Device registered as /dev/video%d\n",
2006 vfd->num);
2007 }
2008 2087
2009 dev->sensor = subdev; 2088 dev->sensor = subdev;
2010 dev->endpoint = &dev->config->endpoints[idx]; 2089 dev->endpoint = &dev->config->endpoints[idx];
@@ -2172,8 +2251,6 @@ static int vip_probe(struct platform_device *pdev)
2172 dev->res = res; 2251 dev->res = res;
2173 dev->base = base; 2252 dev->base = base;
2174 2253
2175 ret = alloc_port(dev, 0);
2176
2177 if (dev->pdev->dev.of_node) { 2254 if (dev->pdev->dev.of_node) {
2178 ret = vip_of_probe(pdev, dev); 2255 ret = vip_of_probe(pdev, dev);
2179 if (ret) 2256 if (ret)
diff --git a/drivers/media/platform/ti-vps/vpdma.c b/drivers/media/platform/ti-vps/vpdma.c
index 3105cdf06b10..d8252d268563 100644
--- a/drivers/media/platform/ti-vps/vpdma.c
+++ b/drivers/media/platform/ti-vps/vpdma.c
@@ -471,17 +471,24 @@ void vpdma_update_dma_addr(struct vpdma_data *vpdma,
471} 471}
472EXPORT_SYMBOL(vpdma_update_dma_addr); 472EXPORT_SYMBOL(vpdma_update_dma_addr);
473 473
474void vpdma_vip_set_max_size(struct vpdma_data *vpdma, int vip_num) 474void vpdma_set_max_size(struct vpdma_data *vpdma, int reg_addr,
475 u32 width, u32 height)
475{ 476{
476 u32 val = 0; 477 u32 val = 0;
477 478
478 if (vip_num == 1) { 479 insert_field(&val, width - 1 ,
479 insert_field(&val, 1919, VPDMA_MAX_SIZE_WIDTH_MASK, VPDMA_MAX_SIZE_WIDTH_SHFT); 480 VPDMA_MAX_SIZE_WIDTH_MASK, VPDMA_MAX_SIZE_WIDTH_SHFT);
480 insert_field(&val, 1079, VPDMA_MAX_SIZE_HEIGHT_MASK, VPDMA_MAX_SIZE_HEIGHT_SHFT); 481
481 write_reg(vpdma, VPDMA_MAX_SIZE1, val); 482 insert_field(&val, height - 1 ,
482 } 483 VPDMA_MAX_SIZE_HEIGHT_MASK, VPDMA_MAX_SIZE_HEIGHT_SHFT);
484
485 if (reg_addr != VPDMA_MAX_SIZE1 || reg_addr != VPDMA_MAX_SIZE2
486 || reg_addr != VPDMA_MAX_SIZE3)
487 reg_addr = VPDMA_MAX_SIZE1;
488
489 write_reg(vpdma, reg_addr, val);
483} 490}
484EXPORT_SYMBOL(vpdma_vip_set_max_size); 491EXPORT_SYMBOL(vpdma_set_max_size);
485 492
486#ifdef VPDMA_DEBUG 493#ifdef VPDMA_DEBUG
487static void dump_cfd(struct vpdma_cfd *cfd) 494static void dump_cfd(struct vpdma_cfd *cfd)
diff --git a/drivers/media/platform/ti-vps/vpdma.h b/drivers/media/platform/ti-vps/vpdma.h
index 9f0c1b086e09..657d8a842a52 100644
--- a/drivers/media/platform/ti-vps/vpdma.h
+++ b/drivers/media/platform/ti-vps/vpdma.h
@@ -193,7 +193,8 @@ void vpdma_update_dma_addr(struct vpdma_data *vpdma,
193 struct vpdma_desc_list *list, dma_addr_t dma_addr, int drop); 193 struct vpdma_desc_list *list, dma_addr_t dma_addr, int drop);
194 194
195void vpdma_enable_channel_3_irq(struct vpdma_data *vpdma, bool enable); 195void vpdma_enable_channel_3_irq(struct vpdma_data *vpdma, bool enable);
196void vpdma_vip_set_max_size(struct vpdma_data *vpdma, int vip_num); 196void vpdma_set_max_size(struct vpdma_data *vpdma, int reg_addr,
197 u32 width, u32 height);
197 198
198 199
199void vpdma_enable_list_complete_irq(struct vpdma_data *vpdma, int irq_num, 200void vpdma_enable_list_complete_irq(struct vpdma_data *vpdma, int irq_num,
diff --git a/drivers/media/platform/ti-vps/vpe.c b/drivers/media/platform/ti-vps/vpe.c
index 238c984621ab..2833f82f6b41 100644
--- a/drivers/media/platform/ti-vps/vpe.c
+++ b/drivers/media/platform/ti-vps/vpe.c
@@ -51,8 +51,8 @@
51/* minimum and maximum frame sizes */ 51/* minimum and maximum frame sizes */
52#define MIN_W 128 52#define MIN_W 128
53#define MIN_H 128 53#define MIN_H 128
54#define MAX_W 1920 54#define MAX_W 2048
55#define MAX_H 1080 55#define MAX_H 1184
56 56
57/* required alignments */ 57/* required alignments */
58#define S_ALIGN 0 /* multiple of 1 */ 58#define S_ALIGN 0 /* multiple of 1 */
@@ -318,9 +318,13 @@ struct vpe_q_data {
318}; 318};
319 319
320/* vpe_q_data flag bits */ 320/* vpe_q_data flag bits */
321#define Q_DATA_FRAME_1D (1 << 0) 321#define Q_DATA_FRAME_1D (1 << 0)
322#define Q_DATA_MODE_TILED (1 << 1) 322#define Q_DATA_MODE_TILED (1 << 1)
323#define Q_DATA_INTERLACED (1 << 2) 323#define Q_DATA_INTERLACED_ALTERNATE (1 << 2)
324#define Q_DATA_INTERLACED_SEQ_TB (1 << 3)
325
326#define Q_IS_INTERLACED (Q_DATA_INTERLACED_ALTERNATE |\
327 Q_DATA_INTERLACED_SEQ_TB)
324 328
325enum { 329enum {
326 Q_DATA_SRC = 0, 330 Q_DATA_SRC = 0,
@@ -419,7 +423,7 @@ static struct vpe_q_data *get_q_data(struct vpe_ctx *ctx,
419 case V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE: 423 case V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE:
420 return &ctx->q_data[Q_DATA_DST]; 424 return &ctx->q_data[Q_DATA_DST];
421 default: 425 default:
422 BUG(); 426 return NULL;
423 } 427 }
424 return NULL; 428 return NULL;
425} 429}
@@ -498,6 +502,14 @@ struct vpe_mmr_adb {
498 502
499#define VPE_SET_MMR_ADB_HDR(ctx, hdr, regs, offset_a) \ 503#define VPE_SET_MMR_ADB_HDR(ctx, hdr, regs, offset_a) \
500 VPDMA_SET_MMR_ADB_HDR(ctx->mmr_adb, vpe_mmr_adb, hdr, regs, offset_a) 504 VPDMA_SET_MMR_ADB_HDR(ctx->mmr_adb, vpe_mmr_adb, hdr, regs, offset_a)
505
506static inline dma_addr_t vb2_dma_addr_plus_data_offset(struct vb2_buffer *vb,
507 unsigned int plane_no)
508{
509 return vb2_dma_contig_plane_dma_addr(vb, plane_no) +
510 vb->v4l2_planes[plane_no].data_offset;
511}
512
501/* 513/*
502 * Set the headers for all of the address/data block structures. 514 * Set the headers for all of the address/data block structures.
503 */ 515 */
@@ -579,16 +591,29 @@ static void free_mv_buffers(struct vpe_ctx *ctx)
579static void free_vbs(struct vpe_ctx *ctx) 591static void free_vbs(struct vpe_ctx *ctx)
580{ 592{
581 struct vpe_dev *dev = ctx->dev; 593 struct vpe_dev *dev = ctx->dev;
594 struct vpe_q_data *s_q_data = &ctx->q_data[Q_DATA_SRC];
582 unsigned long flags; 595 unsigned long flags;
583 596
584 if (ctx->src_vbs[2] == NULL) 597 if (s_q_data->flags & Q_DATA_INTERLACED_ALTERNATE) {
585 return; 598 if (ctx->src_vbs[2] == NULL)
599 return;
600 } else {
601 if (ctx->src_vbs[1] == NULL)
602 return;
603 }
586 604
587 spin_lock_irqsave(&dev->lock, flags); 605 spin_lock_irqsave(&dev->lock, flags);
588 if (ctx->src_vbs[2]) { 606
589 v4l2_m2m_buf_done(ctx->src_vbs[2], VB2_BUF_STATE_DONE); 607 if (s_q_data->flags & Q_DATA_INTERLACED_ALTERNATE) {
590 v4l2_m2m_buf_done(ctx->src_vbs[1], VB2_BUF_STATE_DONE); 608 if (ctx->src_vbs[2]) {
609 v4l2_m2m_buf_done(ctx->src_vbs[2], VB2_BUF_STATE_DONE);
610 v4l2_m2m_buf_done(ctx->src_vbs[1], VB2_BUF_STATE_DONE);
611 }
612 } else {
613 if (ctx->src_vbs[1])
614 v4l2_m2m_buf_done(ctx->src_vbs[1], VB2_BUF_STATE_DONE);
591 } 615 }
616
592 spin_unlock_irqrestore(&dev->lock, flags); 617 spin_unlock_irqrestore(&dev->lock, flags);
593} 618}
594 619
@@ -641,7 +666,7 @@ static void set_us_coefficients(struct vpe_ctx *ctx)
641 666
642 cp = &us_coeffs[0].anchor_fid0_c0; 667 cp = &us_coeffs[0].anchor_fid0_c0;
643 668
644 if (s_q_data->flags & Q_DATA_INTERLACED) /* interlaced */ 669 if (s_q_data->flags & Q_IS_INTERLACED) /* interlaced */
645 cp += sizeof(us_coeffs[0]) / sizeof(*cp); 670 cp += sizeof(us_coeffs[0]) / sizeof(*cp);
646 671
647 end_cp = cp + sizeof(us_coeffs[0]) / sizeof(*cp); 672 end_cp = cp + sizeof(us_coeffs[0]) / sizeof(*cp);
@@ -768,8 +793,8 @@ static void set_dei_regs(struct vpe_ctx *ctx)
768 * for both progressive and interlace content in interlace bypass mode. 793 * for both progressive and interlace content in interlace bypass mode.
769 * It has been recommended not to use progressive bypass mode. 794 * It has been recommended not to use progressive bypass mode.
770 */ 795 */
771 if ((!ctx->deinterlacing && (s_q_data->flags & Q_DATA_INTERLACED)) || 796 if ((!ctx->deinterlacing && (s_q_data->flags & Q_IS_INTERLACED)) ||
772 !(s_q_data->flags & Q_DATA_INTERLACED)) { 797 !(s_q_data->flags & Q_IS_INTERLACED)) {
773 deinterlace = false; 798 deinterlace = false;
774 val = VPE_DEI_INTERLACE_BYPASS; 799 val = VPE_DEI_INTERLACE_BYPASS;
775 } 800 }
@@ -804,8 +829,8 @@ static int set_srcdst_params(struct vpe_ctx *ctx)
804 ctx->sequence = 0; 829 ctx->sequence = 0;
805 ctx->field = V4L2_FIELD_TOP; 830 ctx->field = V4L2_FIELD_TOP;
806 831
807 if ((s_q_data->flags & Q_DATA_INTERLACED) && 832 if ((s_q_data->flags & Q_IS_INTERLACED) &&
808 !(d_q_data->flags & Q_DATA_INTERLACED)) { 833 !(d_q_data->flags & Q_IS_INTERLACED)) {
809 int bytes_per_line; 834 int bytes_per_line;
810 const struct vpdma_data_format *mv = 835 const struct vpdma_data_format *mv =
811 &vpdma_misc_fmts[VPDMA_DATA_FMT_MV]; 836 &vpdma_misc_fmts[VPDMA_DATA_FMT_MV];
@@ -868,10 +893,23 @@ static struct vpe_ctx *file2ctx(struct file *file)
868static int job_ready(void *priv) 893static int job_ready(void *priv)
869{ 894{
870 struct vpe_ctx *ctx = priv; 895 struct vpe_ctx *ctx = priv;
896 struct vpe_q_data *s_q_data = &ctx->q_data[Q_DATA_SRC];
871 int needed = ctx->bufs_per_job; 897 int needed = ctx->bufs_per_job;
872 898
873 if (ctx->deinterlacing && ctx->src_vbs[2] == NULL) 899 if (ctx->deinterlacing) {
874 needed += 2; /* need additional two most recent fields */ 900
901 if ((s_q_data->flags & Q_DATA_INTERLACED_ALTERNATE) &&
902 ctx->src_vbs[2] == NULL)
903 /* need additional two most recent fields */
904 needed += 2;
905 else if ((s_q_data->flags & Q_DATA_INTERLACED_SEQ_TB) &&
906 ctx->src_vbs[1] == NULL)
907 /*
908 * need additional two most recent fields, which are in
909 * one buffer
910 */
911 needed += 1;
912 }
875 913
876 if (v4l2_m2m_num_src_bufs_ready(ctx->m2m_ctx) < needed) 914 if (v4l2_m2m_num_src_bufs_ready(ctx->m2m_ctx) < needed)
877 return 0; 915 return 0;
@@ -986,7 +1024,7 @@ static void add_out_dtd(struct vpe_ctx *ctx, int port)
986 int plane = fmt->coplanar ? p_data->vb_part : 0; 1024 int plane = fmt->coplanar ? p_data->vb_part : 0;
987 1025
988 vpdma_fmt = fmt->vpdma_fmt[plane]; 1026 vpdma_fmt = fmt->vpdma_fmt[plane];
989 dma_addr = vb2_dma_contig_plane_dma_addr(vb, plane); 1027 dma_addr = vb2_dma_addr_plus_data_offset(vb, plane);
990 if (!dma_addr) { 1028 if (!dma_addr) {
991 vpe_err(ctx->dev, 1029 vpe_err(ctx->dev,
992 "acquiring output buffer(%d) dma_addr failed\n", 1030 "acquiring output buffer(%d) dma_addr failed\n",
@@ -1008,11 +1046,10 @@ static void add_in_dtd(struct vpe_ctx *ctx, int port)
1008{ 1046{
1009 struct vpe_q_data *q_data = &ctx->q_data[Q_DATA_SRC]; 1047 struct vpe_q_data *q_data = &ctx->q_data[Q_DATA_SRC];
1010 const struct vpe_port_data *p_data = &port_data[port]; 1048 const struct vpe_port_data *p_data = &port_data[port];
1011 struct vb2_buffer *vb = ctx->src_vbs[p_data->vb_index];
1012 struct vpe_fmt *fmt = q_data->fmt; 1049 struct vpe_fmt *fmt = q_data->fmt;
1013 const struct vpdma_data_format *vpdma_fmt; 1050 const struct vpdma_data_format *vpdma_fmt;
1014 int mv_buf_selector = ctx->src_mv_buf_selector; 1051 int mv_buf_selector = ctx->src_mv_buf_selector;
1015 int field = vb->v4l2_buf.field == V4L2_FIELD_BOTTOM; 1052 int field = 0;
1016 int frame_width, frame_height; 1053 int frame_width, frame_height;
1017 dma_addr_t dma_addr; 1054 dma_addr_t dma_addr;
1018 u32 flags = 0; 1055 u32 flags = 0;
@@ -1023,10 +1060,58 @@ static void add_in_dtd(struct vpe_ctx *ctx, int port)
1023 } else { 1060 } else {
1024 /* to incorporate interleaved formats */ 1061 /* to incorporate interleaved formats */
1025 int plane = fmt->coplanar ? p_data->vb_part : 0; 1062 int plane = fmt->coplanar ? p_data->vb_part : 0;
1063 struct vb2_buffer *vb;
1026 1064
1027 vpdma_fmt = fmt->vpdma_fmt[plane]; 1065 vpdma_fmt = fmt->vpdma_fmt[plane];
1028 1066
1029 dma_addr = vb2_dma_contig_plane_dma_addr(vb, plane); 1067 if (q_data->flags & Q_DATA_INTERLACED_SEQ_TB) {
1068 bool tbt = ctx->sequence % 2 == 0;
1069 int field_id = p_data->vb_index;
1070 int bpp = fmt->fourcc == V4L2_PIX_FMT_NV12 ?
1071 1 : (vpdma_fmt->depth >> 3);
1072 int height = q_data->height / 2;
1073
1074 if (tbt) {
1075 if (field_id == 0) {
1076 /* f */
1077 vb = ctx->src_vbs[0];
1078 field = 0;
1079 } else if (field_id == 1) {
1080 /* f - 1 */
1081 vb = ctx->src_vbs[1];
1082 field = 1;
1083 } else {
1084 /* f - 2 */
1085 vb = ctx->src_vbs[1];
1086 field = 0;
1087 }
1088 } else {
1089 if (field_id == 0) {
1090 /* f */
1091 vb = ctx->src_vbs[0];
1092 field = 1;
1093 } else if (field_id == 1) {
1094 /* f - 1 */
1095 vb = ctx->src_vbs[0];
1096 field = 0;
1097 } else {
1098 /* f - 2 */
1099 vb = ctx->src_vbs[1];
1100 field = 1;
1101 }
1102 }
1103
1104 dma_addr = vb2_dma_addr_plus_data_offset(vb, plane);
1105
1106 if (plane)
1107 height /= 2;
1108
1109 dma_addr += field ? q_data->width * height * bpp : 0;
1110 } else {
1111 vb = ctx->src_vbs[p_data->vb_index];
1112 field = vb->v4l2_buf.field == V4L2_FIELD_BOTTOM;
1113 dma_addr = vb2_dma_addr_plus_data_offset(vb, plane);
1114 }
1030 if (!dma_addr) { 1115 if (!dma_addr) {
1031 vpe_err(ctx->dev, 1116 vpe_err(ctx->dev,
1032 "acquiring input buffer(%d) dma_addr failed\n", 1117 "acquiring input buffer(%d) dma_addr failed\n",
@@ -1081,16 +1166,35 @@ static void device_run(void *priv)
1081 struct vpe_ctx *ctx = priv; 1166 struct vpe_ctx *ctx = priv;
1082 struct sc_data *sc = ctx->dev->sc; 1167 struct sc_data *sc = ctx->dev->sc;
1083 struct vpe_q_data *d_q_data = &ctx->q_data[Q_DATA_DST]; 1168 struct vpe_q_data *d_q_data = &ctx->q_data[Q_DATA_DST];
1169 struct vpe_q_data *s_q_data = &ctx->q_data[Q_DATA_SRC];
1084 1170
1085 if (ctx->deinterlacing && ctx->src_vbs[2] == NULL) { 1171 if (ctx->deinterlacing) {
1086 ctx->src_vbs[2] = v4l2_m2m_src_buf_remove(ctx->m2m_ctx); 1172 if (s_q_data->flags & Q_DATA_INTERLACED_ALTERNATE) {
1087 WARN_ON(ctx->src_vbs[2] == NULL); 1173 if (ctx->src_vbs[2] == NULL) {
1088 ctx->src_vbs[1] = v4l2_m2m_src_buf_remove(ctx->m2m_ctx); 1174 ctx->src_vbs[2] =
1089 WARN_ON(ctx->src_vbs[1] == NULL); 1175 v4l2_m2m_src_buf_remove(ctx->m2m_ctx);
1176 WARN_ON(ctx->src_vbs[2] == NULL);
1177 ctx->src_vbs[1] =
1178 v4l2_m2m_src_buf_remove(ctx->m2m_ctx);
1179 WARN_ON(ctx->src_vbs[1] == NULL);
1180 }
1181 /* SEQ_TB */
1182 } else {
1183 if (ctx->src_vbs[1] == NULL) {
1184 ctx->src_vbs[1] =
1185 v4l2_m2m_src_buf_remove(ctx->m2m_ctx);
1186 WARN_ON(ctx->src_vbs[1] == NULL);
1187 }
1188 }
1189 }
1190
1191 if (!ctx->deinterlacing || ((s_q_data->flags &
1192 Q_DATA_INTERLACED_SEQ_TB) && (ctx->sequence % 2 == 0)) ||
1193 (s_q_data->flags & Q_DATA_INTERLACED_ALTERNATE)) {
1194 ctx->src_vbs[0] = v4l2_m2m_src_buf_remove(ctx->m2m_ctx);
1195 WARN_ON(ctx->src_vbs[0] == NULL);
1090 } 1196 }
1091 1197
1092 ctx->src_vbs[0] = v4l2_m2m_src_buf_remove(ctx->m2m_ctx);
1093 WARN_ON(ctx->src_vbs[0] == NULL);
1094 ctx->dst_vb = v4l2_m2m_dst_buf_remove(ctx->m2m_ctx); 1198 ctx->dst_vb = v4l2_m2m_dst_buf_remove(ctx->m2m_ctx);
1095 WARN_ON(ctx->dst_vb == NULL); 1199 WARN_ON(ctx->dst_vb == NULL);
1096 1200
@@ -1206,6 +1310,7 @@ static irqreturn_t vpe_irq(int irq_vpe, void *data)
1206 struct vpe_dev *dev = (struct vpe_dev *)data; 1310 struct vpe_dev *dev = (struct vpe_dev *)data;
1207 struct vpe_ctx *ctx; 1311 struct vpe_ctx *ctx;
1208 struct vpe_q_data *d_q_data; 1312 struct vpe_q_data *d_q_data;
1313 struct vpe_q_data *s_q_data;
1209 struct vb2_buffer *s_vb, *d_vb; 1314 struct vb2_buffer *s_vb, *d_vb;
1210 struct v4l2_buffer *s_buf, *d_buf; 1315 struct v4l2_buffer *s_buf, *d_buf;
1211 unsigned long flags; 1316 unsigned long flags;
@@ -1282,7 +1387,7 @@ static irqreturn_t vpe_irq(int irq_vpe, void *data)
1282 d_buf->field = ctx->field; 1387 d_buf->field = ctx->field;
1283 1388
1284 d_q_data = &ctx->q_data[Q_DATA_DST]; 1389 d_q_data = &ctx->q_data[Q_DATA_DST];
1285 if (d_q_data->flags & Q_DATA_INTERLACED) { 1390 if (d_q_data->flags & Q_IS_INTERLACED) {
1286 if (ctx->field == V4L2_FIELD_BOTTOM) { 1391 if (ctx->field == V4L2_FIELD_BOTTOM) {
1287 ctx->sequence++; 1392 ctx->sequence++;
1288 ctx->field = V4L2_FIELD_TOP; 1393 ctx->field = V4L2_FIELD_TOP;
@@ -1294,17 +1399,36 @@ static irqreturn_t vpe_irq(int irq_vpe, void *data)
1294 ctx->sequence++; 1399 ctx->sequence++;
1295 } 1400 }
1296 1401
1297 if (ctx->deinterlacing) 1402 s_q_data = &ctx->q_data[Q_DATA_SRC];
1298 s_vb = ctx->src_vbs[2]; 1403
1404 if (ctx->deinterlacing) {
1405 if (s_q_data->flags & Q_DATA_INTERLACED_ALTERNATE)
1406 s_vb = ctx->src_vbs[2];
1407 else
1408 s_vb = ctx->src_vbs[1];
1409 }
1299 1410
1300 spin_lock_irqsave(&dev->lock, flags); 1411 spin_lock_irqsave(&dev->lock, flags);
1301 v4l2_m2m_buf_done(s_vb, VB2_BUF_STATE_DONE); 1412
1413 if (s_q_data->flags & Q_DATA_INTERLACED_SEQ_TB) {
1414 if (((ctx->sequence % 2) == 0))
1415 v4l2_m2m_buf_done(s_vb, VB2_BUF_STATE_DONE);
1416 } else {
1417 v4l2_m2m_buf_done(s_vb, VB2_BUF_STATE_DONE);
1418 }
1419
1302 v4l2_m2m_buf_done(d_vb, VB2_BUF_STATE_DONE); 1420 v4l2_m2m_buf_done(d_vb, VB2_BUF_STATE_DONE);
1421
1303 spin_unlock_irqrestore(&dev->lock, flags); 1422 spin_unlock_irqrestore(&dev->lock, flags);
1304 1423
1305 if (ctx->deinterlacing) { 1424 if (ctx->deinterlacing) {
1306 ctx->src_vbs[2] = ctx->src_vbs[1]; 1425 if (s_q_data->flags & Q_DATA_INTERLACED_ALTERNATE) {
1307 ctx->src_vbs[1] = ctx->src_vbs[0]; 1426 ctx->src_vbs[2] = ctx->src_vbs[1];
1427 ctx->src_vbs[1] = ctx->src_vbs[0];
1428 } else {
1429 if (((ctx->sequence % 2) == 0))
1430 ctx->src_vbs[1] = ctx->src_vbs[0];
1431 }
1308 } 1432 }
1309 1433
1310 ctx->bufs_completed++; 1434 ctx->bufs_completed++;
@@ -1330,7 +1454,7 @@ static int vpe_querycap(struct file *file, void *priv,
1330 strncpy(cap->driver, VPE_MODULE_NAME, sizeof(cap->driver) - 1); 1454 strncpy(cap->driver, VPE_MODULE_NAME, sizeof(cap->driver) - 1);
1331 strncpy(cap->card, VPE_MODULE_NAME, sizeof(cap->card) - 1); 1455 strncpy(cap->card, VPE_MODULE_NAME, sizeof(cap->card) - 1);
1332 strlcpy(cap->bus_info, VPE_MODULE_NAME, sizeof(cap->bus_info)); 1456 strlcpy(cap->bus_info, VPE_MODULE_NAME, sizeof(cap->bus_info));
1333 cap->device_caps = V4L2_CAP_VIDEO_M2M | V4L2_CAP_STREAMING; 1457 cap->device_caps = V4L2_CAP_VIDEO_M2M_MPLANE | V4L2_CAP_STREAMING;
1334 cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS; 1458 cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS;
1335 return 0; 1459 return 0;
1336} 1460}
@@ -1403,7 +1527,7 @@ static int __vpe_try_fmt(struct vpe_ctx *ctx, struct v4l2_format *f,
1403 struct v4l2_pix_format_mplane *pix = &f->fmt.pix_mp; 1527 struct v4l2_pix_format_mplane *pix = &f->fmt.pix_mp;
1404 struct v4l2_plane_pix_format *plane_fmt; 1528 struct v4l2_plane_pix_format *plane_fmt;
1405 unsigned int w_align; 1529 unsigned int w_align;
1406 int i, depth, depth_bytes; 1530 int i, depth, depth_bytes, height;
1407 1531
1408 if (!fmt || !(fmt->types & type)) { 1532 if (!fmt || !(fmt->types & type)) {
1409 vpe_err(ctx->dev, "Fourcc format (0x%08x) invalid.\n", 1533 vpe_err(ctx->dev, "Fourcc format (0x%08x) invalid.\n",
@@ -1411,7 +1535,8 @@ static int __vpe_try_fmt(struct vpe_ctx *ctx, struct v4l2_format *f,
1411 return -EINVAL; 1535 return -EINVAL;
1412 } 1536 }
1413 1537
1414 if (pix->field != V4L2_FIELD_NONE && pix->field != V4L2_FIELD_ALTERNATE) 1538 if (pix->field != V4L2_FIELD_NONE && pix->field != V4L2_FIELD_ALTERNATE
1539 && pix->field != V4L2_FIELD_SEQ_TB)
1415 pix->field = V4L2_FIELD_NONE; 1540 pix->field = V4L2_FIELD_NONE;
1416 1541
1417 depth = fmt->vpdma_fmt[VPE_LUMA]->depth; 1542 depth = fmt->vpdma_fmt[VPE_LUMA]->depth;
@@ -1445,6 +1570,14 @@ static int __vpe_try_fmt(struct vpe_ctx *ctx, struct v4l2_format *f,
1445 pix->num_planes = fmt->coplanar ? 2 : 1; 1570 pix->num_planes = fmt->coplanar ? 2 : 1;
1446 pix->pixelformat = fmt->fourcc; 1571 pix->pixelformat = fmt->fourcc;
1447 1572
1573 /* for the actual image parameters, we need to consider the field height
1574 * of the image for SEQ_TB buffers.
1575 */
1576 if (pix->field == V4L2_FIELD_SEQ_TB)
1577 height = pix->height / 2;
1578 else
1579 height = pix->height;
1580
1448 if (!pix->colorspace) { 1581 if (!pix->colorspace) {
1449 if (fmt->fourcc == V4L2_PIX_FMT_RGB24 || 1582 if (fmt->fourcc == V4L2_PIX_FMT_RGB24 ||
1450 fmt->fourcc == V4L2_PIX_FMT_BGR24 || 1583 fmt->fourcc == V4L2_PIX_FMT_BGR24 ||
@@ -1452,7 +1585,7 @@ static int __vpe_try_fmt(struct vpe_ctx *ctx, struct v4l2_format *f,
1452 fmt->fourcc == V4L2_PIX_FMT_BGR32) { 1585 fmt->fourcc == V4L2_PIX_FMT_BGR32) {
1453 pix->colorspace = V4L2_COLORSPACE_SRGB; 1586 pix->colorspace = V4L2_COLORSPACE_SRGB;
1454 } else { 1587 } else {
1455 if (pix->height > 1280) /* HD */ 1588 if (height > 1280) /* HD */
1456 pix->colorspace = V4L2_COLORSPACE_REC709; 1589 pix->colorspace = V4L2_COLORSPACE_REC709;
1457 else /* SD */ 1590 else /* SD */
1458 pix->colorspace = V4L2_COLORSPACE_SMPTE170M; 1591 pix->colorspace = V4L2_COLORSPACE_SMPTE170M;
@@ -1468,8 +1601,7 @@ static int __vpe_try_fmt(struct vpe_ctx *ctx, struct v4l2_format *f,
1468 else 1601 else
1469 plane_fmt->bytesperline = pix->width; 1602 plane_fmt->bytesperline = pix->width;
1470 1603
1471 plane_fmt->sizeimage = 1604 plane_fmt->sizeimage = (pix->height * pix->width * depth) >> 3;
1472 (pix->height * pix->width * depth) >> 3;
1473 } 1605 }
1474 1606
1475 return 0; 1607 return 0;
@@ -1526,9 +1658,15 @@ static int __vpe_s_fmt(struct vpe_ctx *ctx, struct v4l2_format *f)
1526 q_data->c_rect.height = q_data->height; 1658 q_data->c_rect.height = q_data->height;
1527 1659
1528 if (q_data->field == V4L2_FIELD_ALTERNATE) 1660 if (q_data->field == V4L2_FIELD_ALTERNATE)
1529 q_data->flags |= Q_DATA_INTERLACED; 1661 q_data->flags |= Q_DATA_INTERLACED_ALTERNATE;
1662 else if (q_data->field == V4L2_FIELD_SEQ_TB)
1663 q_data->flags |= Q_DATA_INTERLACED_SEQ_TB;
1530 else 1664 else
1531 q_data->flags &= ~Q_DATA_INTERLACED; 1665 q_data->flags &= ~Q_IS_INTERLACED;
1666
1667 /* the crop height is halved for the case of SEQ_TB buffers */
1668 if (q_data->flags & Q_DATA_INTERLACED_SEQ_TB)
1669 q_data->c_rect.height /= 2;
1532 1670
1533 vpe_dbg(ctx->dev, "Setting format for type %d, wxh: %dx%d, fmt: %d bpl_y %d", 1671 vpe_dbg(ctx->dev, "Setting format for type %d, wxh: %dx%d, fmt: %d bpl_y %d",
1534 f->type, q_data->width, q_data->height, q_data->fmt->fourcc, 1672 f->type, q_data->width, q_data->height, q_data->fmt->fourcc,
@@ -1564,6 +1702,7 @@ static int vpe_s_fmt(struct file *file, void *priv, struct v4l2_format *f)
1564static int __vpe_try_crop(struct vpe_ctx *ctx, struct v4l2_crop *cr) 1702static int __vpe_try_crop(struct vpe_ctx *ctx, struct v4l2_crop *cr)
1565{ 1703{
1566 struct vpe_q_data *q_data; 1704 struct vpe_q_data *q_data;
1705 int height;
1567 1706
1568 q_data = get_q_data(ctx, cr->type); 1707 q_data = get_q_data(ctx, cr->type);
1569 if (!q_data) 1708 if (!q_data)
@@ -1577,13 +1716,22 @@ static int __vpe_try_crop(struct vpe_ctx *ctx, struct v4l2_crop *cr)
1577 return 0; 1716 return 0;
1578 } 1717 }
1579 1718
1719 /*
1720 * For SEQ_TB buffers, crop height should be less than the height of
1721 * the field height, not the buffer height
1722 */
1723 if (q_data->flags & Q_DATA_INTERLACED_SEQ_TB)
1724 height = q_data->height / 2;
1725 else
1726 height = q_data->height;
1727
1580 if (cr->c.top < 0 || cr->c.left < 0) { 1728 if (cr->c.top < 0 || cr->c.left < 0) {
1581 vpe_err(ctx->dev, "negative values for top and left\n"); 1729 vpe_err(ctx->dev, "negative values for top and left\n");
1582 cr->c.top = cr->c.left = 0; 1730 cr->c.top = cr->c.left = 0;
1583 } 1731 }
1584 1732
1585 v4l_bound_align_image(&cr->c.width, MIN_W, q_data->width, 1, 1733 v4l_bound_align_image(&cr->c.width, MIN_W, q_data->width, 1,
1586 &cr->c.height, MIN_H, q_data->height, H_ALIGN, S_ALIGN); 1734 &cr->c.height, MIN_H, height, H_ALIGN, S_ALIGN);
1587 1735
1588 /* adjust left/top if cropping rectangle is out of bounds */ 1736 /* adjust left/top if cropping rectangle is out of bounds */
1589 if (cr->c.left + cr->c.width > q_data->width) 1737 if (cr->c.left + cr->c.width > q_data->width)
@@ -1606,7 +1754,10 @@ static int vpe_cropcap(struct file *file, void *priv, struct v4l2_cropcap *cr)
1606 cr->bounds.left = 0; 1754 cr->bounds.left = 0;
1607 cr->bounds.top = 0; 1755 cr->bounds.top = 0;
1608 cr->bounds.width = q_data->width; 1756 cr->bounds.width = q_data->width;
1609 cr->bounds.height = q_data->height; 1757 if (q_data->flags & Q_DATA_INTERLACED_SEQ_TB)
1758 cr->bounds.height = q_data->height / 2;
1759 else
1760 cr->bounds.height = q_data->height;
1610 cr->defrect = cr->bounds; 1761 cr->defrect = cr->bounds;
1611 1762
1612 return 0; 1763 return 0;
@@ -2028,8 +2179,14 @@ static int vpe_release(struct file *file)
2028 mutex_lock(&dev->dev_mutex); 2179 mutex_lock(&dev->dev_mutex);
2029 free_vbs(ctx); 2180 free_vbs(ctx);
2030 free_mv_buffers(ctx); 2181 free_mv_buffers(ctx);
2182 vpdma_buf_unmap(dev->vpdma, &ctx->desc_list.buf);
2183 vpdma_buf_unmap(dev->vpdma, &ctx->mmr_adb);
2184 vpdma_buf_unmap(dev->vpdma, &ctx->sc_coeff_h);
2185 vpdma_buf_unmap(dev->vpdma, &ctx->sc_coeff_v);
2031 vpdma_free_desc_list(&ctx->desc_list); 2186 vpdma_free_desc_list(&ctx->desc_list);
2032 vpdma_buf_free(&ctx->mmr_adb); 2187 vpdma_buf_free(&ctx->mmr_adb);
2188 vpdma_buf_free(&ctx->sc_coeff_v);
2189 vpdma_buf_free(&ctx->sc_coeff_h);
2033 2190
2034 v4l2_fh_del(&ctx->fh); 2191 v4l2_fh_del(&ctx->fh);
2035 v4l2_fh_exit(&ctx->fh); 2192 v4l2_fh_exit(&ctx->fh);
diff --git a/drivers/mmc/host/Kconfig b/drivers/mmc/host/Kconfig
index 009dabded179..57d8c1a15fc0 100644
--- a/drivers/mmc/host/Kconfig
+++ b/drivers/mmc/host/Kconfig
@@ -254,11 +254,11 @@ config MMC_OMAP
254 254
255config MMC_OMAP_HS 255config MMC_OMAP_HS
256 tristate "TI OMAP High Speed Multimedia Card Interface support" 256 tristate "TI OMAP High Speed Multimedia Card Interface support"
257 depends on SOC_OMAP2430 || ARCH_OMAP3 || ARCH_OMAP4 257 depends on ARCH_OMAP2PLUS
258 help 258 help
259 This selects the TI OMAP High Speed Multimedia card Interface. 259 This selects the TI OMAP High Speed Multimedia card Interface.
260 If you have an OMAP2430 or OMAP3 board or OMAP4 board with a 260 If you have an omap2plus board with a Multimedia Card slot,
261 Multimedia Card slot, say Y or M here. 261 say Y or M here.
262 262
263 If unsure, say N. 263 If unsure, say N.
264 264
diff --git a/drivers/net/ethernet/ti/davinci_mdio.c b/drivers/net/ethernet/ti/davinci_mdio.c
index cca25509b039..b09796660062 100644
--- a/drivers/net/ethernet/ti/davinci_mdio.c
+++ b/drivers/net/ethernet/ti/davinci_mdio.c
@@ -51,6 +51,8 @@
51 51
52#define DEF_OUT_FREQ 2200000 /* 2.2 MHz */ 52#define DEF_OUT_FREQ 2200000 /* 2.2 MHz */
53 53
54#define GMAC_CLK_DIV 2
55
54struct davinci_mdio_regs { 56struct davinci_mdio_regs {
55 u32 version; 57 u32 version;
56 u32 control; 58 u32 control;
@@ -100,7 +102,7 @@ static void __davinci_mdio_reset(struct davinci_mdio_data *data)
100{ 102{
101 u32 mdio_in, div, mdio_out_khz, access_time; 103 u32 mdio_in, div, mdio_out_khz, access_time;
102 104
103 mdio_in = clk_get_rate(data->clk); 105 mdio_in = clk_get_rate(data->clk)/GMAC_CLK_DIV;
104 div = (mdio_in / data->pdata.bus_freq) - 1; 106 div = (mdio_in / data->pdata.bus_freq) - 1;
105 if (div > CONTROL_MAX_DIV) 107 if (div > CONTROL_MAX_DIV)
106 div = CONTROL_MAX_DIV; 108 div = CONTROL_MAX_DIV;
@@ -351,7 +353,7 @@ static int davinci_mdio_probe(struct platform_device *pdev)
351 353
352 pm_runtime_enable(&pdev->dev); 354 pm_runtime_enable(&pdev->dev);
353 pm_runtime_get_sync(&pdev->dev); 355 pm_runtime_get_sync(&pdev->dev);
354 data->clk = clk_get(&pdev->dev, "fck"); 356 data->clk = clk_get(&pdev->dev, "dpll_gmac_m2_ck");
355 if (IS_ERR(data->clk)) { 357 if (IS_ERR(data->clk)) {
356 dev_err(dev, "failed to get device clock\n"); 358 dev_err(dev, "failed to get device clock\n");
357 ret = PTR_ERR(data->clk); 359 ret = PTR_ERR(data->clk);
diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
index 4086df9cee13..d59f04f815d2 100644
--- a/drivers/usb/dwc3/core.c
+++ b/drivers/usb/dwc3/core.c
@@ -469,6 +469,7 @@ static int dwc3_probe(struct platform_device *pdev)
469 } 469 }
470 } 470 }
471 471
472 usb_phy_init(dwc->usb2_phy);
472 usb_phy_set_suspend(dwc->usb2_phy, 0); 473 usb_phy_set_suspend(dwc->usb2_phy, 0);
473 usb_phy_set_suspend(dwc->usb3_phy, 0); 474 usb_phy_set_suspend(dwc->usb3_phy, 0);
474 475
diff --git a/drivers/usb/dwc3/debugfs.c b/drivers/usb/dwc3/debugfs.c
index 825b05c6689c..77b3b7ce7fd3 100644
--- a/drivers/usb/dwc3/debugfs.c
+++ b/drivers/usb/dwc3/debugfs.c
@@ -440,6 +440,15 @@ static ssize_t dwc3_mode_write(struct file *file,
440 unsigned long flags; 440 unsigned long flags;
441 u32 mode = 0; 441 u32 mode = 0;
442 char buf[32]; 442 char buf[32];
443 u32 reg;
444
445 spin_lock_irqsave(&dwc->lock, flags);
446 reg = dwc3_readl(dwc->regs, DWC3_GCTL);
447 spin_unlock_irqrestore(&dwc->lock, flags);
448
449 /* mode change is valid for DRD/otg mode only */
450 if (DWC3_GCTL_PRTCAP(reg) != DWC3_GCTL_PRTCAP_OTG)
451 return -EFAULT;
443 452
444 if (copy_from_user(&buf, ubuf, min_t(size_t, sizeof(buf) - 1, count))) 453 if (copy_from_user(&buf, ubuf, min_t(size_t, sizeof(buf) - 1, count)))
445 return -EFAULT; 454 return -EFAULT;
diff --git a/drivers/usb/musb/omap2430.c b/drivers/usb/musb/omap2430.c
index 199cf5f7b7d5..6d9234242b70 100644
--- a/drivers/usb/musb/omap2430.c
+++ b/drivers/usb/musb/omap2430.c
@@ -43,8 +43,6 @@
43#include "musb_core.h" 43#include "musb_core.h"
44#include "omap2430.h" 44#include "omap2430.h"
45 45
46#ifdef CONFIG_USB_MUSB_OMAP2PLUS
47
48struct omap2430_glue { 46struct omap2430_glue {
49 struct device *dev; 47 struct device *dev;
50 struct platform_device *musb; 48 struct platform_device *musb;
@@ -698,4 +696,3 @@ static void __exit omap2430_exit(void)
698 platform_driver_unregister(&omap2430_driver); 696 platform_driver_unregister(&omap2430_driver);
699} 697}
700module_exit(omap2430_exit); 698module_exit(omap2430_exit);
701#endif
diff --git a/drivers/usb/otg/palmas-usb.c b/drivers/usb/otg/palmas-usb.c
index 6f7872532891..35551824c87b 100644
--- a/drivers/usb/otg/palmas-usb.c
+++ b/drivers/usb/otg/palmas-usb.c
@@ -38,8 +38,6 @@
38#include <linux/of.h> 38#include <linux/of.h>
39#include <linux/of_platform.h> 39#include <linux/of_platform.h>
40 40
41#ifdef CONFIG_PALMAS_USB
42
43static int palmas_usb_read(struct palmas *palmas, unsigned int reg, 41static int palmas_usb_read(struct palmas *palmas, unsigned int reg,
44 unsigned int *dest) 42 unsigned int *dest)
45{ 43{
@@ -204,6 +202,7 @@ static int palmas_enable_irq(struct palmas_usb *palmas_usb)
204 202
205 ret = palmas_vbus_wakeup_irq(palmas_usb->irq4, palmas_usb); 203 ret = palmas_vbus_wakeup_irq(palmas_usb->irq4, palmas_usb);
206 204
205 msleep(30);
207 if (palmas_usb->linkstat == OMAP_DWC3_UNKNOWN) 206 if (palmas_usb->linkstat == OMAP_DWC3_UNKNOWN)
208 ret = palmas_id_wakeup_irq(palmas_usb->irq2, palmas_usb); 207 ret = palmas_id_wakeup_irq(palmas_usb->irq2, palmas_usb);
209 208
@@ -409,4 +408,3 @@ MODULE_AUTHOR("Graeme Gregory <gg@slimlogic.co.uk>");
409MODULE_DESCRIPTION("Palmas USB transceiver driver"); 408MODULE_DESCRIPTION("Palmas USB transceiver driver");
410MODULE_LICENSE("GPL"); 409MODULE_LICENSE("GPL");
411MODULE_DEVICE_TABLE(of, of_palmas_match_tbl); 410MODULE_DEVICE_TABLE(of, of_palmas_match_tbl);
412#endif
diff --git a/drivers/usb/otg/twl4030-usb.c b/drivers/usb/otg/twl4030-usb.c
index 44e29622afcf..a994715a3101 100644
--- a/drivers/usb/otg/twl4030-usb.c
+++ b/drivers/usb/otg/twl4030-usb.c
@@ -40,8 +40,6 @@
40#include <linux/err.h> 40#include <linux/err.h>
41#include <linux/slab.h> 41#include <linux/slab.h>
42 42
43#ifdef CONFIG_TWL4030_USB
44
45/* Register defines */ 43/* Register defines */
46 44
47#define MCPC_CTRL 0x30 45#define MCPC_CTRL 0x30
@@ -728,4 +726,3 @@ MODULE_ALIAS("platform:twl4030_usb");
728MODULE_AUTHOR("Texas Instruments, Inc, Nokia Corporation"); 726MODULE_AUTHOR("Texas Instruments, Inc, Nokia Corporation");
729MODULE_DESCRIPTION("TWL4030 USB transceiver driver"); 727MODULE_DESCRIPTION("TWL4030 USB transceiver driver");
730MODULE_LICENSE("GPL"); 728MODULE_LICENSE("GPL");
731#endif
diff --git a/drivers/usb/otg/twl6030-usb.c b/drivers/usb/otg/twl6030-usb.c
index de77d6e4f393..8cd6cf49bdbd 100644
--- a/drivers/usb/otg/twl6030-usb.c
+++ b/drivers/usb/otg/twl6030-usb.c
@@ -34,8 +34,6 @@
34#include <linux/slab.h> 34#include <linux/slab.h>
35#include <linux/delay.h> 35#include <linux/delay.h>
36 36
37#ifdef CONFIG_TWL6030_USB
38
39/* usb register definitions */ 37/* usb register definitions */
40#define USB_VENDOR_ID_LSB 0x00 38#define USB_VENDOR_ID_LSB 0x00
41#define USB_VENDOR_ID_MSB 0x01 39#define USB_VENDOR_ID_MSB 0x01
@@ -446,4 +444,3 @@ MODULE_ALIAS("platform:twl6030_usb");
446MODULE_AUTHOR("Hema HK <hemahk@ti.com>"); 444MODULE_AUTHOR("Hema HK <hemahk@ti.com>");
447MODULE_DESCRIPTION("TWL6030 USB transceiver driver"); 445MODULE_DESCRIPTION("TWL6030 USB transceiver driver");
448MODULE_LICENSE("GPL"); 446MODULE_LICENSE("GPL");
449#endif
diff --git a/drivers/usb/phy/omap-usb2.c b/drivers/usb/phy/omap-usb2.c
index 00987bb7939f..35bf01a13961 100644
--- a/drivers/usb/phy/omap-usb2.c
+++ b/drivers/usb/phy/omap-usb2.c
@@ -30,8 +30,40 @@
30#include <linux/usb/omap_control_usb.h> 30#include <linux/usb/omap_control_usb.h>
31#include <linux/of_platform.h> 31#include <linux/of_platform.h>
32 32
33#define USB2PHY_ANA_CONFIG1 (0x4C) 33#define USB2PHY_DISCON_BYP_LATCH (1 << 31)
34#define DISCON_BYP_LATCH (1<<31) 34#define USB2PHY_ANA_CONFIG1 0x4c
35
36static int omap_usb_init(struct usb_phy *x)
37{
38 struct omap_usb *phy = phy_to_omapusb(x);
39 struct resource *res;
40 struct platform_device *pdev = to_platform_device(phy->dev);
41 u32 val;
42
43 if (phy->flags & OMAP_USB2_CALIBRATE_FALSE_DISCONNECT) {
44 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
45 if (!res) {
46 dev_err(&pdev->dev, "memory resource not available\n");
47 return -ENODEV;
48 }
49 phy->phy_base = devm_request_and_ioremap(&pdev->dev, res);
50 if (!phy->phy_base)
51 return -ENOMEM;
52 /*
53 *
54 * Reduce the sensitivity of internal PHY by enabling the
55 * DISCON_BYP_LATCH of the USB2PHY_ANA_CONFIG1 register. This
56 * resolves issues with certain devices which can otherwise
57 * be prone to false disconnects.
58 *
59 */
60 val = omap_usb_readl(phy->phy_base, USB2PHY_ANA_CONFIG1);
61 val |= USB2PHY_DISCON_BYP_LATCH;
62 omap_usb_writel(phy->phy_base, USB2PHY_ANA_CONFIG1, val);
63 }
64
65 return 0;
66}
35 67
36/** 68/**
37 * omap_usb2_set_comparator - links the comparator present in the sytem with 69 * omap_usb2_set_comparator - links the comparator present in the sytem with
@@ -122,41 +154,39 @@ static int omap_usb2_suspend(struct usb_phy *x, int suspend)
122 154
123 return 0; 155 return 0;
124} 156}
125static int omap_usb2_init(struct usb_phy *x)
126{
127 struct omap_usb *phy = phy_to_omapusb(x);
128 u32 val;
129
130 /*
131 *
132 * Reduce the sensitivity of internal PHY by enabling the
133 * DISCON_BYP_LATCH of the USB2PHY_ANA_CONFIG1 register. This resolves
134 * issues with certain devices which can otherwise be prone to false
135 * disconnects.
136 *
137 * This should be qualified with a runtime check for ensuring the issue
138 * is applicable, but at this time all devices including the USB2PHY IP
139 * are impacted by this issue. Once there is a HW fix for this issue,
140 * the runtime check should be added.
141 *
142 */
143 val = omap_usb_readl(phy->ocp2scp_base, USB2PHY_ANA_CONFIG1);
144 val |= DISCON_BYP_LATCH;
145 omap_usb_writel(phy->ocp2scp_base, USB2PHY_ANA_CONFIG1,
146 val);
147 157
148 return 0; 158static const struct usb_phy_data dra7x_usb2_data = {
149} 159 .label = "dra7x-usb2",
160 .flags = OMAP_USB2_CALIBRATE_FALSE_DISCONNECT,
161};
162
163static const struct of_device_id omap_usb2_id_table[] = {
164 { .compatible = "ti,omap-usb2" },
165 {
166 .compatible = "ti,dra7x-usb2",
167 .data = &dra7x_usb2_data,
168 },
169 {}
170};
171MODULE_DEVICE_TABLE(of, omap_usb2_id_table);
150 172
151static int omap_usb2_probe(struct platform_device *pdev) 173static int omap_usb2_probe(struct platform_device *pdev)
152{ 174{
153 struct omap_usb *phy; 175 struct omap_usb *phy;
154 struct resource *res;
155 struct usb_otg *otg; 176 struct usb_otg *otg;
156 struct device_node *node = pdev->dev.of_node; 177 struct device_node *node = pdev->dev.of_node;
157 struct device_node *omap_control_usb_node; 178 struct device_node *omap_control_usb_node;
158 struct platform_device *pdev_control_usb; 179 struct platform_device *pdev_control_usb;
159 const char *clk_name; 180 const char *clk_name;
181 const struct of_device_id *of_id;
182 struct usb_phy_data *phy_data;
183
184 of_id = of_match_device(of_match_ptr(omap_usb2_id_table), &pdev->dev);
185
186 if (!of_id)
187 return -EINVAL;
188
189 phy_data = (struct usb_phy_data *)of_id->data;
160 190
161 phy = devm_kzalloc(&pdev->dev, sizeof(*phy), GFP_KERNEL); 191 phy = devm_kzalloc(&pdev->dev, sizeof(*phy), GFP_KERNEL);
162 if (!phy) { 192 if (!phy) {
@@ -170,22 +200,19 @@ static int omap_usb2_probe(struct platform_device *pdev)
170 return -ENOMEM; 200 return -ENOMEM;
171 } 201 }
172 202
173 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
174 phy->ocp2scp_base = devm_request_and_ioremap(&pdev->dev, res);
175 if (!phy->ocp2scp_base) {
176 dev_err(&pdev->dev, "ioremap of ocp2scp_base failed\n");
177 return -ENOMEM;
178 }
179
180 phy->dev = &pdev->dev; 203 phy->dev = &pdev->dev;
181 204
182 phy->phy.dev = phy->dev; 205 phy->phy.dev = phy->dev;
183 phy->phy.label = "omap-usb2"; 206 phy->phy.label = "omap-usb2";
184 phy->phy.init = omap_usb2_init;
185 phy->phy.set_suspend = omap_usb2_suspend; 207 phy->phy.set_suspend = omap_usb2_suspend;
186 phy->phy.otg = otg; 208 phy->phy.otg = otg;
187 phy->phy.type = USB_PHY_TYPE_USB2; 209 phy->phy.type = USB_PHY_TYPE_USB2;
188 omap_control_usb_node = of_parse_phandle(node, "ctrl-module", 0); 210 omap_control_usb_node = of_parse_phandle(node, "ctrl-module", 0);
211 phy->phy.init = omap_usb_init;
212
213 if (phy_data &&
214 phy_data->flags & OMAP_USB2_CALIBRATE_FALSE_DISCONNECT)
215 phy->flags |= OMAP_USB2_CALIBRATE_FALSE_DISCONNECT;
189 216
190 if (IS_ERR(omap_control_usb_node)) { 217 if (IS_ERR(omap_control_usb_node)) {
191 dev_err(&pdev->dev, "Failed to find ctrl-module\n"); 218 dev_err(&pdev->dev, "Failed to find ctrl-module\n");
@@ -319,14 +346,6 @@ static const struct dev_pm_ops omap_usb2_pm_ops = {
319#define DEV_PM_OPS NULL 346#define DEV_PM_OPS NULL
320#endif 347#endif
321 348
322#ifdef CONFIG_OF
323static const struct of_device_id omap_usb2_id_table[] = {
324 { .compatible = "ti,omap-usb2" },
325 {}
326};
327MODULE_DEVICE_TABLE(of, omap_usb2_id_table);
328#endif
329
330static struct platform_driver omap_usb2_driver = { 349static struct platform_driver omap_usb2_driver = {
331 .probe = omap_usb2_probe, 350 .probe = omap_usb2_probe,
332 .remove = omap_usb2_remove, 351 .remove = omap_usb2_remove,
diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h
index fc6cd0d5973a..9aa0bb2e3b27 100644
--- a/drivers/video/omap2/dss/dss.h
+++ b/drivers/video/omap2/dss/dss.h
@@ -461,10 +461,6 @@ int dispc_calc_clock_rates(unsigned long dispc_fclk_rate,
461 461
462 462
463void dispc_ovl_set_global_mflag(enum omap_plane plane, bool mflag); 463void dispc_ovl_set_global_mflag(enum omap_plane plane, bool mflag);
464void dispc_ovl_set_fifo_threshold(enum omap_plane plane, u32 low, u32 high);
465void dispc_ovl_compute_fifo_thresholds(enum omap_plane plane,
466 u32 *fifo_low, u32 *fifo_high, bool use_fifomerge,
467 bool manual_update);
468 464
469unsigned long dispc_mgr_lclk_rate(enum omap_channel channel); 465unsigned long dispc_mgr_lclk_rate(enum omap_channel channel);
470unsigned long dispc_mgr_pclk_rate(enum omap_channel channel); 466unsigned long dispc_mgr_pclk_rate(enum omap_channel channel);
diff --git a/drivers/video/omap2/dss/hdmi.c b/drivers/video/omap2/dss/hdmi.c
index e944f8a3d7c1..08135fc9e4fc 100644
--- a/drivers/video/omap2/dss/hdmi.c
+++ b/drivers/video/omap2/dss/hdmi.c
@@ -784,8 +784,8 @@ static void hdmi_compute_pll(struct omap_dss_device *dssdev, int phy,
784 break; 784 break;
785 case OMAPDSS_VER_OMAP5: 785 case OMAPDSS_VER_OMAP5:
786 case OMAPDSS_VER_DRA7xx: 786 case OMAPDSS_VER_DRA7xx:
787 if (phy <= 50000) 787 if (phy <= 65000)
788 pi->regm2 = 5; 788 pi->regm2 = 3;
789 else 789 else
790 pi->regm2 = 1; 790 pi->regm2 = 1;
791 break; 791 break;
@@ -1119,7 +1119,7 @@ int omapdss_hdmi_display_check_timing(struct omap_dss_device *dssdev,
1119 1119
1120 cm = hdmi_get_code(timings); 1120 cm = hdmi_get_code(timings);
1121 if (cm.code == -1) { 1121 if (cm.code == -1) {
1122 return -EINVAL; 1122 DSSDBG("not a standard cea/vesa/s3d timing\n");
1123 } 1123 }
1124 1124
1125#endif 1125#endif
@@ -1286,8 +1286,13 @@ void omapdss_hdmi_display_set_timing(struct omap_dss_device *dssdev,
1286 hdmi.ip_data.cfg.cm = cm; 1286 hdmi.ip_data.cfg.cm = cm;
1287 1287
1288 t = hdmi_get_timings(); 1288 t = hdmi_get_timings();
1289 if (t != NULL) 1289 if (t != NULL) {
1290 hdmi.ip_data.cfg = *t; 1290 hdmi.ip_data.cfg = *t;
1291 } else {
1292 hdmi.ip_data.cfg.timings = *timings;
1293 hdmi.ip_data.cfg.cm.code = 0;
1294 hdmi.ip_data.cfg.cm.mode = HDMI_HDMI;
1295 }
1291 1296
1292 mutex_unlock(&hdmi.lock); 1297 mutex_unlock(&hdmi.lock);
1293#endif 1298#endif
@@ -2062,7 +2067,7 @@ void sel_i2c(void)
2062 * CM_L4PER2_MCASP8_CLKCTRL[1:0]: 0x2 - Enable explicitly 2067 * CM_L4PER2_MCASP8_CLKCTRL[1:0]: 0x2 - Enable explicitly
2063 */ 2068 */
2064 __raw_writel(0x400002, clk_base + 0x890); 2069 __raw_writel(0x400002, clk_base + 0x890);
2065 DSSINFO("%s: CM_L4PER2_CLKSTCTRL 0x%8x\n", 2070 DSSDBG("%s: CM_L4PER2_CLKSTCTRL 0x%8x\n",
2066 __func__, __raw_readl(clk_base + 0x8fc)); 2071 __func__, __raw_readl(clk_base + 0x8fc));
2067 2072
2068 /* drive MCASP8_PDOUT to low to select I2C2*/ 2073 /* drive MCASP8_PDOUT to low to select I2C2*/
diff --git a/include/linux/platform_data/remoteproc-omap.h b/include/linux/platform_data/remoteproc-omap.h
index ba9dff37662e..427f5c29079c 100644
--- a/include/linux/platform_data/remoteproc-omap.h
+++ b/include/linux/platform_data/remoteproc-omap.h
@@ -56,6 +56,8 @@ struct omap_rproc_pdata {
56 const struct rproc_ops *ops; 56 const struct rproc_ops *ops;
57 struct omap_rproc_timers_info *timers; 57 struct omap_rproc_timers_info *timers;
58 u32 timers_cnt; 58 u32 timers_cnt;
59 struct rproc_mem_entry *carveouts;
60 u32 carveouts_cnt;
59 u32 late_attach; 61 u32 late_attach;
60 struct rproc_mem_entry *carveouts; 62 struct rproc_mem_entry *carveouts;
61 u32 carveouts_cnt; 63 u32 carveouts_cnt;
diff --git a/include/linux/usb/omap_usb.h b/include/linux/usb/omap_usb.h
index 8722f40dfbcd..650a4aa664f2 100644
--- a/include/linux/usb/omap_usb.h
+++ b/include/linux/usb/omap_usb.h
@@ -30,10 +30,14 @@ struct usb_dpll_params {
30 u32 mf; 30 u32 mf;
31}; 31};
32 32
33struct usb_phy_data {
34 const char *label;
35 u32 flags;
36};
37
33struct omap_usb { 38struct omap_usb {
34 struct usb_phy phy; 39 struct usb_phy phy;
35 struct phy_companion *comparator; 40 struct phy_companion *comparator;
36 void __iomem *ocp2scp_base;
37 void __iomem *pll_ctrl_base; 41 void __iomem *pll_ctrl_base;
38 struct device *dev; 42 struct device *dev;
39 struct device *control_dev; 43 struct device *control_dev;
@@ -42,8 +46,15 @@ struct omap_usb {
42 struct clk *optclk; 46 struct clk *optclk;
43 u8 is_suspended:1; 47 u8 is_suspended:1;
44 struct device_node *control_node; 48 struct device_node *control_node;
49 void __iomem *phy_base;
50 u32 flags;
45}; 51};
46 52
53/* Driver Flags */
54#define OMAP_USB2_HAS_START_SRP (1 << 0)
55#define OMAP_USB2_HAS_SET_VBUS (1 << 1)
56#define OMAP_USB2_CALIBRATE_FALSE_DISCONNECT (1 << 2)
57
47#define phy_to_omapusb(x) container_of((x), struct omap_usb, phy) 58#define phy_to_omapusb(x) container_of((x), struct omap_usb, phy)
48 59
49#if defined(CONFIG_OMAP_USB2) || defined(CONFIG_OMAP_USB2_MODULE) 60#if defined(CONFIG_OMAP_USB2) || defined(CONFIG_OMAP_USB2_MODULE)
diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h
index 3cf3e946e331..772bc3075a2e 100644
--- a/include/uapi/linux/videodev2.h
+++ b/include/uapi/linux/videodev2.h
@@ -69,7 +69,7 @@
69 * Common stuff for both V4L1 and V4L2 69 * Common stuff for both V4L1 and V4L2
70 * Moved from videodev.h 70 * Moved from videodev.h
71 */ 71 */
72#define VIDEO_MAX_FRAME 32 72#define VIDEO_MAX_FRAME 128
73#define VIDEO_MAX_PLANES 8 73#define VIDEO_MAX_PLANES 8
74 74
75#ifndef __KERNEL__ 75#ifndef __KERNEL__
diff --git a/include/video/omapdss.h b/include/video/omapdss.h
index a2c89e5a70ef..2e37a3f3df03 100644
--- a/include/video/omapdss.h
+++ b/include/video/omapdss.h
@@ -1031,6 +1031,10 @@ int dispc_ovl_enable(enum omap_plane plane, bool enable);
1031bool dispc_ovl_enabled(enum omap_plane plane); 1031bool dispc_ovl_enabled(enum omap_plane plane);
1032void dispc_ovl_set_channel_out(enum omap_plane plane, 1032void dispc_ovl_set_channel_out(enum omap_plane plane,
1033 enum omap_channel channel); 1033 enum omap_channel channel);
1034void dispc_ovl_compute_fifo_thresholds(enum omap_plane plane,
1035 u32 *fifo_low, u32 *fifo_high, bool use_fifomerge,
1036 bool manual_update);
1037void dispc_ovl_set_fifo_threshold(enum omap_plane plane, u32 low, u32 high);
1034int dispc_ovl_setup(enum omap_plane plane, const struct omap_overlay_info *oi, 1038int dispc_ovl_setup(enum omap_plane plane, const struct omap_overlay_info *oi,
1035 bool replication, const struct omap_video_timings *mgr_timings, 1039 bool replication, const struct omap_video_timings *mgr_timings,
1036 bool mem_to_mem); 1040 bool mem_to_mem);