Skip to content

Commit

Permalink
Merge tag 'omapdss-for-3.10-fixes' of git://gitorious.org/linux-omap-…
Browse files Browse the repository at this point in the history
…dss2/linux into drm-next

OMAPDSS fixes for 3.10:

* Compilation fix when DSI is disabled in Kconfig
* Basic deferred probe support to fix DT boot

* tag 'omapdss-for-3.10-fixes' of git://gitorious.org/linux-omap-dss2/linux:
  OMAPDSS: TFP410: return EPROBE_DEFER if the i2c adapter not found
  OMAPDSS: VENC: Add error handling for venc_probe_pdata
  OMAPDSS: HDMI: Add error handling for hdmi_probe_pdata
  OMAPDSS: RFBI: Add error handling for rfbi_probe_pdata
  OMAPDSS: DSI: Add error handling for dsi_probe_pdata
  OMAPDSS: SDI: Add error handling for sdi_probe_pdata
  OMAPDSS: DPI: Add error handling for dpi_probe_pdata
  OMAPDSS: VENC: use platform_driver_register()
  OMAPDSS: HDMI: use platform_driver_register()
  OMAPDSS: RFBI: use platform_driver_register()
  OMAPDSS: DSI: use platform_driver_register()
  OMAPDSS: SDI: use platform_driver_register()
  OMAPDSS: DPI: use platform_driver_register()
  OMAPFB: defer probe if no displays
  OMAPFB: use module_platform_driver()
  OMAPDSS: Makefile: move omapfb after panels
  OMAPDSS: DPI: fix compilation if DSI not compiled in
  • Loading branch information
Dave Airlie committed May 3, 2013
2 parents 6110948 + bca3913 commit 7e17fc0
Show file tree
Hide file tree
Showing 10 changed files with 160 additions and 106 deletions.
2 changes: 1 addition & 1 deletion drivers/video/omap2/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
obj-$(CONFIG_OMAP2_VRFB) += vrfb.o

obj-$(CONFIG_OMAP2_DSS) += dss/
obj-$(CONFIG_FB_OMAP2) += omapfb/
obj-y += displays/
obj-$(CONFIG_FB_OMAP2) += omapfb/
2 changes: 1 addition & 1 deletion drivers/video/omap2/displays/panel-tfp410.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ static int tfp410_probe(struct omap_dss_device *dssdev)
if (!adapter) {
dev_err(&dssdev->dev, "Failed to get I2C adapter, bus %d\n",
i2c_bus_num);
return -EINVAL;
return -EPROBE_DEFER;
}

ddata->i2c_adapter = adapter;
Expand Down
35 changes: 22 additions & 13 deletions drivers/video/omap2/dss/dpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,7 @@ void omapdss_dpi_set_data_lines(struct omap_dss_device *dssdev, int data_lines)
}
EXPORT_SYMBOL(omapdss_dpi_set_data_lines);

static int __init dpi_verify_dsi_pll(struct platform_device *dsidev)
static int dpi_verify_dsi_pll(struct platform_device *dsidev)
{
int r;

Expand Down Expand Up @@ -572,7 +572,7 @@ static enum omap_channel dpi_get_channel(void)
}
}

static int __init dpi_init_display(struct omap_dss_device *dssdev)
static int dpi_init_display(struct omap_dss_device *dssdev)
{
struct platform_device *dsidev;

Expand Down Expand Up @@ -607,7 +607,7 @@ static int __init dpi_init_display(struct omap_dss_device *dssdev)
return 0;
}

