Commit 991eecc1 authored by Dave Airlie's avatar Dave Airlie

Merge tag 'omapdrm-4.16' of git://git.kernel.org/pub/scm/linux/kernel/git/tomba/linux into drm-next

omapdrm changes for v4.16

* support memory bandwidth limits
* DSI command mode panel cleanups for N9
* DMM error handling

* tag 'omapdrm-4.16' of git://git.kernel.org/pub/scm/linux/kernel/git/tomba/linux: (27 commits)
  drm: omapdrm: Simplify platform registration
  drm: omapdrm: Remove filename from header and fix copyright tag
  drm/omap: DMM: Check for DMM readiness after successful transaction commit
  drm/omap: DMM: Print information if we received an error interrupt
  drm/omap: DMM: In case of error/timeout in wait_status() print the reason
  drm/omap: DMM: Fix DMM_IRQSTAT_ERR_MASK definition
  drm: omapdrm: Deconstruct the omap_drv.h header.
  drm: omapdrm: venc: Return error code on OF parsing failure
  drm: omapdrm: dpi: Remove dpi_data port_initialized field
  drm: omapdrm: dss: Make dss_dump_clocks() function static
  drm: omapdrm: dss: Set the DMA coherent mask
  drm: omapdrm: Remove unused omap_dss_find_device() function
  drm: omapdrm: Pass drm_device to omap_gem_resume()
  drm: omapdrm: dpi: Don't treat GPIO probe deferral as an error
  drm/omap: panel-dsi-cm: switch to gpiod
  drm/omap: panel-dsi-cm: add external backlight support
  drm/omap: panel-dsi-cm: add physical size support
  drm/omap: panel-dsi-cm: add regulator support
  drm/omap: panel-dsi-cm: fix driver
  drm/omap: add support for physical size hints from display drivers
  ...
