17 #include <linux/module.h>
20 #include <linux/slab.h>
38 static const u32 ldmt1r[] = {
61 dev_err(sdev->
dev,
"invalid interface type %u\n",
62 sdev->
pdata->iface.interface);
66 sdev->
ldmt1r = ldmt1r[sdev->
pdata->iface.interface];
82 clkname =
"peripheral_clk";
95 dev_err(sdev->
dev,
"cannot get dot clock %s\n", clkname);
122 dev->dev_private =
NULL;
138 dev_err(dev->dev,
"no platform data\n");
144 dev_err(dev->dev,
"failed to allocate private data\n");
153 dev->dev_private = sdev;
158 dev_err(&pdev->
dev,
"failed to get memory resource\n");
165 dev_err(&pdev->
dev,
"failed to remap memory resource\n");
170 ret = shmob_drm_setup_clocks(sdev, pdata->
clk_source);
174 ret = shmob_drm_init_interface(sdev);
180 dev_err(&pdev->
dev,
"failed to initialize mode setting\n");
184 for (i = 0; i < 4; ++
i) {
187 dev_err(&pdev->
dev,
"failed to create plane %u\n", i);
194 dev_err(&pdev->
dev,
"failed to initialize vblank\n");
200 dev_err(&pdev->
dev,
"failed to install IRQ handler\n");
204 platform_set_drvdata(pdev, sdev);
208 shmob_drm_unload(dev);
213 static void shmob_drm_preclose(
struct drm_device *dev,
struct drm_file *
file)
232 status = lcdc_read(sdev,
LDINTR);
234 spin_unlock_irqrestore(&sdev->
irq_lock, flags);
244 static int shmob_drm_enable_vblank(
struct drm_device *dev,
int crtc)
253 static void shmob_drm_disable_vblank(
struct drm_device *dev,
int crtc)
275 static struct drm_driver shmob_drm_driver = {
276 .driver_features = DRIVER_HAVE_IRQ | DRIVER_GEM | DRIVER_MODESET,
277 .load = shmob_drm_load,
278 .unload = shmob_drm_unload,
279 .preclose = shmob_drm_preclose,
280 .irq_handler = shmob_drm_irq,
282 .enable_vblank = shmob_drm_enable_vblank,
283 .disable_vblank = shmob_drm_disable_vblank,
289 .fops = &shmob_drm_fops,
291 .desc =
"Renesas SH Mobile DRM",
302 static int shmob_drm_pm_suspend(
struct device *dev)
312 static int shmob_drm_pm_resume(
struct device *dev)
325 static const struct dev_pm_ops shmob_drm_pm_ops = {
346 .probe = shmob_drm_probe,
351 .pm = &shmob_drm_pm_ops,