static struct omap_dss_device * __init dpi_find_dssdev(struct platform_device *pdev)
static struct omap_dss_device *dpi_find_dssdev(struct platform_device *pdev)
{
struct omap_dss_board_info *pdata = pdev->dev.platform_data;
const char *def_disp_name = omapdss_get_default_display_name();
Expand Down Expand Up @@ -635,7 +635,7 @@ static struct omap_dss_device * __init dpi_find_dssdev(struct platform_device *p
return def_dssdev;
}

static void __init dpi_probe_pdata(struct platform_device *dpidev)
static int dpi_probe_pdata(struct platform_device *dpidev)
{
struct omap_dss_device *plat_dssdev;
struct omap_dss_device *dssdev;
Expand All @@ -644,39 +644,41 @@ static void __init dpi_probe_pdata(struct platform_device *dpidev)
plat_dssdev = dpi_find_dssdev(dpidev);

if (!plat_dssdev)
return;
return 0;

dssdev = dss_alloc_and_init_device(&dpidev->dev);
if (!dssdev)
return;
return -ENOMEM;

dss_copy_device_pdata(dssdev, plat_dssdev);

r = dpi_init_display(dssdev);
if (r) {
DSSERR("device %s init failed: %d\n", dssdev->name, r);
dss_put_device(dssdev);
return;
return r;
}

r = omapdss_output_set_device(&dpi.output, dssdev);
if (r) {
DSSERR("failed to connect output to new device: %s\n",
dssdev->name);
dss_put_device(dssdev);
return;
return r;
}

r = dss_add_device(dssdev);
if (r) {
DSSERR("device %s register failed: %d\n", dssdev->name, r);
omapdss_output_unset_device(&dpi.output);
dss_put_device(dssdev);
return;
return r;
}

return 0;
}

static void __init dpi_init_output(struct platform_device *pdev)
static void dpi_init_output(struct platform_device *pdev)
{
struct omap_dss_output *out = &dpi.output;

Expand All @@ -696,13 +698,19 @@ static void __exit dpi_uninit_output(struct platform_device *pdev)
dss_unregister_output(out);
}

static int __init omap_dpi_probe(struct platform_device *pdev)
static int omap_dpi_probe(struct platform_device *pdev)
{
int r;

mutex_init(&dpi.lock);

dpi_init_output(pdev);

dpi_probe_pdata(pdev);
r = dpi_probe_pdata(pdev);
if (r) {
dpi_uninit_output(pdev);
return r;
}

return 0;
}
Expand All @@ -717,6 +725,7 @@ static int __exit omap_dpi_remove(struct platform_device *pdev)
}

static struct platform_driver omap_dpi_driver = {
.probe = omap_dpi_probe,
.remove = __exit_p(omap_dpi_remove),
.driver = {
.name = "omapdss_dpi",
Expand All @@ -726,7 +735,7 @@ static struct platform_driver omap_dpi_driver = {

int __init dpi_init_platform_driver(void)
{
return platform_driver_probe(&omap_dpi_driver, omap_dpi_probe);
return platform_driver_register(&omap_dpi_driver);
}

void __exit dpi_uninit_platform_driver(void)
Expand Down
35 changes: 22 additions & 13 deletions drivers/video/omap2/dss/dsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -5225,7 +5225,7 @@ static enum omap_channel dsi_get_channel(int module_id)
}
}

static int __init dsi_init_display(struct omap_dss_device *dssdev)
static int dsi_init_display(struct omap_dss_device *dssdev)
{
struct platform_device *dsidev =
dsi_get_dsidev_from_id(dssdev->phy.dsi.module);
Expand Down Expand Up @@ -5366,7 +5366,7 @@ static int dsi_get_clocks(struct platform_device *dsidev)
return 0;
}

static struct omap_dss_device * __init dsi_find_dssdev(struct platform_device *pdev)
static struct omap_dss_device *dsi_find_dssdev(struct platform_device *pdev)
{
struct omap_dss_board_info *pdata = pdev->dev.platform_data;
struct dsi_data *dsi = dsi_get_dsidrv_data(pdev);
Expand Down Expand Up @@ -5398,7 +5398,7 @@ static struct omap_dss_device * __init dsi_find_dssdev(struct platform_device *p
return def_dssdev;
}

static void __init dsi_probe_pdata(struct platform_device *dsidev)
static int dsi_probe_pdata(struct platform_device *dsidev)
{
struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev);
struct omap_dss_device *plat_dssdev;
Expand All @@ -5408,39 +5408,41 @@ static void __init dsi_probe_pdata(struct platform_device *dsidev)
plat_dssdev = dsi_find_dssdev(dsidev);

if (!plat_dssdev)
return;
return 0;

dssdev = dss_alloc_and_init_device(&dsidev->dev);
if (!dssdev)
return;
return -ENOMEM;

dss_copy_device_pdata(dssdev, plat_dssdev);

r = dsi_init_display(dssdev);
if (r) {
DSSERR("device %s init failed: %d\n", dssdev->name, r);
dss_put_device(dssdev);
return;
return r;
}

r = omapdss_output_set_device(&dsi->output, dssdev);
if (r) {
DSSERR("failed to connect output to new device: %s\n",
dssdev->name);
dss_put_device(dssdev);
return;
return r;
}

r = dss_add_device(dssdev);
if (r) {
DSSERR("device %s register failed: %d\n", dssdev->name, r);
omapdss_output_unset_device(&dsi->output);
dss_put_device(dssdev);
return;
return r;
}

return 0;
}

static void __init dsi_init_output(struct platform_device *dsidev)
static void dsi_init_output(struct platform_device *dsidev)
{
struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev);
struct omap_dss_output *out = &dsi->output;
Expand All @@ -5456,7 +5458,7 @@ static void __init dsi_init_output(struct platform_device *dsidev)
dss_register_output(out);
}