parents 8932541b d66c36a3
...@@ -2,7 +2,7 @@ Toppoly TD028TTEC1 Panel ...@@ -2,7 +2,7 @@ Toppoly TD028TTEC1 Panel
======================== ========================
Required properties: Required properties:
- compatible: "toppoly,td028ttec1" - compatible: "tpo,td028ttec1"
Optional properties: Optional properties:
- label: a symbolic name for the panel - label: a symbolic name for the panel
...@@ -14,7 +14,7 @@ Example ...@@ -14,7 +14,7 @@ Example
------- -------
lcd-panel: td028ttec1@0 { lcd-panel: td028ttec1@0 {
compatible = "toppoly,td028ttec1"; compatible = "tpo,td028ttec1";
reg = <0>; reg = <0>;
spi-max-frequency = <100000>; spi-max-frequency = <100000>;
spi-cpol; spi-cpol;
......
...@@ -47,6 +47,11 @@ Required properties: ...@@ -47,6 +47,11 @@ Required properties:
- clocks: handle to fclk - clocks: handle to fclk
- clock-names: "fck" - clock-names: "fck"
Optional properties:
- max-memory-bandwidth: Input memory (from main memory to dispc) bandwidth limit
in bytes per second
HDMI HDMI
---- ----
......
...@@ -28,6 +28,10 @@ Required properties: ...@@ -28,6 +28,10 @@ Required properties:
- ti,hwmods: "dss_dispc" - ti,hwmods: "dss_dispc"
- interrupts: the DISPC interrupt - interrupts: the DISPC interrupt
Optional properties:
- max-memory-bandwidth: Input memory (from main memory to dispc) bandwidth limit
in bytes per second
RFBI RFBI
---- ----
......
...@@ -37,6 +37,10 @@ Required properties: ...@@ -37,6 +37,10 @@ Required properties:
- clocks: handle to fclk - clocks: handle to fclk
- clock-names: "fck" - clock-names: "fck"
Optional properties:
- max-memory-bandwidth: Input memory (from main memory to dispc) bandwidth limit
in bytes per second
RFBI RFBI
---- ----
......
...@@ -36,6 +36,10 @@ Required properties: ...@@ -36,6 +36,10 @@ Required properties:
- clocks: handle to fclk - clocks: handle to fclk
- clock-names: "fck" - clock-names: "fck"
Optional properties:
- max-memory-bandwidth: Input memory (from main memory to dispc) bandwidth limit
in bytes per second
RFBI RFBI
---- ----
......
...@@ -36,6 +36,10 @@ Required properties: ...@@ -36,6 +36,10 @@ Required properties:
- clocks: handle to fclk - clocks: handle to fclk
- clock-names: "fck" - clock-names: "fck"
Optional properties:
- max-memory-bandwidth: Input memory (from main memory to dispc) bandwidth limit
in bytes per second
RFBI RFBI
---- ----
......
/* /*
* Analog TV Connector driver * Analog TV Connector driver
* *
* Copyright (C) 2013 Texas Instruments * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/
* Author: Tomi Valkeinen <tomi.valkeinen@ti.com> * Author: Tomi Valkeinen <tomi.valkeinen@ti.com>
* *
* This program is free software; you can redistribute it and/or modify it * This program is free software; you can redistribute it and/or modify it
......
/* /*
* Generic DVI Connector driver * Generic DVI Connector driver
* *
* Copyright (C) 2013 Texas Instruments * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/
* Author: Tomi Valkeinen <tomi.valkeinen@ti.com> * Author: Tomi Valkeinen <tomi.valkeinen@ti.com>
* *
* This program is free software; you can redistribute it and/or modify it * This program is free software; you can redistribute it and/or modify it
......
/* /*
* HDMI Connector driver * HDMI Connector driver
* *
* Copyright (C) 2013 Texas Instruments * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/
* Author: Tomi Valkeinen <tomi.valkeinen@ti.com> * Author: Tomi Valkeinen <tomi.valkeinen@ti.com>
* *
* This program is free software; you can redistribute it and/or modify it * This program is free software; you can redistribute it and/or modify it
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
* *
* based on encoder-tfp410 * based on encoder-tfp410
* *
* Copyright (C) 2013 Texas Instruments * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/
* Author: Tomi Valkeinen <tomi.valkeinen@ti.com> * Author: Tomi Valkeinen <tomi.valkeinen@ti.com>
* *
* This program is free software; you can redistribute it and/or modify it * This program is free software; you can redistribute it and/or modify it
......
/* /*
* TFP410 DPI-to-DVI encoder driver * TFP410 DPI-to-DVI encoder driver
* *
* Copyright (C) 2013 Texas Instruments * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/
* Author: Tomi Valkeinen <tomi.valkeinen@ti.com> * Author: Tomi Valkeinen <tomi.valkeinen@ti.com>
* *
* This program is free software; you can redistribute it and/or modify it * This program is free software; you can redistribute it and/or modify it
...@@ -173,7 +173,8 @@ static int tfp410_probe_of(struct platform_device *pdev) ...@@ -173,7 +173,8 @@ static int tfp410_probe_of(struct platform_device *pdev)
if (gpio_is_valid(gpio) || gpio == -ENOENT) { if (gpio_is_valid(gpio) || gpio == -ENOENT) {
ddata->pd_gpio = gpio; ddata->pd_gpio = gpio;
} else { } else {
dev_err(&pdev->dev, "failed to parse PD gpio\n"); if (gpio != -EPROBE_DEFER)
dev_err(&pdev->dev, "failed to parse PD gpio\n");
return gpio; return gpio;
} }
......
/* /*
* TPD12S015 HDMI ESD protection & level shifter chip driver * TPD12S015 HDMI ESD protection & level shifter chip driver
* *
* Copyright (C) 2013 Texas Instruments * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/
* Author: Tomi Valkeinen <tomi.valkeinen@ti.com> * Author: Tomi Valkeinen <tomi.valkeinen@ti.com>
* *
* This program is free software; you can redistribute it and/or modify it * This program is free software; you can redistribute it and/or modify it
......
/* /*
* Generic MIPI DPI Panel Driver * Generic MIPI DPI Panel Driver
* *
* Copyright (C) 2013 Texas Instruments * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/
* Author: Tomi Valkeinen <tomi.valkeinen@ti.com> * Author: Tomi Valkeinen <tomi.valkeinen@ti.com>
* *
* This program is free software; you can redistribute it and/or modify it * This program is free software; you can redistribute it and/or modify it
......
/* /*
* Generic DSI Command Mode panel driver * Generic DSI Command Mode panel driver
* *
* Copyright (C) 2013 Texas Instruments * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/
* Author: Tomi Valkeinen <tomi.valkeinen@ti.com> * Author: Tomi Valkeinen <tomi.valkeinen@ti.com>
* *
* This program is free software; you can redistribute it and/or modify it * This program is free software; you can redistribute it and/or modify it
...@@ -22,9 +22,10 @@ ...@@ -22,9 +22,10 @@
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/workqueue.h> #include <linux/workqueue.h>
#include <linux/of_device.h> #include <linux/of_device.h>
#include <linux/of_gpio.h> #include <linux/regulator/consumer.h>
#include <video/mipi_display.h> #include <video/mipi_display.h>
#include <video/of_display_timing.h>
#include "../dss/omapdss.h" #include "../dss/omapdss.h"
...@@ -49,6 +50,7 @@ struct panel_drv_data { ...@@ -49,6 +50,7 @@ struct panel_drv_data {
struct mutex lock; struct mutex lock;
struct backlight_device *bldev; struct backlight_device *bldev;
struct backlight_device *extbldev;
unsigned long hw_guard_end; /* next value of jiffies when we can unsigned long hw_guard_end; /* next value of jiffies when we can
* issue the next sleep in/out command * issue the next sleep in/out command
...@@ -56,11 +58,17 @@ struct panel_drv_data { ...@@ -56,11 +58,17 @@ struct panel_drv_data {
unsigned long hw_guard_wait; /* max guard time in jiffies */ unsigned long hw_guard_wait; /* max guard time in jiffies */
/* panel HW configuration from DT or platform data */ /* panel HW configuration from DT or platform data */
int reset_gpio; struct gpio_desc *reset_gpio;
int ext_te_gpio; struct gpio_desc *ext_te_gpio;
struct regulator *vpnl;
struct regulator *vddi;
bool use_dsi_backlight; bool use_dsi_backlight;
int width_mm;
int height_mm;
struct omap_dsi_pin_config pin_config; struct omap_dsi_pin_config pin_config;
/* runtime variables */ /* runtime variables */
...@@ -92,6 +100,30 @@ static int dsicm_panel_reset(struct panel_drv_data *ddata); ...@@ -92,6 +100,30 @@ static int dsicm_panel_reset(struct panel_drv_data *ddata);
static void dsicm_ulps_work(struct work_struct *work); static void dsicm_ulps_work(struct work_struct *work);
static void dsicm_bl_power(struct panel_drv_data *ddata, bool enable)
{
struct backlight_device *backlight;
if (ddata->bldev)
backlight = ddata->bldev;
else if (ddata->extbldev)
backlight = ddata->extbldev;
else
return;
if (enable) {
backlight->props.fb_blank = FB_BLANK_UNBLANK;
backlight->props.state = ~(BL_CORE_FBBLANK | BL_CORE_SUSPENDED);
backlight->props.power = FB_BLANK_UNBLANK;
} else {
backlight->props.fb_blank = FB_BLANK_NORMAL;
backlight->props.power = FB_BLANK_POWERDOWN;
backlight->props.state |= BL_CORE_FBBLANK | BL_CORE_SUSPENDED;
}
backlight_update_status(backlight);
}
static void hw_guard_start(struct panel_drv_data *ddata, int guard_msec) static void hw_guard_start(struct panel_drv_data *ddata, int guard_msec)
{ {
ddata->hw_guard_wait = msecs_to_jiffies(guard_msec); ddata->hw_guard_wait = msecs_to_jiffies(guard_msec);
...@@ -255,8 +287,8 @@ static int dsicm_enter_ulps(struct panel_drv_data *ddata) ...@@ -255,8 +287,8 @@ static int dsicm_enter_ulps(struct panel_drv_data *ddata)
if (r) if (r)
goto err; goto err;
if (gpio_is_valid(ddata->ext_te_gpio)) if (ddata->ext_te_gpio)
disable_irq(gpio_to_irq(ddata->ext_te_gpio)); disable_irq(gpiod_to_irq(ddata->ext_te_gpio));
in->ops.dsi->disable(in, false, true); in->ops.dsi->disable(in, false, true);
...@@ -297,8 +329,8 @@ static int dsicm_exit_ulps(struct panel_drv_data *ddata) ...@@ -297,8 +329,8 @@ static int dsicm_exit_ulps(struct panel_drv_data *ddata)
goto err2; goto err2;
} }
if (gpio_is_valid(ddata->ext_te_gpio)) if (ddata->ext_te_gpio)
enable_irq(gpio_to_irq(ddata->ext_te_gpio)); enable_irq(gpiod_to_irq(ddata->ext_te_gpio));
dsicm_queue_ulps_work(ddata); dsicm_queue_ulps_work(ddata);
...@@ -311,8 +343,8 @@ static int dsicm_exit_ulps(struct panel_drv_data *ddata) ...@@ -311,8 +343,8 @@ static int dsicm_exit_ulps(struct panel_drv_data *ddata)
r = dsicm_panel_reset(ddata); r = dsicm_panel_reset(ddata);
if (!r) { if (!r) {
if (gpio_is_valid(ddata->ext_te_gpio)) if (ddata->ext_te_gpio)
enable_irq(gpio_to_irq(ddata->ext_te_gpio)); enable_irq(gpiod_to_irq(ddata->ext_te_gpio));
ddata->ulps_enabled = false; ddata->ulps_enabled = false;
} }
err1: err1:
...@@ -335,7 +367,7 @@ static int dsicm_bl_update_status(struct backlight_device *dev) ...@@ -335,7 +367,7 @@ static int dsicm_bl_update_status(struct backlight_device *dev)
{ {
struct panel_drv_data *ddata = dev_get_drvdata(&dev->dev); struct panel_drv_data *ddata = dev_get_drvdata(&dev->dev);
struct omap_dss_device *in = ddata->in; struct omap_dss_device *in = ddata->in;
int r; int r = 0;
int level; int level;
if (dev->props.fb_blank == FB_BLANK_UNBLANK && if (dev->props.fb_blank == FB_BLANK_UNBLANK &&
...@@ -356,8 +388,6 @@ static int dsicm_bl_update_status(struct backlight_device *dev) ...@@ -356,8 +388,6 @@ static int dsicm_bl_update_status(struct backlight_device *dev)
r = dsicm_dcs_write_1(ddata, DCS_BRIGHTNESS, level); r = dsicm_dcs_write_1(ddata, DCS_BRIGHTNESS, level);
in->ops.dsi->bus_unlock(in); in->ops.dsi->bus_unlock(in);
} else {
r = 0;
} }
mutex_unlock(&ddata->lock); mutex_unlock(&ddata->lock);
...@@ -560,16 +590,13 @@ static const struct attribute_group dsicm_attr_group = { ...@@ -560,16 +590,13 @@ static const struct attribute_group dsicm_attr_group = {
static void dsicm_hw_reset(struct panel_drv_data *ddata) static void dsicm_hw_reset(struct panel_drv_data *ddata)
{ {
if (!gpio_is_valid(ddata->reset_gpio)) gpiod_set_value(ddata->reset_gpio, 1);
return;
gpio_set_value(ddata->reset_gpio, 1);
udelay(10); udelay(10);
/* reset the panel */ /* reset the panel */
gpio_set_value(ddata->reset_gpio, 0); gpiod_set_value(ddata->reset_gpio, 0);
/* assert reset */ /* assert reset */
udelay(10); udelay(10);
gpio_set_value(ddata->reset_gpio, 1); gpiod_set_value(ddata->reset_gpio, 1);
/* wait after releasing reset */ /* wait after releasing reset */
usleep_range(5000, 10000); usleep_range(5000, 10000);
} }
...@@ -589,25 +616,43 @@ static int dsicm_power_on(struct panel_drv_data *ddata) ...@@ -589,25 +616,43 @@ static int dsicm_power_on(struct panel_drv_data *ddata)
.lp_clk_max = 10000000, .lp_clk_max = 10000000,
}; };
if (ddata->vpnl) {
r = regulator_enable(ddata->vpnl);
if (r) {
dev_err(&ddata->pdev->dev,
"failed to enable VPNL: %d\n", r);
return r;
}
}
if (ddata->vddi) {
r = regulator_enable(ddata->vddi);
if (r) {
dev_err(&ddata->pdev->dev,
"failed to enable VDDI: %d\n", r);
goto err_vpnl;
}
}
if (ddata->pin_config.num_pins > 0) { if (ddata->pin_config.num_pins > 0) {
r = in->ops.dsi->configure_pins(in, &ddata->pin_config); r = in->ops.dsi->configure_pins(in, &ddata->pin_config);
if (r) { if (r) {
dev_err(&ddata->pdev->dev, dev_err(&ddata->pdev->dev,
"failed to configure DSI pins\n"); "failed to configure DSI pins\n");
goto err0; goto err_vddi;
} }
} }
r = in->ops.dsi->set_config(in, &dsi_config); r = in->ops.dsi->set_config(in, &dsi_config);
if (r) { if (r) {
dev_err(&ddata->pdev->dev, "failed to configure DSI\n"); dev_err(&ddata->pdev->dev, "failed to configure DSI\n");
goto err0; goto err_vddi;
} }
r = in->ops.dsi->enable(in); r = in->ops.dsi->enable(in);
if (r) { if (r) {
dev_err(&ddata->pdev->dev, "failed to enable DSI\n"); dev_err(&ddata->pdev->dev, "failed to enable DSI\n");
goto err0; goto err_vddi;
} }
dsicm_hw_reset(ddata); dsicm_hw_reset(ddata);
...@@ -665,7 +710,13 @@ static int dsicm_power_on(struct panel_drv_data *ddata) ...@@ -665,7 +710,13 @@ static int dsicm_power_on(struct panel_drv_data *ddata)
dsicm_hw_reset(ddata); dsicm_hw_reset(ddata);
in->ops.dsi->disable(in, true, false); in->ops.dsi->disable(in, true, false);
err0: err_vddi:
if (ddata->vddi)
regulator_disable(ddata->vddi);
err_vpnl:
if (ddata->vpnl)
regulator_disable(ddata->vpnl);
return r; return r;
} }
...@@ -688,6 +739,11 @@ static void dsicm_power_off(struct panel_drv_data *ddata) ...@@ -688,6 +739,11 @@ static void dsicm_power_off(struct panel_drv_data *ddata)
in->ops.dsi->disable(in, true, false); in->ops.dsi->disable(in, true, false);
if (ddata->vddi)
regulator_disable(ddata->vddi);
if (ddata->vpnl)
regulator_disable(ddata->vpnl);
ddata->enabled = 0; ddata->enabled = 0;
} }
...@@ -782,6 +838,8 @@ static int dsicm_enable(struct omap_dss_device *dssdev) ...@@ -782,6 +838,8 @@ static int dsicm_enable(struct omap_dss_device *dssdev)
mutex_unlock(&ddata->lock); mutex_unlock(&ddata->lock);
dsicm_bl_power(ddata, true);
return 0; return 0;
err: err:
dev_dbg(&ddata->pdev->dev, "enable failed\n"); dev_dbg(&ddata->pdev->dev, "enable failed\n");
...@@ -797,6 +855,8 @@ static void dsicm_disable(struct omap_dss_device *dssdev) ...@@ -797,6 +855,8 @@ static void dsicm_disable(struct omap_dss_device *dssdev)
dev_dbg(&ddata->pdev->dev, "disable\n"); dev_dbg(&ddata->pdev->dev, "disable\n");
dsicm_bl_power(ddata, false);
mutex_lock(&ddata->lock); mutex_lock(&ddata->lock);
dsicm_cancel_ulps_work(ddata); dsicm_cancel_ulps_work(ddata);
...@@ -890,7 +950,7 @@ static int dsicm_update(struct omap_dss_device *dssdev, ...@@ -890,7 +950,7 @@ static int dsicm_update(struct omap_dss_device *dssdev,
if (r) if (r)
goto err; goto err;
if (ddata->te_enabled && gpio_is_valid(ddata->ext_te_gpio)) { if (ddata->te_enabled && ddata->ext_te_gpio) {
schedule_delayed_work(&ddata->te_timeout_work, schedule_delayed_work(&ddata->te_timeout_work,
msecs_to_jiffies(250)); msecs_to_jiffies(250));
atomic_set(&ddata->do_update, 1); atomic_set(&ddata->do_update, 1);
...@@ -937,7 +997,7 @@ static int _dsicm_enable_te(struct panel_drv_data *ddata, bool enable) ...@@ -937,7 +997,7 @@ static int _dsicm_enable_te(struct panel_drv_data *ddata, bool enable)
else else
r = dsicm_dcs_write_0(ddata, MIPI_DCS_SET_TEAR_OFF); r = dsicm_dcs_write_0(ddata, MIPI_DCS_SET_TEAR_OFF);
if (!gpio_is_valid(ddata->ext_te_gpio)) if (!ddata->ext_te_gpio)
in->ops.dsi->enable_te(in, enable); in->ops.dsi->enable_te(in, enable);
/* possible panel bug */ /* possible panel bug */
...@@ -1099,6 +1159,45 @@ static void dsicm_ulps_work(struct work_struct *work) ...@@ -1099,6 +1159,45 @@ static void dsicm_ulps_work(struct work_struct *work)
mutex_unlock(&ddata->lock); mutex_unlock(&ddata->lock);
} }
static void dsicm_get_timings(struct omap_dss_device *dssdev,
struct videomode *vm)
{
struct panel_drv_data *ddata = to_panel_data(dssdev);
*vm = ddata->vm;
}
static int dsicm_check_timings(struct omap_dss_device *dssdev,
struct videomode *vm)
{
struct panel_drv_data *ddata = to_panel_data(dssdev);
int ret = 0;
if (vm->hactive != ddata->vm.hactive)
ret = -EINVAL;
if (vm->vactive != ddata->vm.vactive)
ret = -EINVAL;
if (ret) {
dev_warn(dssdev->dev, "wrong resolution: %d x %d",
vm->hactive, vm->vactive);
dev_warn(dssdev->dev, "panel resolution: %d x %d",
ddata->vm.hactive, ddata->vm.vactive);
}
return ret;
}
static void dsicm_get_size(struct omap_dss_device *dssdev,
unsigned int *width, unsigned int *height)
{
struct panel_drv_data *ddata = to_panel_data(dssdev);
*width = ddata->width_mm;
*height = ddata->height_mm;
}
static struct omap_dss_driver dsicm_ops = { static struct omap_dss_driver dsicm_ops = {
.connect = dsicm_connect, .connect = dsicm_connect,
.disconnect = dsicm_disconnect, .disconnect = dsicm_disconnect,
...@@ -1109,6 +1208,10 @@ static struct omap_dss_driver dsicm_ops = { ...@@ -1109,6 +1208,10 @@ static struct omap_dss_driver dsicm_ops = {
.update = dsicm_update, .update = dsicm_update,
.sync = dsicm_sync, .sync = dsicm_sync,
.get_timings = dsicm_get_timings,
.check_timings = dsicm_check_timings,
.get_size = dsicm_get_size,
.enable_te = dsicm_enable_te, .enable_te = dsicm_enable_te,
.get_te = dsicm_get_te, .get_te = dsicm_get_te,
...@@ -1118,41 +1221,87 @@ static struct omap_dss_driver dsicm_ops = { ...@@ -1118,41 +1221,87 @@ static struct omap_dss_driver dsicm_ops = {
static int dsicm_probe_of(struct platform_device *pdev) static int dsicm_probe_of(struct platform_device *pdev)
{ {
struct device_node *node = pdev->dev.of_node; struct device_node *node = pdev->dev.of_node;
struct device_node *backlight;
struct panel_drv_data *ddata = platform_get_drvdata(pdev); struct panel_drv_data *ddata = platform_get_drvdata(pdev);
struct omap_dss_device *in; struct omap_dss_device *in;
int gpio; struct display_timing timing;
int err;
ddata->reset_gpio = devm_gpiod_get(&pdev->dev, "reset", GPIOD_OUT_LOW);
if (IS_ERR(ddata->reset_gpio)) {
err = PTR_ERR(ddata->reset_gpio);
dev_err(&pdev->dev, "reset gpio request failed: %d", err);
return err;
}
gpio = of_get_named_gpio(node, "reset-gpios", 0); ddata->ext_te_gpio = devm_gpiod_get_optional(&pdev->dev, "te",
if (!gpio_is_valid(gpio)) { GPIOD_IN);
dev_err(&pdev->dev, "failed to parse reset gpio\n"); if (IS_ERR(ddata->ext_te_gpio)) {
return gpio; err = PTR_ERR(ddata->ext_te_gpio);
dev_err(&pdev->dev, "TE gpio request failed: %d", err);
return err;
} }
ddata->reset_gpio = gpio;
gpio = of_get_named_gpio(node, "te-gpios", 0); err = of_get_display_timing(node, "panel-timing", &timing);
if (gpio_is_valid(gpio) || gpio == -ENOENT) { if (!err) {
ddata->ext_te_gpio = gpio; videomode_from_timing(&timing, &ddata->vm);
if (!ddata->vm.pixelclock)
ddata->vm.pixelclock =
ddata->vm.hactive * ddata->vm.vactive * 60;
} else { } else {
dev_err(&pdev->dev, "failed to parse TE gpio\n"); dev_warn(&pdev->dev,
return gpio; "failed to get video timing, using defaults\n");
} }
ddata->width_mm = 0;
of_property_read_u32(node, "width-mm", &ddata->width_mm);
ddata->height_mm = 0;
of_property_read_u32(node, "height-mm", &ddata->height_mm);
in = omapdss_of_find_source_for_first_ep(node); in = omapdss_of_find_source_for_first_ep(node);
if (IS_ERR(in)) { if (IS_ERR(in)) {
dev_err(&pdev->dev, "failed to find video source\n"); dev_err(&pdev->dev, "failed to find video source\n");
return PTR_ERR(in); return PTR_ERR(in);
} }
ddata->vpnl = devm_regulator_get_optional(&pdev->dev, "vpnl");
if (IS_ERR(ddata->vpnl)) {
err = PTR_ERR(ddata->vpnl);
if (err == -EPROBE_DEFER)
return err;
ddata->vpnl = NULL;
}
ddata->vddi = devm_regulator_get_optional(&pdev->dev, "vddi");
if (IS_ERR(ddata->vddi)) {
err = PTR_ERR(ddata->vddi);
if (err == -EPROBE_DEFER)
return err;
ddata->vddi = NULL;
}
ddata->in = in; ddata->in = in;
/* TODO: ulps, backlight */ backlight = of_parse_phandle(node, "backlight", 0);
if (backlight) {
ddata->extbldev = of_find_backlight_by_node(backlight);
of_node_put(backlight);
if (!ddata->extbldev)
return -EPROBE_DEFER;
} else {
/* assume native backlight support */
ddata->use_dsi_backlight = true;
}
/* TODO: ulps */
return 0; return 0;
} }
static int dsicm_probe(struct platform_device *pdev) static int dsicm_probe(struct platform_device *pdev)
{ {
struct backlight_properties props;
struct panel_drv_data *ddata; struct panel_drv_data *ddata;
struct backlight_device *bldev = NULL; struct backlight_device *bldev = NULL;
struct device *dev = &pdev->dev; struct device *dev = &pdev->dev;
...@@ -1171,14 +1320,14 @@ static int dsicm_probe(struct platform_device *pdev) ...@@ -1171,14 +1320,14 @@ static int dsicm_probe(struct platform_device *pdev)
if (!pdev->dev.of_node) if (!pdev->dev.of_node)
return -ENODEV; return -ENODEV;
r = dsicm_probe_of(pdev);
if (r)
return r;
ddata->vm.hactive = 864; ddata->vm.hactive = 864;
ddata->vm.vactive = 480; ddata->vm.vactive = 480;
ddata->vm.pixelclock = 864 * 480 * 60; ddata->vm.pixelclock = 864 * 480 * 60;
r = dsicm_probe_of(pdev);
if (r)
return r;
dssdev = &ddata->dssdev; dssdev = &ddata->dssdev;
dssdev->dev = dev; dssdev->dev = dev;
dssdev->driver = &dsicm_ops; dssdev->driver = &dsicm_ops;
...@@ -1200,31 +1349,15 @@ static int dsicm_probe(struct platform_device *pdev) ...@@ -1200,31 +1349,15 @@ static int dsicm_probe(struct platform_device *pdev)
atomic_set(&ddata->do_update, 0); atomic_set(&ddata->do_update, 0);
if (gpio_is_valid(ddata->reset_gpio)) { if (ddata->ext_te_gpio) {
r = devm_gpio_request_one(dev, ddata->reset_gpio, r = devm_request_irq(dev, gpiod_to_irq(ddata->ext_te_gpio),
GPIOF_OUT_INIT_LOW, "taal rst");
if (r) {
dev_err(dev, "failed to request reset gpio\n");
return r;
}
}
if (gpio_is_valid(ddata->ext_te_gpio)) {
r = devm_gpio_request_one(dev, ddata->ext_te_gpio,
GPIOF_IN, "taal irq");
if (r) {
dev_err(dev, "GPIO request failed\n");
return r;
}
r = devm_request_irq(dev, gpio_to_irq(ddata->ext_te_gpio),
dsicm_te_isr, dsicm_te_isr,
IRQF_TRIGGER_RISING, IRQF_TRIGGER_RISING,
"taal vsync", ddata); "taal vsync", ddata);
if (r) { if (r) {
dev_err(dev, "IRQ request failed\n"); dev_err(dev, "IRQ request failed\n");
return r; goto err_reg;
} }
INIT_DEFERRABLE_WORK(&ddata->te_timeout_work, INIT_DEFERRABLE_WORK(&ddata->te_timeout_work,
...@@ -1234,48 +1367,43 @@ static int dsicm_probe(struct platform_device *pdev) ...@@ -1234,48 +1367,43 @@ static int dsicm_probe(struct platform_device *pdev)
} }
ddata->workqueue = create_singlethread_workqueue("dsicm_wq"); ddata->workqueue = create_singlethread_workqueue("dsicm_wq");
if (ddata->workqueue == NULL) { if (!ddata->workqueue) {
dev_err(dev, "can't create workqueue\n"); r = -ENOMEM;
return -ENOMEM; goto err_reg;
} }
INIT_DELAYED_WORK(&ddata->ulps_work, dsicm_ulps_work); INIT_DELAYED_WORK(&ddata->ulps_work, dsicm_ulps_work);
dsicm_hw_reset(ddata); dsicm_hw_reset(ddata);
if (ddata->use_dsi_backlight) { if (ddata->use_dsi_backlight) {
memset(&props, 0, sizeof(props)); struct backlight_properties props = { 0 };
props.max_brightness = 255; props.max_brightness = 255;
props.type = BACKLIGHT_RAW; props.type = BACKLIGHT_RAW;
bldev = backlight_device_register(dev_name(dev),
dev, ddata, &dsicm_bl_ops, &props); bldev = devm_backlight_device_register(dev, dev_name(dev),
dev, ddata, &dsicm_bl_ops, &props);
if (IS_ERR(bldev)) { if (IS_ERR(bldev)) {
r = PTR_ERR(bldev); r = PTR_ERR(bldev);
goto err_bl; goto err_bl;
} }
ddata->bldev = bldev; ddata->bldev = bldev;
bldev->props.fb_blank = FB_BLANK_UNBLANK;
bldev->props.power = FB_BLANK_UNBLANK;
bldev->props.brightness = 255;
dsicm_bl_update_status(bldev);
} }
r = sysfs_create_group(&dev->kobj, &dsicm_attr_group); r = sysfs_create_group(&dev->kobj, &dsicm_attr_group);
if (r) { if (r) {
dev_err(dev, "failed to create sysfs files\n"); dev_err(dev, "failed to create sysfs files\n");
goto err_sysfs_create; goto err_bl;
} }
return 0; return 0;
err_sysfs_create:
backlight_device_unregister(bldev);
err_bl: err_bl:
destroy_workqueue(ddata->workqueue); destroy_workqueue(ddata->workqueue);
err_reg: err_reg:
if (ddata->extbldev)
put_device(&ddata->extbldev->dev);
return r; return r;
} }
...@@ -1283,7 +1411,6 @@ static int __exit dsicm_remove(struct platform_device *pdev) ...@@ -1283,7 +1411,6 @@ static int __exit dsicm_remove(struct platform_device *pdev)
{ {
struct panel_drv_data *ddata = platform_get_drvdata(pdev); struct panel_drv_data *ddata = platform_get_drvdata(pdev);
struct omap_dss_device *dssdev = &ddata->dssdev; struct omap_dss_device *dssdev = &ddata->dssdev;
struct backlight_device *bldev;
dev_dbg(&pdev->dev, "remove\n"); dev_dbg(&pdev->dev, "remove\n");
...@@ -1294,12 +1421,8 @@ static int __exit dsicm_remove(struct platform_device *pdev) ...@@ -1294,12 +1421,8 @@ static int __exit dsicm_remove(struct platform_device *pdev)
sysfs_remove_group(&pdev->dev.kobj, &dsicm_attr_group); sysfs_remove_group(&pdev->dev.kobj, &dsicm_attr_group);
bldev = ddata->bldev; if (ddata->extbldev)
if (bldev != NULL) { put_device(&ddata->extbldev->dev);
bldev->props.power = FB_BLANK_POWERDOWN;
dsicm_bl_update_status(bldev);
backlight_device_unregister(bldev);
}
omap_dss_put_device(ddata->in); omap_dss_put_device(ddata->in);
......
/* /*
* LG.Philips LB035Q02 LCD Panel driver * LG.Philips LB035Q02 LCD Panel driver
* *
* Copyright (C) 2013 Texas Instruments * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/
* Author: Tomi Valkeinen <tomi.valkeinen@ti.com> * Author: Tomi Valkeinen <tomi.valkeinen@ti.com>
* Based on a driver by: Steve Sakoman <steve@sakoman.com> * Based on a driver by: Steve Sakoman <steve@sakoman.com>
* *
......
/* /*
* NEC NL8048HL11 Panel driver * NEC NL8048HL11 Panel driver
* *
* Copyright (C) 2010 Texas Instruments Inc. * Copyright (C) 2010 Texas Instruments Incorporated - http://www.ti.com/
* Author: Erik Gilling <konkers@android.com> * Author: Erik Gilling <konkers@android.com>
* Converted to new DSS device model: Tomi Valkeinen <tomi.valkeinen@ti.com> * Converted to new DSS device model: Tomi Valkeinen <tomi.valkeinen@ti.com>
* *
......
/* /*
* LCD panel driver for Sharp LS037V7DW01 * LCD panel driver for Sharp LS037V7DW01
* *
* Copyright (C) 2013 Texas Instruments * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/
* Author: Tomi Valkeinen <tomi.valkeinen@ti.com> * Author: Tomi Valkeinen <tomi.valkeinen@ti.com>
* *
* This program is free software; you can redistribute it and/or modify it * This program is free software; you can redistribute it and/or modify it
......
...@@ -452,15 +452,27 @@ static int td028ttec1_panel_remove(struct spi_device *spi) ...@@ -452,15 +452,27 @@ static int td028ttec1_panel_remove(struct spi_device *spi)
} }
static const struct of_device_id td028ttec1_of_match[] = { static const struct of_device_id td028ttec1_of_match[] = {
{ .compatible = "omapdss,tpo,td028ttec1", },
/* keep to not break older DTB */
{ .compatible = "omapdss,toppoly,td028ttec1", }, { .compatible = "omapdss,toppoly,td028ttec1", },
{}, {},
}; };
MODULE_DEVICE_TABLE(of, td028ttec1_of_match); MODULE_DEVICE_TABLE(of, td028ttec1_of_match);
static const struct spi_device_id td028ttec1_ids[] = {
{ "toppoly,td028ttec1", 0 },
{ "tpo,td028ttec1", 0},
{ /* sentinel */ }
};
MODULE_DEVICE_TABLE(spi, td028ttec1_ids);
static struct spi_driver td028ttec1_spi_driver = { static struct spi_driver td028ttec1_spi_driver = {
.probe = td028ttec1_panel_probe, .probe = td028ttec1_panel_probe,
.remove = td028ttec1_panel_remove, .remove = td028ttec1_panel_remove,
.id_table = td028ttec1_ids,
.driver = { .driver = {
.name = "panel-tpo-td028ttec1", .name = "panel-tpo-td028ttec1",
...@@ -471,7 +483,6 @@ static struct spi_driver td028ttec1_spi_driver = { ...@@ -471,7 +483,6 @@ static struct spi_driver td028ttec1_spi_driver = {
module_spi_driver(td028ttec1_spi_driver); module_spi_driver(td028ttec1_spi_driver);
MODULE_ALIAS("spi:toppoly,td028ttec1");
MODULE_AUTHOR("H. Nikolaus Schaller <hns@goldelico.com>"); MODULE_AUTHOR("H. Nikolaus Schaller <hns@goldelico.com>");
MODULE_DESCRIPTION("Toppoly TD028TTEC1 panel driver"); MODULE_DESCRIPTION("Toppoly TD028TTEC1 panel driver");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
/*
* OMAP Display Subsystem Base
*
* Copyright (C) 2015-2017 Texas Instruments Incorporated - http://www.ti.com/
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*/
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/of.h> #include <linux/of.h>
......
/* /*
* linux/drivers/video/omap2/dss/core.c
*
* Copyright (C) 2009 Nokia Corporation * Copyright (C) 2009 Nokia Corporation
* Author: Tomi Valkeinen <tomi.valkeinen@nokia.com> * Author: Tomi Valkeinen <tomi.valkeinen@nokia.com>
* *
...@@ -30,38 +28,21 @@ ...@@ -30,38 +28,21 @@
#include "dss.h" #include "dss.h"
/* INIT */ /* INIT */
static int (*dss_output_drv_reg_funcs[])(void) __initdata = { static struct platform_driver * const omap_dss_drivers[] = {
dss_init_platform_driver, &omap_dsshw_driver,
dispc_init_platform_driver, &omap_dispchw_driver,
#ifdef CONFIG_OMAP2_DSS_DSI #ifdef CONFIG_OMAP2_DSS_DSI
dsi_init_platform_driver, &omap_dsihw_driver,
#endif #endif
#ifdef CONFIG_OMAP2_DSS_VENC #ifdef CONFIG_OMAP2_DSS_VENC
venc_init_platform_driver, &omap_venchw_driver,
#endif #endif
#ifdef CONFIG_OMAP4_DSS_HDMI #ifdef CONFIG_OMAP4_DSS_HDMI
hdmi4_init_platform_driver, &omapdss_hdmi4hw_driver,
#endif #endif
#ifdef CONFIG_OMAP5_DSS_HDMI #ifdef CONFIG_OMAP5_DSS_HDMI
hdmi5_init_platform_driver, &omapdss_hdmi5hw_driver,
#endif
};
static void (*dss_output_drv_unreg_funcs[])(void) = {
#ifdef CONFIG_OMAP5_DSS_HDMI
hdmi5_uninit_platform_driver,
#endif
#ifdef CONFIG_OMAP4_DSS_HDMI
hdmi4_uninit_platform_driver,
#endif #endif
#ifdef CONFIG_OMAP2_DSS_VENC
venc_uninit_platform_driver,
#endif
#ifdef CONFIG_OMAP2_DSS_DSI
dsi_uninit_platform_driver,
#endif
dispc_uninit_platform_driver,
dss_uninit_platform_driver,
}; };
static struct platform_device *omap_drm_device; static struct platform_device *omap_drm_device;
...@@ -69,13 +50,11 @@ static struct platform_device *omap_drm_device; ...@@ -69,13 +50,11 @@ static struct platform_device *omap_drm_device;
static int __init omap_dss_init(void) static int __init omap_dss_init(void)
{ {
int r; int r;
int i;
for (i = 0; i < ARRAY_SIZE(dss_output_drv_reg_funcs); ++i) { r = platform_register_drivers(omap_dss_drivers,
r = dss_output_drv_reg_funcs[i](); ARRAY_SIZE(omap_dss_drivers));
if (r) if (r)
goto err_reg; goto err_reg;
}
omap_drm_device = platform_device_register_simple("omapdrm", 0, NULL, 0); omap_drm_device = platform_device_register_simple("omapdrm", 0, NULL, 0);
if (IS_ERR(omap_drm_device)) { if (IS_ERR(omap_drm_device)) {
...@@ -86,22 +65,18 @@ static int __init omap_dss_init(void) ...@@ -86,22 +65,18 @@ static int __init omap_dss_init(void)
return 0; return 0;
err_reg: err_reg:
for (i = ARRAY_SIZE(dss_output_drv_reg_funcs) - i; platform_unregister_drivers(omap_dss_drivers,
i < ARRAY_SIZE(dss_output_drv_reg_funcs); ARRAY_SIZE(omap_dss_drivers));
++i)
dss_output_drv_unreg_funcs[i]();
return r; return r;
} }
static void __exit omap_dss_exit(void) static void __exit omap_dss_exit(void)
{ {
int i;
platform_device_unregister(omap_drm_device); platform_device_unregister(omap_drm_device);
for (i = 0; i < ARRAY_SIZE(dss_output_drv_unreg_funcs); ++i) platform_unregister_drivers(omap_dss_drivers,
dss_output_drv_unreg_funcs[i](); ARRAY_SIZE(omap_dss_drivers));
} }
module_init(omap_dss_init); module_init(omap_dss_init);
......
/* /*
* linux/drivers/video/omap2/dss/dispc.c
*
* Copyright (C) 2009 Nokia Corporation * Copyright (C) 2009 Nokia Corporation
* Author: Tomi Valkeinen <tomi.valkeinen@nokia.com> * Author: Tomi Valkeinen <tomi.valkeinen@nokia.com>
* *
...@@ -4325,6 +4323,17 @@ static void dispc_free_irq(void *dev_id) ...@@ -4325,6 +4323,17 @@ static void dispc_free_irq(void *dev_id)
dispc.user_data = NULL; dispc.user_data = NULL;
} }
static u32 dispc_get_memory_bandwidth_limit(void)
{
u32 limit = 0;
/* Optional maximum memory bandwidth */
of_property_read_u32(dispc.pdev->dev.of_node, "max-memory-bandwidth",
&limit);
return limit;
}
/* /*
* Workaround for errata i734 in DSS dispc * Workaround for errata i734 in DSS dispc
* - LCD1 Gamma Correction Is Not Working When GFX Pipe Is Disabled * - LCD1 Gamma Correction Is Not Working When GFX Pipe Is Disabled
...@@ -4497,6 +4506,8 @@ static const struct dispc_ops dispc_ops = { ...@@ -4497,6 +4506,8 @@ static const struct dispc_ops dispc_ops = {
.get_num_ovls = dispc_get_num_ovls, .get_num_ovls = dispc_get_num_ovls,
.get_num_mgrs = dispc_get_num_mgrs, .get_num_mgrs = dispc_get_num_mgrs,
.get_memory_bandwidth_limit = dispc_get_memory_bandwidth_limit,
.mgr_enable = dispc_mgr_enable, .mgr_enable = dispc_mgr_enable,
.mgr_is_enabled = dispc_mgr_is_enabled, .mgr_is_enabled = dispc_mgr_is_enabled,
.mgr_get_vsync_irq = dispc_mgr_get_vsync_irq, .mgr_get_vsync_irq = dispc_mgr_get_vsync_irq,
...@@ -4685,7 +4696,7 @@ static const struct dev_pm_ops dispc_pm_ops = { ...@@ -4685,7 +4696,7 @@ static const struct dev_pm_ops dispc_pm_ops = {
.runtime_resume = dispc_runtime_resume, .runtime_resume = dispc_runtime_resume,
}; };
static struct platform_driver omap_dispchw_driver = { struct platform_driver omap_dispchw_driver = {
.probe = dispc_probe, .probe = dispc_probe,
.remove = dispc_remove, .remove = dispc_remove,
.driver = { .driver = {
...@@ -4695,13 +4706,3 @@ static struct platform_driver omap_dispchw_driver = { ...@@ -4695,13 +4706,3 @@ static struct platform_driver omap_dispchw_driver = {
.suppress_bind_attrs = true, .suppress_bind_attrs = true,
}, },
}; };
int __init dispc_init_platform_driver(void)
{
return platform_driver_register(&omap_dispchw_driver);
}
void dispc_uninit_platform_driver(void)
{
platform_driver_unregister(&omap_dispchw_driver);
}
/* /*
* linux/drivers/video/omap2/dss/dispc.h * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
*
* Copyright (C) 2011 Texas Instruments
* Author: Archit Taneja <archit@ti.com> * Author: Archit Taneja <archit@ti.com>
* *
*
* This program is free software; you can redistribute it and/or modify it * This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 as published by * under the terms of the GNU General Public License version 2 as published by
* the Free Software Foundation. * the Free Software Foundation.
......
/* /*
* linux/drivers/video/omap2/dss/dispc_coefs.c * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
*
* Copyright (C) 2011 Texas Instruments
* Author: Chandrabhanu Mahapatra <cmahapatra@ti.com> * Author: Chandrabhanu Mahapatra <cmahapatra@ti.com>
* *
* This program is free software; you can redistribute it and/or modify it * This program is free software; you can redistribute it and/or modify it
......
/* /*
* linux/drivers/video/omap2/dss/display.c
*
* Copyright (C) 2009 Nokia Corporation * Copyright (C) 2009 Nokia Corporation
* Author: Tomi Valkeinen <tomi.valkeinen@nokia.com> * Author: Tomi Valkeinen <tomi.valkeinen@nokia.com>
* *
...@@ -175,17 +173,3 @@ struct omap_dss_device *omap_dss_get_next_device(struct omap_dss_device *from) ...@@ -175,17 +173,3 @@ struct omap_dss_device *omap_dss_get_next_device(struct omap_dss_device *from)
return dssdev; return dssdev;
} }
EXPORT_SYMBOL(omap_dss_get_next_device); EXPORT_SYMBOL(omap_dss_get_next_device);
struct omap_dss_device *omap_dss_find_device(void *data,
int (*match)(struct omap_dss_device *dssdev, void *data))
{
struct omap_dss_device *dssdev = NULL;
while ((dssdev = omap_dss_get_next_device(dssdev)) != NULL) {
if (match(dssdev, data))
return dssdev;
}
return NULL;
}
EXPORT_SYMBOL(omap_dss_find_device);
/* /*
* linux/drivers/video/omap2/dss/dpi.c
*
* Copyright (C) 2009 Nokia Corporation * Copyright (C) 2009 Nokia Corporation
* Author: Tomi Valkeinen <tomi.valkeinen@nokia.com> * Author: Tomi Valkeinen <tomi.valkeinen@nokia.com>
* *
...@@ -52,8 +50,6 @@ struct dpi_data { ...@@ -52,8 +50,6 @@ struct dpi_data {
int data_lines; int data_lines;
struct omap_dss_device output; struct omap_dss_device output;
bool port_initialized;
}; };
static struct dpi_data *dpi_get_data_from_dssdev(struct omap_dss_device *dssdev) static struct dpi_data *dpi_get_data_from_dssdev(struct omap_dss_device *dssdev)
...@@ -786,8 +782,6 @@ int dpi_init_port(struct platform_device *pdev, struct device_node *port, ...@@ -786,8 +782,6 @@ int dpi_init_port(struct platform_device *pdev, struct device_node *port,
dpi_init_output_port(dpi, port); dpi_init_output_port(dpi, port);
dpi->port_initialized = true;
return 0; return 0;
err_datalines: err_datalines:
...@@ -800,7 +794,7 @@ void dpi_uninit_port(struct device_node *port) ...@@ -800,7 +794,7 @@ void dpi_uninit_port(struct device_node *port)
{ {
struct dpi_data *dpi = port->data; struct dpi_data *dpi = port->data;
if (!dpi->port_initialized) if (!dpi)
return; return;
dpi_uninit_output_port(port); dpi_uninit_output_port(port);
......
/* /*
* linux/drivers/video/omap2/dss/dsi.c
*
* Copyright (C) 2009 Nokia Corporation * Copyright (C) 2009 Nokia Corporation
* Author: Tomi Valkeinen <tomi.valkeinen@nokia.com> * Author: Tomi Valkeinen <tomi.valkeinen@nokia.com>
* *
...@@ -5660,7 +5658,7 @@ static const struct dev_pm_ops dsi_pm_ops = { ...@@ -5660,7 +5658,7 @@ static const struct dev_pm_ops dsi_pm_ops = {
.runtime_resume = dsi_runtime_resume, .runtime_resume = dsi_runtime_resume,
}; };
static struct platform_driver omap_dsihw_driver = { struct platform_driver omap_dsihw_driver = {
.probe = dsi_probe, .probe = dsi_probe,
.remove = dsi_remove, .remove = dsi_remove,
.driver = { .driver = {
...@@ -5670,13 +5668,3 @@ static struct platform_driver omap_dsihw_driver = { ...@@ -5670,13 +5668,3 @@ static struct platform_driver omap_dsihw_driver = {
.suppress_bind_attrs = true, .suppress_bind_attrs = true,
}, },
}; };
int __init dsi_init_platform_driver(void)
{
return platform_driver_register(&omap_dsihw_driver);
}
void dsi_uninit_platform_driver(void)
{
platform_driver_unregister(&omap_dsihw_driver);
}
/* /*
* Copyright (C) 2013 Texas Instruments * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/
* Author: Tomi Valkeinen <tomi.valkeinen@ti.com> * Author: Tomi Valkeinen <tomi.valkeinen@ti.com>
* *
* This program is free software; you can redistribute it and/or modify it * This program is free software; you can redistribute it and/or modify it
......
/* /*
* linux/drivers/video/omap2/dss/dss.c
*
* Copyright (C) 2009 Nokia Corporation * Copyright (C) 2009 Nokia Corporation
* Author: Tomi Valkeinen <tomi.valkeinen@nokia.com> * Author: Tomi Valkeinen <tomi.valkeinen@nokia.com>
* *
...@@ -23,6 +21,7 @@ ...@@ -23,6 +21,7 @@
#define DSS_SUBSYS_NAME "DSS" #define DSS_SUBSYS_NAME "DSS"
#include <linux/debugfs.h> #include <linux/debugfs.h>
#include <linux/dma-mapping.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/io.h> #include <linux/io.h>
...@@ -367,7 +366,8 @@ const char *dss_get_clk_source_name(enum dss_clk_source clk_src) ...@@ -367,7 +366,8 @@ const char *dss_get_clk_source_name(enum dss_clk_source clk_src)
return dss_generic_clk_source_names[clk_src]; return dss_generic_clk_source_names[clk_src];
} }
void dss_dump_clocks(struct seq_file *s) #if defined(CONFIG_OMAP2_DSS_DEBUGFS)
static void dss_dump_clocks(struct seq_file *s)
{ {
const char *fclk_name; const char *fclk_name;
unsigned long fclk_rate; unsigned long fclk_rate;
...@@ -386,6 +386,7 @@ void dss_dump_clocks(struct seq_file *s) ...@@ -386,6 +386,7 @@ void dss_dump_clocks(struct seq_file *s)
dss_runtime_put(); dss_runtime_put();
} }
#endif
static void dss_dump_regs(struct seq_file *s) static void dss_dump_regs(struct seq_file *s)
{ {
...@@ -1441,6 +1442,12 @@ static int dss_probe(struct platform_device *pdev) ...@@ -1441,6 +1442,12 @@ static int dss_probe(struct platform_device *pdev)
dss.pdev = pdev; dss.pdev = pdev;
r = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32));
if (r) {
dev_err(&pdev->dev, "Failed to set the DMA mask\n");
return r;
}
/* /*
* The various OMAP3-based SoCs can't be told apart using the compatible * The various OMAP3-based SoCs can't be told apart using the compatible
* string, use SoC device matching. * string, use SoC device matching.
...@@ -1527,7 +1534,7 @@ static const struct dev_pm_ops dss_pm_ops = { ...@@ -1527,7 +1534,7 @@ static const struct dev_pm_ops dss_pm_ops = {
.runtime_resume = dss_runtime_resume, .runtime_resume = dss_runtime_resume,
}; };
static struct platform_driver omap_dsshw_driver = { struct platform_driver omap_dsshw_driver = {
.probe = dss_probe, .probe = dss_probe,
.remove = dss_remove, .remove = dss_remove,
.shutdown = dss_shutdown, .shutdown = dss_shutdown,
...@@ -1538,13 +1545,3 @@ static struct platform_driver omap_dsshw_driver = { ...@@ -1538,13 +1545,3 @@ static struct platform_driver omap_dsshw_driver = {
.suppress_bind_attrs = true, .suppress_bind_attrs = true,
}, },
}; };
int __init dss_init_platform_driver(void)
{
return platform_driver_register(&omap_dsshw_driver);
}
void dss_uninit_platform_driver(void)
{
platform_driver_unregister(&omap_dsshw_driver);
}
/* /*
* linux/drivers/video/omap2/dss/dss.h
*
* Copyright (C) 2009 Nokia Corporation * Copyright (C) 2009 Nokia Corporation
* Author: Tomi Valkeinen <tomi.valkeinen@nokia.com> * Author: Tomi Valkeinen <tomi.valkeinen@nokia.com>
* *
...@@ -264,9 +262,6 @@ static inline int dss_debugfs_create_file(const char *name, ...@@ -264,9 +262,6 @@ static inline int dss_debugfs_create_file(const char *name,
} }
#endif /* CONFIG_OMAP2_DSS_DEBUGFS */ #endif /* CONFIG_OMAP2_DSS_DEBUGFS */
int dss_init_platform_driver(void) __init;
void dss_uninit_platform_driver(void);
int dss_runtime_get(void); int dss_runtime_get(void);
void dss_runtime_put(void); void dss_runtime_put(void);
...@@ -277,7 +272,6 @@ int dss_dpi_select_source(int port, enum omap_channel channel); ...@@ -277,7 +272,6 @@ int dss_dpi_select_source(int port, enum omap_channel channel);
void dss_select_hdmi_venc_clk_source(enum dss_hdmi_venc_clk_source_select); void dss_select_hdmi_venc_clk_source(enum dss_hdmi_venc_clk_source_select);
enum dss_hdmi_venc_clk_source_select dss_get_hdmi_venc_clk_source(void); enum dss_hdmi_venc_clk_source_select dss_get_hdmi_venc_clk_source(void);
const char *dss_get_clk_source_name(enum dss_clk_source clk_src); const char *dss_get_clk_source_name(enum dss_clk_source clk_src);
void dss_dump_clocks(struct seq_file *s);
/* DSS VIDEO PLL */ /* DSS VIDEO PLL */
struct dss_pll *dss_video_pll_init(struct platform_device *pdev, int id, struct dss_pll *dss_video_pll_init(struct platform_device *pdev, int id,
...@@ -329,9 +323,6 @@ static inline void sdi_uninit_port(struct device_node *port) ...@@ -329,9 +323,6 @@ static inline void sdi_uninit_port(struct device_node *port)
struct dentry; struct dentry;
struct file_operations; struct file_operations;
int dsi_init_platform_driver(void) __init;
void dsi_uninit_platform_driver(void);
void dsi_dump_clocks(struct seq_file *s); void dsi_dump_clocks(struct seq_file *s);
void dsi_irq_handler(void); void dsi_irq_handler(void);
...@@ -355,8 +346,6 @@ static inline void dpi_uninit_port(struct device_node *port) ...@@ -355,8 +346,6 @@ static inline void dpi_uninit_port(struct device_node *port)
#endif #endif
/* DISPC */ /* DISPC */
int dispc_init_platform_driver(void) __init;
void dispc_uninit_platform_driver(void);
void dispc_dump_clocks(struct seq_file *s); void dispc_dump_clocks(struct seq_file *s);
int dispc_runtime_get(void); int dispc_runtime_get(void);
...@@ -400,18 +389,6 @@ void dispc_wb_set_channel_in(enum dss_writeback_channel channel); ...@@ -400,18 +389,6 @@ void dispc_wb_set_channel_in(enum dss_writeback_channel channel);
int dispc_wb_setup(const struct omap_dss_writeback_info *wi, int dispc_wb_setup(const struct omap_dss_writeback_info *wi,
bool mem_to_mem, const struct videomode *vm); bool mem_to_mem, const struct videomode *vm);
/* VENC */
int venc_init_platform_driver(void) __init;
void venc_uninit_platform_driver(void);
/* HDMI */
int hdmi4_init_platform_driver(void) __init;
void hdmi4_uninit_platform_driver(void);
int hdmi5_init_platform_driver(void) __init;
void hdmi5_uninit_platform_driver(void);
#ifdef CONFIG_OMAP2_DSS_COLLECT_IRQ_STATS #ifdef CONFIG_OMAP2_DSS_COLLECT_IRQ_STATS
static inline void dss_collect_irq_stats(u32 irqstatus, unsigned *irq_arr) static inline void dss_collect_irq_stats(u32 irqstatus, unsigned *irq_arr)
{ {
...@@ -455,4 +432,19 @@ int dss_pll_write_config_type_b(struct dss_pll *pll, ...@@ -455,4 +432,19 @@ int dss_pll_write_config_type_b(struct dss_pll *pll,
const struct dss_pll_clock_info *cinfo); const struct dss_pll_clock_info *cinfo);
int dss_pll_wait_reset_done(struct dss_pll *pll); int dss_pll_wait_reset_done(struct dss_pll *pll);
extern struct platform_driver omap_dsshw_driver;
extern struct platform_driver omap_dispchw_driver;
#ifdef CONFIG_OMAP2_DSS_DSI
extern struct platform_driver omap_dsihw_driver;
#endif
#ifdef CONFIG_OMAP2_DSS_VENC
extern struct platform_driver omap_venchw_driver;
#endif
#ifdef CONFIG_OMAP4_DSS_HDMI
extern struct platform_driver omapdss_hdmi4hw_driver;
#endif
#ifdef CONFIG_OMAP5_DSS_HDMI
extern struct platform_driver omapdss_hdmi5hw_driver;
#endif
#endif #endif
/* /*
* HDMI interface DSS driver for TI's OMAP4 family of SoCs. * HDMI interface DSS driver for TI's OMAP4 family of SoCs.
*
* Copyright (C) 2010-2011 Texas Instruments Incorporated - http://www.ti.com/ * Copyright (C) 2010-2011 Texas Instruments Incorporated - http://www.ti.com/
* Authors: Yong Zhi * Authors: Yong Zhi
* Mythri pk <mythripk@ti.com> * Mythri pk <mythripk@ti.com>
...@@ -844,7 +845,7 @@ static const struct of_device_id hdmi_of_match[] = { ...@@ -844,7 +845,7 @@ static const struct of_device_id hdmi_of_match[] = {
{}, {},
}; };
static struct platform_driver omapdss_hdmihw_driver = { struct platform_driver omapdss_hdmi4hw_driver = {
.probe = hdmi4_probe, .probe = hdmi4_probe,
.remove = hdmi4_remove, .remove = hdmi4_remove,
.driver = { .driver = {
...@@ -854,13 +855,3 @@ static struct platform_driver omapdss_hdmihw_driver = { ...@@ -854,13 +855,3 @@ static struct platform_driver omapdss_hdmihw_driver = {
.suppress_bind_attrs = true, .suppress_bind_attrs = true,
}, },
}; };
int __init hdmi4_init_platform_driver(void)
{
return platform_driver_register(&omapdss_hdmihw_driver);
}
void hdmi4_uninit_platform_driver(void)
{
platform_driver_unregister(&omapdss_hdmihw_driver);
}
/* /*
* ti_hdmi_4xxx_ip.c
*
* HDMI TI81xx, TI38xx, TI OMAP4 etc IP driver Library * HDMI TI81xx, TI38xx, TI OMAP4 etc IP driver Library
*
* Copyright (C) 2010-2011 Texas Instruments Incorporated - http://www.ti.com/ * Copyright (C) 2010-2011 Texas Instruments Incorporated - http://www.ti.com/
* Authors: Yong Zhi * Authors: Yong Zhi
* Mythri pk <mythripk@ti.com> * Mythri pk <mythripk@ti.com>
......
/* /*
* HDMI driver for OMAP5 * HDMI driver for OMAP5
* *
* Copyright (C) 2014 Texas Instruments Incorporated * Copyright (C) 2014 Texas Instruments Incorporated - http://www.ti.com/
* *
* Authors: * Authors:
* Yong Zhi * Yong Zhi
...@@ -841,7 +841,7 @@ static const struct of_device_id hdmi_of_match[] = { ...@@ -841,7 +841,7 @@ static const struct of_device_id hdmi_of_match[] = {
{}, {},
}; };
static struct platform_driver omapdss_hdmihw_driver = { struct platform_driver omapdss_hdmi5hw_driver = {
.probe = hdmi5_probe, .probe = hdmi5_probe,
.remove = hdmi5_remove, .remove = hdmi5_remove,
.driver = { .driver = {
...@@ -851,13 +851,3 @@ static struct platform_driver omapdss_hdmihw_driver = { ...@@ -851,13 +851,3 @@ static struct platform_driver omapdss_hdmihw_driver = {
.suppress_bind_attrs = true, .suppress_bind_attrs = true,
}, },
}; };
int __init hdmi5_init_platform_driver(void)
{
return platform_driver_register(&omapdss_hdmihw_driver);
}
void hdmi5_uninit_platform_driver(void)
{
platform_driver_unregister(&omapdss_hdmihw_driver);
}
/* /*
* OMAP5 HDMI CORE IP driver library * OMAP5 HDMI CORE IP driver library
* *
* Copyright (C) 2014 Texas Instruments Incorporated * Copyright (C) 2014 Texas Instruments Incorporated - http://www.ti.com/
*
* Authors: * Authors:
* Yong Zhi * Yong Zhi
* Mythri pk * Mythri pk
......
/* /*
* HDMI PHY * HDMI PHY
* *
* Copyright (C) 2013 Texas Instruments Incorporated * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/
* *
* This program is free software; you can redistribute it and/or modify it * This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 as published by * under the terms of the GNU General Public License version 2 as published by
......
/* /*
* HDMI PLL * HDMI PLL
* *
* Copyright (C) 2013 Texas Instruments Incorporated * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/
* *
* This program is free software; you can redistribute it and/or modify it * This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 as published by * under the terms of the GNU General Public License version 2 as published by
......
/* /*
* HDMI wrapper * HDMI wrapper
* *
* Copyright (C) 2013 Texas Instruments Incorporated * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/
* *
* This program is free software; you can redistribute it and/or modify it * This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 as published by * under the terms of the GNU General Public License version 2 as published by
......
/* /*
* Copyright (C) 2014 Texas Instruments * Copyright (C) 2014 Texas Instruments Incorporated - http://www.ti.com/
* Author: Tomi Valkeinen <tomi.valkeinen@ti.com> * Author: Tomi Valkeinen <tomi.valkeinen@ti.com>
* *
* This program is free software; you can redistribute it and/or modify it * This program is free software; you can redistribute it and/or modify it
......
/* /*
* Copyright (C) 2016 Texas Instruments * Copyright (C) 2016 Texas Instruments Incorporated - http://www.ti.com/
* Author: Tomi Valkeinen <tomi.valkeinen@ti.com> * Author: Tomi Valkeinen <tomi.valkeinen@ti.com>
* *
* This program is free software; you can redistribute it and/or modify it * This program is free software; you can redistribute it and/or modify it
...@@ -563,6 +563,8 @@ struct omap_dss_driver { ...@@ -563,6 +563,8 @@ struct omap_dss_driver {
struct videomode *vm); struct videomode *vm);
void (*get_timings)(struct omap_dss_device *dssdev, void (*get_timings)(struct omap_dss_device *dssdev,
struct videomode *vm); struct videomode *vm);
void (*get_size)(struct omap_dss_device *dssdev,
unsigned int *width, unsigned int *height);
int (*set_wss)(struct omap_dss_device *dssdev, u32 wss); int (*set_wss)(struct omap_dss_device *dssdev, u32 wss);
u32 (*get_wss)(struct omap_dss_device *dssdev); u32 (*get_wss)(struct omap_dss_device *dssdev);
...@@ -585,9 +587,6 @@ struct omap_dss_driver { ...@@ -585,9 +587,6 @@ struct omap_dss_driver {
bool omapdss_is_initialized(void); bool omapdss_is_initialized(void);
int omap_dss_register_driver(struct omap_dss_driver *);
void omap_dss_unregister_driver(struct omap_dss_driver *);
int omapdss_register_display(struct omap_dss_device *dssdev); int omapdss_register_display(struct omap_dss_device *dssdev);
void omapdss_unregister_display(struct omap_dss_device *dssdev); void omapdss_unregister_display(struct omap_dss_device *dssdev);
...@@ -595,9 +594,6 @@ struct omap_dss_device *omap_dss_get_device(struct omap_dss_device *dssdev); ...@@ -595,9 +594,6 @@ struct omap_dss_device *omap_dss_get_device(struct omap_dss_device *dssdev);
void omap_dss_put_device(struct omap_dss_device *dssdev); void omap_dss_put_device(struct omap_dss_device *dssdev);
#define for_each_dss_dev(d) while ((d = omap_dss_get_next_device(d)) != NULL) #define for_each_dss_dev(d) while ((d = omap_dss_get_next_device(d)) != NULL)
struct omap_dss_device *omap_dss_get_next_device(struct omap_dss_device *from); struct omap_dss_device *omap_dss_get_next_device(struct omap_dss_device *from);
struct omap_dss_device *omap_dss_find_device(void *data,
int (*match)(struct omap_dss_device *dssdev, void *data));
int omap_dss_get_num_overlay_managers(void); int omap_dss_get_num_overlay_managers(void);
...@@ -695,6 +691,8 @@ struct dispc_ops { ...@@ -695,6 +691,8 @@ struct dispc_ops {
int (*get_num_ovls)(void); int (*get_num_ovls)(void);
int (*get_num_mgrs)(void); int (*get_num_mgrs)(void);
u32 (*get_memory_bandwidth_limit)(void);
void (*mgr_enable)(enum omap_channel channel, bool enable); void (*mgr_enable)(enum omap_channel channel, bool enable);
bool (*mgr_is_enabled)(enum omap_channel channel); bool (*mgr_is_enabled)(enum omap_channel channel);
u32 (*mgr_get_vsync_irq)(enum omap_channel channel); u32 (*mgr_get_vsync_irq)(enum omap_channel channel);
......
/* /*
* Copyright (C) 2012 Texas Instruments Ltd * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/
* Author: Archit Taneja <archit@ti.com> * Author: Archit Taneja <archit@ti.com>
* *
* This program is free software; you can redistribute it and/or modify it * This program is free software; you can redistribute it and/or modify it
......
/* /*
* Copyright (C) 2014 Texas Instruments Incorporated * Copyright (C) 2014 Texas Instruments Incorporated - http://www.ti.com/
* *
* This program is free software; you can redistribute it and/or modify it * This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 as published by * under the terms of the GNU General Public License version 2 as published by
......
/* /*
* linux/drivers/video/omap2/dss/sdi.c
*
* Copyright (C) 2009 Nokia Corporation * Copyright (C) 2009 Nokia Corporation
* Author: Tomi Valkeinen <tomi.valkeinen@nokia.com> * Author: Tomi Valkeinen <tomi.valkeinen@nokia.com>
* *
......
/* /*
* linux/drivers/video/omap2/dss/venc.c
*
* Copyright (C) 2009 Nokia Corporation * Copyright (C) 2009 Nokia Corporation
* Author: Tomi Valkeinen <tomi.valkeinen@nokia.com> * Author: Tomi Valkeinen <tomi.valkeinen@nokia.com>
* *
...@@ -857,10 +855,10 @@ static int venc_probe_of(struct platform_device *pdev) ...@@ -857,10 +855,10 @@ static int venc_probe_of(struct platform_device *pdev)
of_node_put(ep); of_node_put(ep);
return 0; return 0;
err: err:
of_node_put(ep); of_node_put(ep);
return r;
return 0;
} }
/* VENC HW IP initialisation */ /* VENC HW IP initialisation */
...@@ -986,7 +984,7 @@ static const struct of_device_id venc_of_match[] = { ...@@ -986,7 +984,7 @@ static const struct of_device_id venc_of_match[] = {
{}, {},
}; };
static struct platform_driver omap_venchw_driver = { struct platform_driver omap_venchw_driver = {
.probe = venc_probe, .probe = venc_probe,
.remove = venc_remove, .remove = venc_remove,
.driver = { .driver = {
...@@ -996,13 +994,3 @@ static struct platform_driver omap_venchw_driver = { ...@@ -996,13 +994,3 @@ static struct platform_driver omap_venchw_driver = {
.suppress_bind_attrs = true, .suppress_bind_attrs = true,
}, },
}; };
int __init venc_init_platform_driver(void)
{
return platform_driver_register(&omap_venchw_driver);
}
void venc_uninit_platform_driver(void)
{
platform_driver_unregister(&omap_venchw_driver);
}
/* /*
* Copyright (C) 2014 Texas Instruments Ltd * Copyright (C) 2014 Texas Instruments Incorporated - http://www.ti.com/
* *
* This program is free software; you can redistribute it and/or modify it * This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 as published by * under the terms of the GNU General Public License version 2 as published by
* the Free Software Foundation. * the Free Software Foundation.
* *
* You should have received a copy of the GNU General Public License along with * This program is distributed in the hope that it will be useful, but WITHOUT
* this program. If not, see <http://www.gnu.org/licenses/>. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
*/ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*/
#include <linux/clk.h> #include <linux/clk.h>
#include <linux/delay.h> #include <linux/delay.h>
......
/* /*
* drivers/gpu/drm/omapdrm/omap_connector.c * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
*
* Copyright (C) 2011 Texas Instruments
* Author: Rob Clark <rob@ti.com> * Author: Rob Clark <rob@ti.com>
* *
* This program is free software; you can redistribute it and/or modify it * This program is free software; you can redistribute it and/or modify it
...@@ -149,6 +147,12 @@ static int omap_connector_get_modes(struct drm_connector *connector) ...@@ -149,6 +147,12 @@ static int omap_connector_get_modes(struct drm_connector *connector)
drm_mode_set_name(mode); drm_mode_set_name(mode);
drm_mode_probed_add(connector, mode); drm_mode_probed_add(connector, mode);
if (dssdrv->get_size) {
dssdrv->get_size(dssdev,
&connector->display_info.width_mm,
&connector->display_info.height_mm);
}
n = 1; n = 1;
} }
......
/*
* omap_connector.h -- OMAP DRM Connector
*
* Copyright (C) 2011 Texas Instruments
* Author: Rob Clark <rob@ti.com>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 as published by
* the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __OMAPDRM_CONNECTOR_H__
#define __OMAPDRM_CONNECTOR_H__
#include <linux/types.h>
struct drm_connector;
struct drm_device;
struct drm_encoder;
struct omap_dss_device;
struct drm_connector *omap_connector_init(struct drm_device *dev,
int connector_type, struct omap_dss_device *dssdev,
struct drm_encoder *encoder);
struct drm_encoder *omap_connector_attached_encoder(
struct drm_connector *connector);
bool omap_connector_get_hdmi_mode(struct drm_connector *connector);
#endif /* __OMAPDRM_CONNECTOR_H__ */
/* /*
* drivers/gpu/drm/omapdrm/omap_crtc.c * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
*
* Copyright (C) 2011 Texas Instruments
* Author: Rob Clark <rob@ti.com> * Author: Rob Clark <rob@ti.com>
* *
* This program is free software; you can redistribute it and/or modify it * This program is free software; you can redistribute it and/or modify it
...@@ -23,6 +21,7 @@ ...@@ -23,6 +21,7 @@
#include <drm/drm_crtc_helper.h> #include <drm/drm_crtc_helper.h>
#include <drm/drm_mode.h> #include <drm/drm_mode.h>
#include <drm/drm_plane_helper.h> #include <drm/drm_plane_helper.h>
#include <linux/math64.h>
#include "omap_drv.h" #include "omap_drv.h"
...@@ -400,6 +399,41 @@ static void omap_crtc_atomic_disable(struct drm_crtc *crtc, ...@@ -400,6 +399,41 @@ static void omap_crtc_atomic_disable(struct drm_crtc *crtc,
drm_crtc_vblank_off(crtc); drm_crtc_vblank_off(crtc);
} }
static enum drm_mode_status omap_crtc_mode_valid(struct drm_crtc *crtc,
const struct drm_display_mode *mode)
{
struct omap_drm_private *priv = crtc->dev->dev_private;
/* Check for bandwidth limit */
if (priv->max_bandwidth) {
/*
* Estimation for the bandwidth need of a given mode with one
* full screen plane:
* bandwidth = resolution * 32bpp * (pclk / (vtotal * htotal))
* ^^ Refresh rate ^^
*
* The interlaced mode is taken into account by using the
* pixelclock in the calculation.
*
* The equation is rearranged for 64bit arithmetic.
*/
uint64_t bandwidth = mode->clock * 1000;
unsigned int bpp = 4;
bandwidth = bandwidth * mode->hdisplay * mode->vdisplay * bpp;
bandwidth = div_u64(bandwidth, mode->htotal * mode->vtotal);
/*
* Reject modes which would need more bandwidth if used with one
* full resolution plane (most common use case).
*/
if (priv->max_bandwidth < bandwidth)
return MODE_BAD;
}
return MODE_OK;
}
static void omap_crtc_mode_set_nofb(struct drm_crtc *crtc) static void omap_crtc_mode_set_nofb(struct drm_crtc *crtc)
{ {
struct omap_crtc *omap_crtc = to_omap_crtc(crtc); struct omap_crtc *omap_crtc = to_omap_crtc(crtc);
...@@ -621,6 +655,7 @@ static const struct drm_crtc_helper_funcs omap_crtc_helper_funcs = { ...@@ -621,6 +655,7 @@ static const struct drm_crtc_helper_funcs omap_crtc_helper_funcs = {
.atomic_flush = omap_crtc_atomic_flush, .atomic_flush = omap_crtc_atomic_flush,
.atomic_enable = omap_crtc_atomic_enable, .atomic_enable = omap_crtc_atomic_enable,
.atomic_disable = omap_crtc_atomic_disable, .atomic_disable = omap_crtc_atomic_disable,
.mode_valid = omap_crtc_mode_valid,
}; };
/* ----------------------------------------------------------------------------- /* -----------------------------------------------------------------------------
......
/*
* omap_crtc.h -- OMAP DRM CRTC
*
* Copyright (C) 2011 Texas Instruments
* Author: Rob Clark <rob@ti.com>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 as published by
* the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __OMAPDRM_CRTC_H__
#define __OMAPDRM_CRTC_H__
#include <linux/types.h>
enum omap_channel;
struct drm_crtc;
struct drm_device;
struct drm_plane;
struct omap_dss_device;
struct videomode;
struct videomode *omap_crtc_timings(struct drm_crtc *crtc);
enum omap_channel omap_crtc_channel(struct drm_crtc *crtc);
void omap_crtc_pre_init(void);
void omap_crtc_pre_uninit(void);
struct drm_crtc *omap_crtc_init(struct drm_device *dev,
struct drm_plane *plane, struct omap_dss_device *dssdev);
int omap_crtc_wait_pending(struct drm_crtc *crtc);
void omap_crtc_error_irq(struct drm_crtc *crtc, uint32_t irqstatus);
void omap_crtc_vblank_irq(struct drm_crtc *crtc);
#endif /* __OMAPDRM_CRTC_H__ */
/* /*
* drivers/gpu/drm/omapdrm/omap_debugfs.c * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
*
* Copyright (C) 2011 Texas Instruments
* Author: Rob Clark <rob.clark@linaro.org> * Author: Rob Clark <rob.clark@linaro.org>
* *
* This program is free software; you can redistribute it and/or modify it * This program is free software; you can redistribute it and/or modify it
......
/* /*
*
* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
* Author: Rob Clark <rob@ti.com> * Author: Rob Clark <rob@ti.com>
* Andy Gross <andy.gross@ti.com> * Andy Gross <andy.gross@ti.com>
...@@ -13,6 +12,7 @@ ...@@ -13,6 +12,7 @@
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
*/ */
#ifndef OMAP_DMM_PRIV_H #ifndef OMAP_DMM_PRIV_H
#define OMAP_DMM_PRIV_H #define OMAP_DMM_PRIV_H
...@@ -59,12 +59,12 @@ ...@@ -59,12 +59,12 @@
#define DMM_IRQSTAT_ERR_UPD_DATA (1<<6) #define DMM_IRQSTAT_ERR_UPD_DATA (1<<6)
#define DMM_IRQSTAT_ERR_LUT_MISS (1<<7) #define DMM_IRQSTAT_ERR_LUT_MISS (1<<7)
#define DMM_IRQSTAT_ERR_MASK (DMM_IRQ_STAT_ERR_INV_DSC | \ #define DMM_IRQSTAT_ERR_MASK (DMM_IRQSTAT_ERR_INV_DSC | \
DMM_IRQ_STAT_ERR_INV_DATA | \ DMM_IRQSTAT_ERR_INV_DATA | \
DMM_IRQ_STAT_ERR_UPD_AREA | \ DMM_IRQSTAT_ERR_UPD_AREA | \
DMM_IRQ_STAT_ERR_UPD_CTRL | \ DMM_IRQSTAT_ERR_UPD_CTRL | \
DMM_IRQ_STAT_ERR_UPD_DATA | \ DMM_IRQSTAT_ERR_UPD_DATA | \
DMM_IRQ_STAT_ERR_LUT_MISS) DMM_IRQSTAT_ERR_LUT_MISS)
#define DMM_PATSTATUS_READY (1<<0) #define DMM_PATSTATUS_READY (1<<0)
#define DMM_PATSTATUS_VALID (1<<1) #define DMM_PATSTATUS_VALID (1<<1)
......
/* /*
* DMM IOMMU driver support functions for TI OMAP processors. * DMM IOMMU driver support functions for TI OMAP processors.
* *
* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
* Author: Rob Clark <rob@ti.com> * Author: Rob Clark <rob@ti.com>
* Andy Gross <andy.gross@ti.com> * Andy Gross <andy.gross@ti.com>
* *
* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
*
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as * modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation version 2. * published by the Free Software Foundation version 2.
...@@ -121,14 +120,22 @@ static int wait_status(struct refill_engine *engine, uint32_t wait_mask) ...@@ -121,14 +120,22 @@ static int wait_status(struct refill_engine *engine, uint32_t wait_mask)
while (true) { while (true) {
r = dmm_read(dmm, reg[PAT_STATUS][engine->id]); r = dmm_read(dmm, reg[PAT_STATUS][engine->id]);
err = r & DMM_PATSTATUS_ERR; err = r & DMM_PATSTATUS_ERR;
if (err) if (err) {
dev_err(dmm->dev,
"%s: error (engine%d). PAT_STATUS: 0x%08x\n",
__func__, engine->id, r);
return -EFAULT; return -EFAULT;
}
if ((r & wait_mask) == wait_mask) if ((r & wait_mask) == wait_mask)
break; break;
if (--i == 0) if (--i == 0) {
dev_err(dmm->dev,
"%s: timeout (engine%d). PAT_STATUS: 0x%08x\n",
__func__, engine->id, r);
return -ETIMEDOUT; return -ETIMEDOUT;
}
udelay(1); udelay(1);
} }
...@@ -158,6 +165,11 @@ static irqreturn_t omap_dmm_irq_handler(int irq, void *arg) ...@@ -158,6 +165,11 @@ static irqreturn_t omap_dmm_irq_handler(int irq, void *arg)
dmm_write(dmm, status, DMM_PAT_IRQSTATUS); dmm_write(dmm, status, DMM_PAT_IRQSTATUS);
for (i = 0; i < dmm->num_engines; i++) { for (i = 0; i < dmm->num_engines; i++) {
if (status & DMM_IRQSTAT_ERR_MASK)
dev_err(dmm->dev,
"irq error(engine%d): IRQSTAT 0x%02x\n",
i, status & 0xff);
if (status & DMM_IRQSTAT_LST) { if (status & DMM_IRQSTAT_LST) {
if (dmm->engines[i].async) if (dmm->engines[i].async)
release_engine(&dmm->engines[i]); release_engine(&dmm->engines[i]);
...@@ -298,7 +310,12 @@ static int dmm_txn_commit(struct dmm_txn *txn, bool wait) ...@@ -298,7 +310,12 @@ static int dmm_txn_commit(struct dmm_txn *txn, bool wait)
msecs_to_jiffies(100))) { msecs_to_jiffies(100))) {
dev_err(dmm->dev, "timed out waiting for done\n"); dev_err(dmm->dev, "timed out waiting for done\n");
ret = -ETIMEDOUT; ret = -ETIMEDOUT;
goto cleanup;
} }
/* Check the engine status before continue */
ret = wait_status(engine, DMM_PATSTATUS_READY |
DMM_PATSTATUS_VALID | DMM_PATSTATUS_DONE);
} }
cleanup: cleanup:
......
/* /*
*
* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
* Author: Rob Clark <rob@ti.com> * Author: Rob Clark <rob@ti.com>
* Andy Gross <andy.gross@ti.com> * Andy Gross <andy.gross@ti.com>
......
/* /*
* drivers/gpu/drm/omapdrm/omap_drv.c * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
*
* Copyright (C) 2011 Texas Instruments
* Author: Rob Clark <rob@ti.com> * Author: Rob Clark <rob@ti.com>
* *
* This program is free software; you can redistribute it and/or modify it * This program is free software; you can redistribute it and/or modify it
...@@ -563,6 +561,11 @@ static int pdev_probe(struct platform_device *pdev) ...@@ -563,6 +561,11 @@ static int pdev_probe(struct platform_device *pdev)
ddev->dev_private = priv; ddev->dev_private = priv;
platform_set_drvdata(pdev, ddev); platform_set_drvdata(pdev, ddev);
/* Get memory bandwidth limits */
if (priv->dispc_ops->get_memory_bandwidth_limit)
priv->max_bandwidth =
priv->dispc_ops->get_memory_bandwidth_limit();
omap_gem_init(ddev); omap_gem_init(ddev);
ret = omap_modeset_init(ddev); ret = omap_modeset_init(ddev);
...@@ -710,7 +713,7 @@ static int omap_drm_resume(struct device *dev) ...@@ -710,7 +713,7 @@ static int omap_drm_resume(struct device *dev)
drm_kms_helper_poll_enable(drm_dev); drm_kms_helper_poll_enable(drm_dev);
return omap_gem_resume(dev); return omap_gem_resume(drm_dev);
} }
#endif #endif
......
/* /*
* drivers/gpu/drm/omapdrm/omap_drv.h * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
*
* Copyright (C) 2011 Texas Instruments
* Author: Rob Clark <rob@ti.com> * Author: Rob Clark <rob@ti.com>
* *
* This program is free software; you can redistribute it and/or modify it * This program is free software; you can redistribute it and/or modify it
...@@ -17,8 +15,8 @@ ...@@ -17,8 +15,8 @@
* this program. If not, see <http://www.gnu.org/licenses/>. * this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#ifndef __OMAP_DRV_H__ #ifndef __OMAPDRM_DRV_H__
#define __OMAP_DRV_H__ #define __OMAPDRM_DRV_H__
#include <linux/module.h> #include <linux/module.h>
#include <linux/types.h> #include <linux/types.h>
...@@ -31,6 +29,15 @@ ...@@ -31,6 +29,15 @@
#include "dss/omapdss.h" #include "dss/omapdss.h"
#include "omap_connector.h"
#include "omap_crtc.h"
#include "omap_encoder.h"
#include "omap_fb.h"
#include "omap_fbdev.h"
#include "omap_gem.h"
#include "omap_irq.h"
#include "omap_plane.h"
#define DBG(fmt, ...) DRM_DEBUG(fmt"\n", ##__VA_ARGS__) #define DBG(fmt, ...) DRM_DEBUG(fmt"\n", ##__VA_ARGS__)
#define VERB(fmt, ...) if (0) DRM_DEBUG(fmt, ##__VA_ARGS__) /* verbose debug */ #define VERB(fmt, ...) if (0) DRM_DEBUG(fmt, ##__VA_ARGS__) /* verbose debug */
...@@ -38,14 +45,6 @@ ...@@ -38,14 +45,6 @@
struct omap_drm_usergart; struct omap_drm_usergart;
/* For KMS code that needs to wait for a certain # of IRQs:
*/
struct omap_irq_wait;
struct omap_irq_wait * omap_irq_wait_init(struct drm_device *dev,
uint32_t irqmask, int count);
int omap_irq_wait(struct drm_device *dev, struct omap_irq_wait *wait,
unsigned long timeout);
struct omap_drm_private { struct omap_drm_private {
uint32_t omaprev; uint32_t omaprev;
...@@ -83,117 +82,12 @@ struct omap_drm_private { ...@@ -83,117 +82,12 @@ struct omap_drm_private {
spinlock_t wait_lock; /* protects the wait_list */ spinlock_t wait_lock; /* protects the wait_list */
struct list_head wait_list; /* list of omap_irq_wait */ struct list_head wait_list; /* list of omap_irq_wait */
uint32_t irq_mask; /* enabled irqs in addition to wait_list */ uint32_t irq_mask; /* enabled irqs in addition to wait_list */
/* memory bandwidth limit if it is needed on the platform */
unsigned int max_bandwidth;
}; };
#ifdef CONFIG_DEBUG_FS
int omap_debugfs_init(struct drm_minor *minor); int omap_debugfs_init(struct drm_minor *minor);
void omap_framebuffer_describe(struct drm_framebuffer *fb, struct seq_file *m);
void omap_gem_describe(struct drm_gem_object *obj, struct seq_file *m); #endif /* __OMAPDRM_DRV_H__ */
void omap_gem_describe_objects(struct list_head *list, struct seq_file *m);
#endif
#ifdef CONFIG_PM
int omap_gem_resume(struct device *dev);
#endif
int omap_irq_enable_vblank(struct drm_crtc *crtc);
void omap_irq_disable_vblank(struct drm_crtc *crtc);
void omap_drm_irq_uninstall(struct drm_device *dev);
int omap_drm_irq_install(struct drm_device *dev);
#ifdef CONFIG_DRM_FBDEV_EMULATION
struct drm_fb_helper *omap_fbdev_init(struct drm_device *dev);
void omap_fbdev_free(struct drm_device *dev);
#else
static inline struct drm_fb_helper *omap_fbdev_init(struct drm_device *dev)
{
return NULL;
}
static inline void omap_fbdev_free(struct drm_device *dev)
{
}
#endif
struct videomode *omap_crtc_timings(struct drm_crtc *crtc);
enum omap_channel omap_crtc_channel(struct drm_crtc *crtc);
void omap_crtc_pre_init(void);
void omap_crtc_pre_uninit(void);
struct drm_crtc *omap_crtc_init(struct drm_device *dev,
struct drm_plane *plane, struct omap_dss_device *dssdev);
int omap_crtc_wait_pending(struct drm_crtc *crtc);
void omap_crtc_error_irq(struct drm_crtc *crtc, uint32_t irqstatus);
void omap_crtc_vblank_irq(struct drm_crtc *crtc);
struct drm_plane *omap_plane_init(struct drm_device *dev,
int idx, enum drm_plane_type type,
u32 possible_crtcs);
void omap_plane_install_properties(struct drm_plane *plane,
struct drm_mode_object *obj);
struct drm_encoder *omap_encoder_init(struct drm_device *dev,
struct omap_dss_device *dssdev);
struct drm_connector *omap_connector_init(struct drm_device *dev,
int connector_type, struct omap_dss_device *dssdev,
struct drm_encoder *encoder);
struct drm_encoder *omap_connector_attached_encoder(
struct drm_connector *connector);
bool omap_connector_get_hdmi_mode(struct drm_connector *connector);
struct drm_framebuffer *omap_framebuffer_create(struct drm_device *dev,
struct drm_file *file, const struct drm_mode_fb_cmd2 *mode_cmd);
struct drm_framebuffer *omap_framebuffer_init(struct drm_device *dev,
const struct drm_mode_fb_cmd2 *mode_cmd, struct drm_gem_object **bos);
int omap_framebuffer_pin(struct drm_framebuffer *fb);
void omap_framebuffer_unpin(struct drm_framebuffer *fb);
void omap_framebuffer_update_scanout(struct drm_framebuffer *fb,
struct drm_plane_state *state, struct omap_overlay_info *info);
struct drm_connector *omap_framebuffer_get_next_connector(
struct drm_framebuffer *fb, struct drm_connector *from);
bool omap_framebuffer_supports_rotation(struct drm_framebuffer *fb);
void omap_gem_init(struct drm_device *dev);
void omap_gem_deinit(struct drm_device *dev);
struct drm_gem_object *omap_gem_new(struct drm_device *dev,
union omap_gem_size gsize, uint32_t flags);
struct drm_gem_object *omap_gem_new_dmabuf(struct drm_device *dev, size_t size,
struct sg_table *sgt);
int omap_gem_new_handle(struct drm_device *dev, struct drm_file *file,
union omap_gem_size gsize, uint32_t flags, uint32_t *handle);
void omap_gem_free_object(struct drm_gem_object *obj);
void *omap_gem_vaddr(struct drm_gem_object *obj);
int omap_gem_dumb_map_offset(struct drm_file *file, struct drm_device *dev,
uint32_t handle, uint64_t *offset);
int omap_gem_dumb_create(struct drm_file *file, struct drm_device *dev,
struct drm_mode_create_dumb *args);
int omap_gem_mmap(struct file *filp, struct vm_area_struct *vma);
int omap_gem_mmap_obj(struct drm_gem_object *obj,
struct vm_area_struct *vma);
int omap_gem_fault(struct vm_fault *vmf);
int omap_gem_roll(struct drm_gem_object *obj, uint32_t roll);
void omap_gem_cpu_sync_page(struct drm_gem_object *obj, int pgoff);
void omap_gem_dma_sync_buffer(struct drm_gem_object *obj,
enum dma_data_direction dir);
int omap_gem_pin(struct drm_gem_object *obj, dma_addr_t *dma_addr);
void omap_gem_unpin(struct drm_gem_object *obj);
int omap_gem_get_pages(struct drm_gem_object *obj, struct page ***pages,
bool remap);
int omap_gem_put_pages(struct drm_gem_object *obj);
uint32_t omap_gem_flags(struct drm_gem_object *obj);
int omap_gem_rotated_dma_addr(struct drm_gem_object *obj, uint32_t orient,
int x, int y, dma_addr_t *dma_addr);
uint64_t omap_gem_mmap_offset(struct drm_gem_object *obj);
size_t omap_gem_mmap_size(struct drm_gem_object *obj);
int omap_gem_tiled_stride(struct drm_gem_object *obj, uint32_t orient);
struct dma_buf *omap_gem_prime_export(struct drm_device *dev,
struct drm_gem_object *obj, int flags);
struct drm_gem_object *omap_gem_prime_import(struct drm_device *dev,
struct dma_buf *buffer);
/* map crtc to vblank mask */
struct omap_dss_device *omap_encoder_get_dssdev(struct drm_encoder *encoder);
#endif /* __OMAP_DRV_H__ */
/* /*
* drivers/gpu/drm/omapdrm/omap_encoder.c * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
*
* Copyright (C) 2011 Texas Instruments
* Author: Rob Clark <rob@ti.com> * Author: Rob Clark <rob@ti.com>
* *
* This program is free software; you can redistribute it and/or modify it * This program is free software; you can redistribute it and/or modify it
......
/*
* omap_encoder.h -- OMAP DRM Encoder
*
* Copyright (C) 2011 Texas Instruments
* Author: Rob Clark <rob@ti.com>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 as published by
* the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __OMAPDRM_ENCODER_H__
#define __OMAPDRM_ENCODER_H__
struct drm_device;
struct drm_encoder;
struct omap_dss_device;
struct drm_encoder *omap_encoder_init(struct drm_device *dev,
struct omap_dss_device *dssdev);
/* map crtc to vblank mask */
struct omap_dss_device *omap_encoder_get_dssdev(struct drm_encoder *encoder);
#endif /* __OMAPDRM_ENCODER_H__ */
/* /*
* drivers/gpu/drm/omapdrm/omap_fb.c * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
*
* Copyright (C) 2011 Texas Instruments
* Author: Rob Clark <rob@ti.com> * Author: Rob Clark <rob@ti.com>
* *
* This program is free software; you can redistribute it and/or modify it * This program is free software; you can redistribute it and/or modify it
......
/*
* omap_fb.h -- OMAP DRM Framebuffer
*
* Copyright (C) 2011 Texas Instruments
* Author: Rob Clark <rob@ti.com>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 as published by
* the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __OMAPDRM_FB_H__
#define __OMAPDRM_FB_H__
struct drm_connector;
struct drm_device;
struct drm_file;
struct drm_framebuffer;
struct drm_gem_object;
struct drm_mode_fb_cmd2;
struct drm_plane_state;
struct omap_overlay_info;
struct seq_file;
struct drm_framebuffer *omap_framebuffer_create(struct drm_device *dev,
struct drm_file *file, const struct drm_mode_fb_cmd2 *mode_cmd);
struct drm_framebuffer *omap_framebuffer_init(struct drm_device *dev,
const struct drm_mode_fb_cmd2 *mode_cmd, struct drm_gem_object **bos);
int omap_framebuffer_pin(struct drm_framebuffer *fb);
void omap_framebuffer_unpin(struct drm_framebuffer *fb);
void omap_framebuffer_update_scanout(struct drm_framebuffer *fb,
struct drm_plane_state *state, struct omap_overlay_info *info);
struct drm_connector *omap_framebuffer_get_next_connector(
struct drm_framebuffer *fb, struct drm_connector *from);
bool omap_framebuffer_supports_rotation(struct drm_framebuffer *fb);
void omap_framebuffer_describe(struct drm_framebuffer *fb, struct seq_file *m);
#endif /* __OMAPDRM_FB_H__ */
/* /*
* drivers/gpu/drm/omapdrm/omap_fbdev.c * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
*
* Copyright (C) 2011 Texas Instruments
* Author: Rob Clark <rob@ti.com> * Author: Rob Clark <rob@ti.com>
* *
* This program is free software; you can redistribute it and/or modify it * This program is free software; you can redistribute it and/or modify it
...@@ -84,9 +82,6 @@ static struct fb_ops omap_fb_ops = { ...@@ -84,9 +82,6 @@ static struct fb_ops omap_fb_ops = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
DRM_FB_HELPER_DEFAULT_OPS, DRM_FB_HELPER_DEFAULT_OPS,
/* Note: to properly handle manual update displays, we wrap the
* basic fbdev ops which write to the framebuffer
*/
.fb_read = drm_fb_helper_sys_read, .fb_read = drm_fb_helper_sys_read,
.fb_write = drm_fb_helper_sys_write, .fb_write = drm_fb_helper_sys_write,
.fb_fillrect = drm_fb_helper_sys_fillrect, .fb_fillrect = drm_fb_helper_sys_fillrect,
......
/*
* omap_fbdev.h -- OMAP DRM FBDEV Compatibility
*
* Copyright (C) 2011 Texas Instruments
* Author: Rob Clark <rob@ti.com>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 as published by
* the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __OMAPDRM_FBDEV_H__
#define __OMAPDRM_FBDEV_H__
struct drm_device;
struct drm_fb_helper;
#ifdef CONFIG_DRM_FBDEV_EMULATION
struct drm_fb_helper *omap_fbdev_init(struct drm_device *dev);
void omap_fbdev_free(struct drm_device *dev);
#else
static inline struct drm_fb_helper *omap_fbdev_init(struct drm_device *dev)
{
return NULL;
}
static inline void omap_fbdev_free(struct drm_device *dev)
{
}
#endif
#endif /* __OMAPDRM_FBDEV_H__ */
/* /*
* drivers/gpu/drm/omapdrm/omap_gem.c * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
*
* Copyright (C) 2011 Texas Instruments
* Author: Rob Clark <rob.clark@linaro.org> * Author: Rob Clark <rob.clark@linaro.org>
* *
* This program is free software; you can redistribute it and/or modify it * This program is free software; you can redistribute it and/or modify it
...@@ -996,10 +994,9 @@ void *omap_gem_vaddr(struct drm_gem_object *obj) ...@@ -996,10 +994,9 @@ void *omap_gem_vaddr(struct drm_gem_object *obj)
#ifdef CONFIG_PM #ifdef CONFIG_PM
/* re-pin objects in DMM in resume path: */ /* re-pin objects in DMM in resume path: */
int omap_gem_resume(struct device *dev) int omap_gem_resume(struct drm_device *dev)
{ {
struct drm_device *drm_dev = dev_get_drvdata(dev); struct omap_drm_private *priv = dev->dev_private;
struct omap_drm_private *priv = drm_dev->dev_private;
struct omap_gem_object *omap_obj; struct omap_gem_object *omap_obj;
int ret = 0; int ret = 0;
...@@ -1012,7 +1009,7 @@ int omap_gem_resume(struct device *dev) ...@@ -1012,7 +1009,7 @@ int omap_gem_resume(struct device *dev)
omap_obj->pages, npages, omap_obj->pages, npages,
omap_obj->roll, true); omap_obj->roll, true);
if (ret) { if (ret) {
dev_err(dev, "could not repin: %d\n", ret); dev_err(dev->dev, "could not repin: %d\n", ret);
return ret; return ret;
} }
} }
......
/*
* omap_gem.h -- OMAP DRM GEM Object Management
*
* Copyright (C) 2011 Texas Instruments
* Author: Rob Clark <rob@ti.com>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 as published by
* the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __OMAPDRM_GEM_H__
#define __OMAPDRM_GEM_H__
#include <linux/types.h>
enum dma_data_direction;
struct dma_buf;
struct drm_device;
struct drm_file;
struct drm_gem_object;
struct drm_mode_create_dumb;
struct file;
struct list_head;
struct page;
struct seq_file;
struct vm_area_struct;
struct vm_fault;
union omap_gem_size;
/* Initialization and Cleanup */
void omap_gem_init(struct drm_device *dev);
void omap_gem_deinit(struct drm_device *dev);
#ifdef CONFIG_PM
int omap_gem_resume(struct drm_device *dev);
#endif
#ifdef CONFIG_DEBUG_FS
void omap_gem_describe(struct drm_gem_object *obj, struct seq_file *m);
void omap_gem_describe_objects(struct list_head *list, struct seq_file *m);
#endif
/* GEM Object Creation and Deletion */
struct drm_gem_object *omap_gem_new(struct drm_device *dev,
union omap_gem_size gsize, uint32_t flags);
struct drm_gem_object *omap_gem_new_dmabuf(struct drm_device *dev, size_t size,
struct sg_table *sgt);
int omap_gem_new_handle(struct drm_device *dev, struct drm_file *file,
union omap_gem_size gsize, uint32_t flags, uint32_t *handle);
void omap_gem_free_object(struct drm_gem_object *obj);
void *omap_gem_vaddr(struct drm_gem_object *obj);
/* Dumb Buffers Interface */
int omap_gem_dumb_map_offset(struct drm_file *file, struct drm_device *dev,
uint32_t handle, uint64_t *offset);
int omap_gem_dumb_create(struct drm_file *file, struct drm_device *dev,
struct drm_mode_create_dumb *args);
/* mmap() Interface */
int omap_gem_mmap(struct file *filp, struct vm_area_struct *vma);
int omap_gem_mmap_obj(struct drm_gem_object *obj,
struct vm_area_struct *vma);
uint64_t omap_gem_mmap_offset(struct drm_gem_object *obj);
size_t omap_gem_mmap_size(struct drm_gem_object *obj);
/* PRIME Interface */
struct dma_buf *omap_gem_prime_export(struct drm_device *dev,
struct drm_gem_object *obj, int flags);
struct drm_gem_object *omap_gem_prime_import(struct drm_device *dev,
struct dma_buf *buffer);
int omap_gem_fault(struct vm_fault *vmf);
int omap_gem_roll(struct drm_gem_object *obj, uint32_t roll);
void omap_gem_cpu_sync_page(struct drm_gem_object *obj, int pgoff);
void omap_gem_dma_sync_buffer(struct drm_gem_object *obj,
enum dma_data_direction dir);
int omap_gem_pin(struct drm_gem_object *obj, dma_addr_t *dma_addr);
void omap_gem_unpin(struct drm_gem_object *obj);
int omap_gem_get_pages(struct drm_gem_object *obj, struct page ***pages,
bool remap);
int omap_gem_put_pages(struct drm_gem_object *obj);
uint32_t omap_gem_flags(struct drm_gem_object *obj);
int omap_gem_rotated_dma_addr(struct drm_gem_object *obj, uint32_t orient,
int x, int y, dma_addr_t *dma_addr);
int omap_gem_tiled_stride(struct drm_gem_object *obj, uint32_t orient);
#endif /* __OMAPDRM_GEM_H__ */
/* /*
* drivers/gpu/drm/omapdrm/omap_gem_dmabuf.c * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
*
* Copyright (C) 2011 Texas Instruments
* Author: Rob Clark <rob.clark@linaro.org> * Author: Rob Clark <rob.clark@linaro.org>
* *
* This program is free software; you can redistribute it and/or modify it * This program is free software; you can redistribute it and/or modify it
......
/* /*
* drivers/gpu/drm/omapdrm/omap_irq.c * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
*
* Copyright (C) 2012 Texas Instruments
* Author: Rob Clark <rob.clark@linaro.org> * Author: Rob Clark <rob.clark@linaro.org>
* *
* This program is free software; you can redistribute it and/or modify it * This program is free software; you can redistribute it and/or modify it
......
/*
* omap_irq.h -- OMAP DRM IRQ Handling
*
* Copyright (C) 2011 Texas Instruments
* Author: Rob Clark <rob@ti.com>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 as published by
* the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __OMAPDRM_IRQ_H__
#define __OMAPDRM_IRQ_H__
#include <linux/types.h>
struct drm_crtc;
struct drm_device;
struct omap_irq_wait;
int omap_irq_enable_vblank(struct drm_crtc *crtc);
void omap_irq_disable_vblank(struct drm_crtc *crtc);
void omap_drm_irq_uninstall(struct drm_device *dev);
int omap_drm_irq_install(struct drm_device *dev);
struct omap_irq_wait *omap_irq_wait_init(struct drm_device *dev,
uint32_t irqmask, int count);
int omap_irq_wait(struct drm_device *dev, struct omap_irq_wait *wait,
unsigned long timeout);
#endif /* __OMAPDRM_IRQ_H__ */
/* /*
* drivers/gpu/drm/omapdrm/omap_plane.c * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
*
* Copyright (C) 2011 Texas Instruments
* Author: Rob Clark <rob.clark@linaro.org> * Author: Rob Clark <rob.clark@linaro.org>
* *
* This program is free software; you can redistribute it and/or modify it * This program is free software; you can redistribute it and/or modify it
......
/*
* omap_plane.h -- OMAP DRM Plane
*
* Copyright (C) 2011 Texas Instruments
* Author: Rob Clark <rob@ti.com>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 as published by
* the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __OMAPDRM_PLANE_H__
#define __OMAPDRM_PLANE_H__
#include <linux/types.h>
enum drm_plane_type;
struct drm_device;
struct drm_mode_object;
struct drm_plane;
struct drm_plane *omap_plane_init(struct drm_device *dev,
int idx, enum drm_plane_type type,
u32 possible_crtcs);
void omap_plane_install_properties(struct drm_plane *plane,
struct drm_mode_object *obj);
#endif /* __OMAPDRM_PLANE_H__ */
/* /*
* tcm-sita.c
*
* SImple Tiler Allocator (SiTA): 2D and 1D allocation(reservation) algorithm * SImple Tiler Allocator (SiTA): 2D and 1D allocation(reservation) algorithm
* *
* Authors: Ravi Ramachandra <r.ramachandra@ti.com>, * Authors: Ravi Ramachandra <r.ramachandra@ti.com>,
* Lajos Molnar <molnar@ti.com> * Lajos Molnar <molnar@ti.com>
* Andy Gross <andy.gross@ti.com> * Andy Gross <andy.gross@ti.com>
* *
* Copyright (C) 2012 Texas Instruments, Inc. * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/
* *
* This package is free software; you can redistribute it and/or modify * This package is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as * it under the terms of the GNU General Public License version 2 as
......
/* /*
* tcm_sita.h
*
* SImple Tiler Allocator (SiTA) private structures. * SImple Tiler Allocator (SiTA) private structures.
* *
* Copyright (C) 2009-2011 Texas Instruments Incorporated - http://www.ti.com/
* Author: Ravi Ramachandra <r.ramachandra@ti.com> * Author: Ravi Ramachandra <r.ramachandra@ti.com>
* *
* Copyright (C) 2009-2011 Texas Instruments, Inc.
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
......
/* /*
* tcm.h
*
* TILER container manager specification and support functions for TI * TILER container manager specification and support functions for TI
* TILER driver. * TILER driver.
* *
......
...@@ -455,15 +455,26 @@ static int td028ttec1_panel_remove(struct spi_device *spi) ...@@ -455,15 +455,26 @@ static int td028ttec1_panel_remove(struct spi_device *spi)
} }
static const struct of_device_id td028ttec1_of_match[] = { static const struct of_device_id td028ttec1_of_match[] = {
{ .compatible = "omapdss,tpo,td028ttec1", },
/* keep to not break older DTB */
{ .compatible = "omapdss,toppoly,td028ttec1", }, { .compatible = "omapdss,toppoly,td028ttec1", },
{}, {},
}; };
MODULE_DEVICE_TABLE(of, td028ttec1_of_match); MODULE_DEVICE_TABLE(of, td028ttec1_of_match);
static const struct spi_device_id td028ttec1_ids[] = {
{ "toppoly,td028ttec1", 0 },
{ "tpo,td028ttec1", 0},
{ /* sentinel */ }
};
MODULE_DEVICE_TABLE(spi, td028ttec1_ids);
static struct spi_driver td028ttec1_spi_driver = { static struct spi_driver td028ttec1_spi_driver = {
.probe = td028ttec1_panel_probe, .probe = td028ttec1_panel_probe,
.remove = td028ttec1_panel_remove, .remove = td028ttec1_panel_remove,
.id_table = td028ttec1_ids,
.driver = { .driver = {
.name = "panel-tpo-td028ttec1", .name = "panel-tpo-td028ttec1",
...@@ -474,7 +485,6 @@ static struct spi_driver td028ttec1_spi_driver = { ...@@ -474,7 +485,6 @@ static struct spi_driver td028ttec1_spi_driver = {
module_spi_driver(td028ttec1_spi_driver); module_spi_driver(td028ttec1_spi_driver);
MODULE_ALIAS("spi:toppoly,td028ttec1");
MODULE_AUTHOR("H. Nikolaus Schaller <hns@goldelico.com>"); MODULE_AUTHOR("H. Nikolaus Schaller <hns@goldelico.com>");
MODULE_DESCRIPTION("Toppoly TD028TTEC1 panel driver"); MODULE_DESCRIPTION("Toppoly TD028TTEC1 panel driver");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment