static void dsi_display_uninit_dispc(struct platform_device *dsidev,
struct omap_overlay_manager *mgr);
+static int dsi_vc_send_null(struct omap_dss_device *dssdev, int channel);
+
#define DSI_MAX_NR_ISRS 2
#define DSI_MAX_NR_LANES 5
static inline struct platform_device *dsi_get_dsidev_from_dssdev(struct omap_dss_device *dssdev)
{
- /* HACK: dssdev can be either the panel device, when using old API, or
- * the dsi device itself, when using the new API. So we solve this for
- * now by checking the dssdev->id. This will be removed when the old API
- * is removed.
- */
- if (dssdev->id == OMAP_DSS_OUTPUT_DSI1 ||
- dssdev->id == OMAP_DSS_OUTPUT_DSI2)
- return to_platform_device(dssdev->dev);
-
- return to_platform_device(dssdev->output->dev);
+ return to_platform_device(dssdev->dev);
}
struct platform_device *dsi_get_dsidev_from_id(int module)
return __raw_readl(dsi->base + idx.idx);
}
-void dsi_bus_lock(struct omap_dss_device *dssdev)
+static void dsi_bus_lock(struct omap_dss_device *dssdev)
{
struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev);
struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev);
down(&dsi->bus_lock);
}
-EXPORT_SYMBOL(dsi_bus_lock);
-void dsi_bus_unlock(struct omap_dss_device *dssdev)
+static void dsi_bus_unlock(struct omap_dss_device *dssdev)
{
struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev);
struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev);
up(&dsi->bus_lock);
}
-EXPORT_SYMBOL(dsi_bus_unlock);
static bool dsi_bus_is_locked(struct platform_device *dsidev)
{
return 0;
}
-void omapdss_dsi_vc_enable_hs(struct omap_dss_device *dssdev, int channel,
+static void dsi_vc_enable_hs(struct omap_dss_device *dssdev, int channel,
bool enable)
{
struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev);
if (dsi->vm_timings.ddr_clk_always_on && enable)
dsi_vc_send_null(dssdev, channel);
}
-EXPORT_SYMBOL(omapdss_dsi_vc_enable_hs);
static void dsi_vc_flush_long_data(struct platform_device *dsidev, int channel)
{
return 0;
}
-int dsi_vc_send_bta_sync(struct omap_dss_device *dssdev, int channel)
+static int dsi_vc_send_bta_sync(struct omap_dss_device *dssdev, int channel)
{
struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev);
DECLARE_COMPLETION_ONSTACK(completion);
err0:
return r;
}
-EXPORT_SYMBOL(dsi_vc_send_bta_sync);
static inline void dsi_vc_write_long_header(struct platform_device *dsidev,
int channel, u8 data_type, u16 len, u8 ecc)
return 0;
}
-int dsi_vc_send_null(struct omap_dss_device *dssdev, int channel)
+static int dsi_vc_send_null(struct omap_dss_device *dssdev, int channel)
{
struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev);
return dsi_vc_send_long(dsidev, channel, MIPI_DSI_NULL_PACKET, NULL,
0, 0);
}
-EXPORT_SYMBOL(dsi_vc_send_null);
static int dsi_vc_write_nosync_common(struct platform_device *dsidev,
int channel, u8 *data, int len, enum dss_dsi_content_type type)
return r;
}
-int dsi_vc_dcs_write_nosync(struct omap_dss_device *dssdev, int channel,
+static int dsi_vc_dcs_write_nosync(struct omap_dss_device *dssdev, int channel,
u8 *data, int len)
{
struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev);
return dsi_vc_write_nosync_common(dsidev, channel, data, len,
DSS_DSI_CONTENT_DCS);
}
-EXPORT_SYMBOL(dsi_vc_dcs_write_nosync);
-int dsi_vc_generic_write_nosync(struct omap_dss_device *dssdev, int channel,
+static int dsi_vc_generic_write_nosync(struct omap_dss_device *dssdev, int channel,
u8 *data, int len)
{
struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev);
return dsi_vc_write_nosync_common(dsidev, channel, data, len,
DSS_DSI_CONTENT_GENERIC);
}
-EXPORT_SYMBOL(dsi_vc_generic_write_nosync);
static int dsi_vc_write_common(struct omap_dss_device *dssdev, int channel,
u8 *data, int len, enum dss_dsi_content_type type)
return r;
}
-int dsi_vc_dcs_write(struct omap_dss_device *dssdev, int channel, u8 *data,
+static int dsi_vc_dcs_write(struct omap_dss_device *dssdev, int channel, u8 *data,
int len)
{
return dsi_vc_write_common(dssdev, channel, data, len,
DSS_DSI_CONTENT_DCS);
}
-EXPORT_SYMBOL(dsi_vc_dcs_write);
-int dsi_vc_generic_write(struct omap_dss_device *dssdev, int channel, u8 *data,
+static int dsi_vc_generic_write(struct omap_dss_device *dssdev, int channel, u8 *data,
int len)
{
return dsi_vc_write_common(dssdev, channel, data, len,
DSS_DSI_CONTENT_GENERIC);
}
-EXPORT_SYMBOL(dsi_vc_generic_write);
-
-int dsi_vc_dcs_write_0(struct omap_dss_device *dssdev, int channel, u8 dcs_cmd)
-{
- return dsi_vc_dcs_write(dssdev, channel, &dcs_cmd, 1);
-}
-EXPORT_SYMBOL(dsi_vc_dcs_write_0);
-
-int dsi_vc_generic_write_0(struct omap_dss_device *dssdev, int channel)
-{
- return dsi_vc_generic_write(dssdev, channel, NULL, 0);
-}
-EXPORT_SYMBOL(dsi_vc_generic_write_0);
-
-int dsi_vc_dcs_write_1(struct omap_dss_device *dssdev, int channel, u8 dcs_cmd,
- u8 param)
-{
- u8 buf[2];
- buf[0] = dcs_cmd;
- buf[1] = param;
- return dsi_vc_dcs_write(dssdev, channel, buf, 2);
-}
-EXPORT_SYMBOL(dsi_vc_dcs_write_1);
-
-int dsi_vc_generic_write_1(struct omap_dss_device *dssdev, int channel,
- u8 param)
-{
- return dsi_vc_generic_write(dssdev, channel, ¶m, 1);
-}
-EXPORT_SYMBOL(dsi_vc_generic_write_1);
-
-int dsi_vc_generic_write_2(struct omap_dss_device *dssdev, int channel,
- u8 param1, u8 param2)
-{
- u8 buf[2];
- buf[0] = param1;
- buf[1] = param2;
- return dsi_vc_generic_write(dssdev, channel, buf, 2);
-}
-EXPORT_SYMBOL(dsi_vc_generic_write_2);
static int dsi_vc_dcs_send_read_request(struct platform_device *dsidev,
int channel, u8 dcs_cmd)
return r;
}
-int dsi_vc_dcs_read(struct omap_dss_device *dssdev, int channel, u8 dcs_cmd,
+static int dsi_vc_dcs_read(struct omap_dss_device *dssdev, int channel, u8 dcs_cmd,
u8 *buf, int buflen)
{
struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev);
DSSERR("dsi_vc_dcs_read(ch %d, cmd 0x%02x) failed\n", channel, dcs_cmd);
return r;
}
-EXPORT_SYMBOL(dsi_vc_dcs_read);
static int dsi_vc_generic_read(struct omap_dss_device *dssdev, int channel,
u8 *reqdata, int reqlen, u8 *buf, int buflen)
return 0;
}
-int dsi_vc_generic_read_0(struct omap_dss_device *dssdev, int channel, u8 *buf,
- int buflen)
-{
- int r;
-
- r = dsi_vc_generic_read(dssdev, channel, NULL, 0, buf, buflen);
- if (r) {
- DSSERR("dsi_vc_generic_read_0(ch %d) failed\n", channel);
- return r;
- }
-
- return 0;
-}
-EXPORT_SYMBOL(dsi_vc_generic_read_0);
-
-int dsi_vc_generic_read_1(struct omap_dss_device *dssdev, int channel, u8 param,
- u8 *buf, int buflen)
-{
- int r;
-
- r = dsi_vc_generic_read(dssdev, channel, ¶m, 1, buf, buflen);
- if (r) {
- DSSERR("dsi_vc_generic_read_1(ch %d) failed\n", channel);
- return r;
- }
-
- return 0;
-}
-EXPORT_SYMBOL(dsi_vc_generic_read_1);
-
-int dsi_vc_generic_read_2(struct omap_dss_device *dssdev, int channel,
- u8 param1, u8 param2, u8 *buf, int buflen)
-{
- int r;
- u8 reqdata[2];
-
- reqdata[0] = param1;
- reqdata[1] = param2;
-
- r = dsi_vc_generic_read(dssdev, channel, reqdata, 2, buf, buflen);
- if (r) {
- DSSERR("dsi_vc_generic_read_2(ch %d) failed\n", channel);
- return r;
- }
-
- return 0;
-}
-EXPORT_SYMBOL(dsi_vc_generic_read_2);
-
-int dsi_vc_set_max_rx_packet_size(struct omap_dss_device *dssdev, int channel,
+static int dsi_vc_set_max_rx_packet_size(struct omap_dss_device *dssdev, int channel,
u16 len)
{
struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev);
return dsi_vc_send_short(dsidev, channel,
MIPI_DSI_SET_MAXIMUM_RETURN_PACKET_SIZE, len, 0);
}
-EXPORT_SYMBOL(dsi_vc_set_max_rx_packet_size);
static int dsi_enter_ulps(struct platform_device *dsidev)
{
}
}
-int omapdss_dsi_configure_pins(struct omap_dss_device *dssdev,
+static int dsi_configure_pins(struct omap_dss_device *dssdev,
const struct omap_dsi_pin_config *pin_cfg)
{
struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev);
return 0;
}
-EXPORT_SYMBOL(omapdss_dsi_configure_pins);
-int dsi_enable_video_output(struct omap_dss_device *dssdev, int channel)
+static int dsi_enable_video_output(struct omap_dss_device *dssdev, int channel)
{
struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev);
struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev);
err_init_dispc:
return r;
}
-EXPORT_SYMBOL(dsi_enable_video_output);
-void dsi_disable_video_output(struct omap_dss_device *dssdev, int channel)
+static void dsi_disable_video_output(struct omap_dss_device *dssdev, int channel)
{
struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev);
struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev);
dsi_display_uninit_dispc(dsidev, mgr);
}
-EXPORT_SYMBOL(dsi_disable_video_output);
static void dsi_update_screen_dispc(struct platform_device *dsidev)
{
dsi_handle_framedone(dsidev, 0);
}
-int omap_dsi_update(struct omap_dss_device *dssdev, int channel,
+static int dsi_update(struct omap_dss_device *dssdev, int channel,
void (*callback)(int, void *), void *data)
{
struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev);
return 0;
}
-EXPORT_SYMBOL(omap_dsi_update);
/* Display funcs */
dsi_pll_uninit(dsidev, disconnect_lanes);
}
-int omapdss_dsi_display_enable(struct omap_dss_device *dssdev)
+static int dsi_display_enable(struct omap_dss_device *dssdev)
{
struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev);
struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev);
DSSDBG("dsi_display_enable FAILED\n");
return r;
}
-EXPORT_SYMBOL(omapdss_dsi_display_enable);
-void omapdss_dsi_display_disable(struct omap_dss_device *dssdev,
+static void dsi_display_disable(struct omap_dss_device *dssdev,
bool disconnect_lanes, bool enter_ulps)
{
struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev);
mutex_unlock(&dsi->lock);
}
-EXPORT_SYMBOL(omapdss_dsi_display_disable);
-int omapdss_dsi_enable_te(struct omap_dss_device *dssdev, bool enable)
+static int dsi_enable_te(struct omap_dss_device *dssdev, bool enable)
{
struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev);
struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev);
dsi->te_enabled = enable;
return 0;
}
-EXPORT_SYMBOL(omapdss_dsi_enable_te);
#ifdef PRINT_VERBOSE_VM_TIMINGS
static void print_dsi_vm(const char *str,
dsi_vm_calc_pll_cb, ctx);
}
-int omapdss_dsi_set_config(struct omap_dss_device *dssdev,
+static int dsi_set_config(struct omap_dss_device *dssdev,
const struct omap_dss_dsi_config *config)
{
struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev);
return r;
}
-EXPORT_SYMBOL(omapdss_dsi_set_config);
/*
* Return a hardcoded channel for the DSI output. This should work for
}
}
-int omap_dsi_request_vc(struct omap_dss_device *dssdev, int *channel)
+static int dsi_request_vc(struct omap_dss_device *dssdev, int *channel)
{
struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev);
struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev);
DSSERR("cannot get VC for display %s", dssdev->name);
return -ENOSPC;
}
-EXPORT_SYMBOL(omap_dsi_request_vc);
-int omap_dsi_set_vc_id(struct omap_dss_device *dssdev, int channel, int vc_id)
+static int dsi_set_vc_id(struct omap_dss_device *dssdev, int channel, int vc_id)
{
struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev);
struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev);
return 0;
}
-EXPORT_SYMBOL(omap_dsi_set_vc_id);
-void omap_dsi_release_vc(struct omap_dss_device *dssdev, int channel)
+static void dsi_release_vc(struct omap_dss_device *dssdev, int channel)
{
struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev);
struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev);
dsi->vc[channel].vc_id = 0;
}
}
-EXPORT_SYMBOL(omap_dsi_release_vc);
void dsi_wait_pll_hsdiv_dispc_active(struct platform_device *dsidev)
{
return 0;
}
-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);
- const char *def_disp_name = omapdss_get_default_display_name();
- struct omap_dss_device *def_dssdev;
- int i;
-
- def_dssdev = NULL;
-
- for (i = 0; i < pdata->num_devices; ++i) {
- struct omap_dss_device *dssdev = pdata->devices[i];
-
- if (dssdev->type != OMAP_DISPLAY_TYPE_DSI)
- continue;
-
- if (dssdev->phy.dsi.module != dsi->module_id)
- continue;
-
- if (def_dssdev == NULL)
- def_dssdev = dssdev;
-
- if (def_disp_name != NULL &&
- strcmp(dssdev->name, def_disp_name) == 0) {
- def_dssdev = dssdev;
- break;
- }
- }
-
- return def_dssdev;
-}
-
-static int dsi_probe_pdata(struct platform_device *dsidev)
-{
- struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev);
- struct omap_dss_device *plat_dssdev;
- struct omap_dss_device *dssdev;
- int r;
-
- plat_dssdev = dsi_find_dssdev(dsidev);
-
- if (!plat_dssdev)
- return 0;
-
- r = dsi_regulator_init(dsidev);
- if (r)
- return r;
-
- dssdev = dss_alloc_and_init_device(&dsidev->dev);
- if (!dssdev)
- return -ENOMEM;
-
- dss_copy_device_pdata(dssdev, plat_dssdev);
-
- 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 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 r;
- }
-
- return 0;
-}
-
static int dsi_connect(struct omap_dss_device *dssdev,
struct omap_dss_device *dst)
{
.bus_lock = dsi_bus_lock,
.bus_unlock = dsi_bus_unlock,
- .enable = omapdss_dsi_display_enable,
- .disable = omapdss_dsi_display_disable,
+ .enable = dsi_display_enable,
+ .disable = dsi_display_disable,
- .enable_hs = omapdss_dsi_vc_enable_hs,
+ .enable_hs = dsi_vc_enable_hs,
- .configure_pins = omapdss_dsi_configure_pins,
- .set_config = omapdss_dsi_set_config,
+ .configure_pins = dsi_configure_pins,
+ .set_config = dsi_set_config,
.enable_video_output = dsi_enable_video_output,
.disable_video_output = dsi_disable_video_output,
- .update = omap_dsi_update,
+ .update = dsi_update,
- .enable_te = omapdss_dsi_enable_te,
+ .enable_te = dsi_enable_te,
- .request_vc = omap_dsi_request_vc,
- .set_vc_id = omap_dsi_set_vc_id,
- .release_vc = omap_dsi_release_vc,
+ .request_vc = dsi_request_vc,
+ .set_vc_id = dsi_set_vc_id,
+ .release_vc = dsi_release_vc,
.dcs_write = dsi_vc_dcs_write,
.dcs_write_nosync = dsi_vc_dcs_write_nosync,
dsi_init_output(dsidev);
- if (dsidev->dev.platform_data) {
- r = dsi_probe_pdata(dsidev);
- if (r)
- goto err_probe;
- }
-
dsi_runtime_put(dsidev);
if (dsi->module_id == 0)
#endif
return 0;
-err_probe:
- dsi_runtime_put(dsidev);
- dsi_uninit_output(dsidev);
err_runtime_get:
pm_runtime_disable(&dsidev->dev);
return r;
WARN_ON(dsi->scp_clk_refcount > 0);
- dss_unregister_child_devices(&dsidev->dev);
-
dsi_uninit_output(dsidev);
pm_runtime_disable(&dsidev->dev);
enum omap_dss_dsi_trans_mode trans_mode;
};
-void dsi_bus_lock(struct omap_dss_device *dssdev);
-void dsi_bus_unlock(struct omap_dss_device *dssdev);
-int dsi_vc_dcs_write(struct omap_dss_device *dssdev, int channel, u8 *data,
- int len);
-int dsi_vc_generic_write(struct omap_dss_device *dssdev, int channel, u8 *data,
- int len);
-int dsi_vc_dcs_write_0(struct omap_dss_device *dssdev, int channel, u8 dcs_cmd);
-int dsi_vc_generic_write_0(struct omap_dss_device *dssdev, int channel);
-int dsi_vc_dcs_write_1(struct omap_dss_device *dssdev, int channel, u8 dcs_cmd,
- u8 param);
-int dsi_vc_generic_write_1(struct omap_dss_device *dssdev, int channel,
- u8 param);
-int dsi_vc_generic_write_2(struct omap_dss_device *dssdev, int channel,
- u8 param1, u8 param2);
-int dsi_vc_dcs_write_nosync(struct omap_dss_device *dssdev, int channel,
- u8 *data, int len);
-int dsi_vc_generic_write_nosync(struct omap_dss_device *dssdev, int channel,
- u8 *data, int len);
-int dsi_vc_dcs_read(struct omap_dss_device *dssdev, int channel, u8 dcs_cmd,
- u8 *buf, int buflen);
-int dsi_vc_generic_read_0(struct omap_dss_device *dssdev, int channel, u8 *buf,
- int buflen);
-int dsi_vc_generic_read_1(struct omap_dss_device *dssdev, int channel, u8 param,
- u8 *buf, int buflen);
-int dsi_vc_generic_read_2(struct omap_dss_device *dssdev, int channel,
- u8 param1, u8 param2, u8 *buf, int buflen);
-int dsi_vc_set_max_rx_packet_size(struct omap_dss_device *dssdev, int channel,
- u16 len);
-int dsi_vc_send_null(struct omap_dss_device *dssdev, int channel);
-int dsi_vc_send_bta_sync(struct omap_dss_device *dssdev, int channel);
-int dsi_enable_video_output(struct omap_dss_device *dssdev, int channel);
-void dsi_disable_video_output(struct omap_dss_device *dssdev, int channel);
-
enum omapdss_version {
OMAPDSS_VER_UNKNOWN = 0,
OMAPDSS_VER_OMAP24xx,
#define to_dss_driver(x) container_of((x), struct omap_dss_driver, driver)
#define to_dss_device(x) container_of((x), struct omap_dss_device, old_dev)
-void omapdss_dsi_vc_enable_hs(struct omap_dss_device *dssdev, int channel,
- bool enable);
-int omapdss_dsi_enable_te(struct omap_dss_device *dssdev, bool enable);
-int omapdss_dsi_set_config(struct omap_dss_device *dssdev,
- const struct omap_dss_dsi_config *config);
-
-int omap_dsi_update(struct omap_dss_device *dssdev, int channel,
- void (*callback)(int, void *), void *data);
-int omap_dsi_request_vc(struct omap_dss_device *dssdev, int *channel);
-int omap_dsi_set_vc_id(struct omap_dss_device *dssdev, int channel, int vc_id);
-void omap_dsi_release_vc(struct omap_dss_device *dssdev, int channel);
-int omapdss_dsi_configure_pins(struct omap_dss_device *dssdev,
- const struct omap_dsi_pin_config *pin_cfg);
-
-int omapdss_dsi_display_enable(struct omap_dss_device *dssdev);
-void omapdss_dsi_display_disable(struct omap_dss_device *dssdev,
- bool disconnect_lanes, bool enter_ulps);
-
int omapdss_sdi_display_enable(struct omap_dss_device *dssdev);
void omapdss_sdi_display_disable(struct omap_dss_device *dssdev);
void omapdss_sdi_set_timings(struct omap_dss_device *dssdev,