static void __exit dsi_uninit_output(struct platform_device *dsidev)
static void dsi_uninit_output(struct platform_device *dsidev)
{
struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev);
struct omap_dss_output *out = &dsi->output;
Expand All @@ -5465,7 +5467,7 @@ static void __exit dsi_uninit_output(struct platform_device *dsidev)
}

/* DSI1 HW IP initialisation */
static int __init omap_dsihw_probe(struct platform_device *dsidev)
static int omap_dsihw_probe(struct platform_device *dsidev)
{
u32 rev;
int r, i;
Expand Down Expand Up @@ -5561,7 +5563,13 @@ static int __init omap_dsihw_probe(struct platform_device *dsidev)

dsi_init_output(dsidev);

dsi_probe_pdata(dsidev);
r = dsi_probe_pdata(dsidev);
if (r) {
dsi_runtime_put(dsidev);
dsi_uninit_output(dsidev);
pm_runtime_disable(&dsidev->dev);
return r;
}

dsi_runtime_put(dsidev);

Expand Down Expand Up @@ -5632,6 +5640,7 @@ static const struct dev_pm_ops dsi_pm_ops = {
};

static struct platform_driver omap_dsihw_driver = {
.probe = omap_dsihw_probe,
.remove = __exit_p(omap_dsihw_remove),
.driver = {
.name = "omapdss_dsi",
Expand All @@ -5642,7 +5651,7 @@ static struct platform_driver omap_dsihw_driver = {

int __init dsi_init_platform_driver(void)
{
return platform_driver_probe(&omap_dsihw_driver, omap_dsihw_probe);
return platform_driver_register(&omap_dsihw_driver);
}

void __exit dsi_uninit_platform_driver(void)
Expand Down
31 changes: 27 additions & 4 deletions drivers/video/omap2/dss/dss.h
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,12 @@ int sdi_init_platform_driver(void) __init;
void sdi_uninit_platform_driver(void) __exit;

/* DSI */

typedef bool (*dsi_pll_calc_func)(int regn, int regm, unsigned long fint,
unsigned long pll, void *data);
typedef bool (*dsi_hsdiv_calc_func)(int regm_dispc, unsigned long dispc,
void *data);

#ifdef CONFIG_OMAP2_DSS_DSI

struct dentry;
Expand All @@ -295,10 +301,6 @@ u8 dsi_get_pixel_size(enum omap_dss_dsi_pixel_format fmt);

unsigned long dsi_get_pll_clkin(struct platform_device *dsidev);

typedef bool (*dsi_pll_calc_func)(int regn, int regm, unsigned long fint,
unsigned long pll, void *data);
typedef bool (*dsi_hsdiv_calc_func)(int regm_dispc, unsigned long dispc,
void *data);
bool dsi_hsdiv_calc(struct platform_device *dsidev, unsigned long pll,
unsigned long out_min, dsi_hsdiv_calc_func func, void *data);
bool dsi_pll_calc(struct platform_device *dsidev, unsigned long clkin,
Expand Down Expand Up @@ -358,6 +360,27 @@ static inline struct platform_device *dsi_get_dsidev_from_id(int module)
{
return NULL;
}

static inline unsigned long dsi_get_pll_clkin(struct platform_device *dsidev)
{
return 0;
}

static inline bool dsi_hsdiv_calc(struct platform_device *dsidev,
unsigned long pll, unsigned long out_min,
dsi_hsdiv_calc_func func, void *data)
{
return false;
}

static inline bool dsi_pll_calc(struct platform_device *dsidev,
unsigned long clkin,
unsigned long pll_min, unsigned long pll_max,
dsi_pll_calc_func func, void *data)
{
return false;
}

#endif

/* DPI */
Expand Down
Loading

0 comments on commit 7e17fc0

Please sign in to comment.