16 #include <linux/module.h>
35 .module_name =
"s5p-hdmi",
39 .output_name =
"S5P SDO connector",
40 .module_name =
"s5p-sdo",
46 struct v4l2_mbus_framefmt *mbus_fmt)
54 WARN(ret,
"failed to get mbus_fmt for output %s\n", sd->
name);
65 struct v4l2_mbus_framefmt mbus_fmt;
69 if (to_output(mdev)->
cookie == 0)
76 WARN(ret,
"failed to get mbus_fmt for output %s\n", sd->
name);
78 WARN(ret,
"starting stream failed for output %s\n", sd->
name);
83 WARN(ret,
"failed to get vsync (%d) from output\n", ret);
102 WARN(ret,
"failed to get vsync (%d) from output\n", ret);
104 WARN(ret,
"stopping stream failed for output %s\n", sd->
name);
131 WARN(mdev->
n_output < 0,
"negative number of output users (%d)\n",
138 int ret = pm_runtime_get_sync(mdev->
dev);
149 pm_runtime_put_sync(mdev->
dev);
162 mxr_err(mdev,
"get memory resource failed.\n");
168 if (mdev->
res.mxr_regs ==
NULL) {
169 mxr_err(mdev,
"register mapping failed.\n");
176 mxr_err(mdev,
"get memory resource failed.\n");
182 if (mdev->
res.vp_regs ==
NULL) {
183 mxr_err(mdev,
"register mapping failed.\n");
190 mxr_err(mdev,
"get interrupt resource failed.\n");
197 mxr_err(mdev,
"request interrupt failed.\n");
214 static void mxr_release_plat_resources(
struct mxr_device *mdev)
221 static void mxr_release_clocks(
struct mxr_device *mdev)
231 if (!IS_ERR_OR_NULL(res->
vp))
233 if (!IS_ERR_OR_NULL(res->
mixer))
237 static int mxr_acquire_clocks(
struct mxr_device *mdev)
243 if (IS_ERR_OR_NULL(res->
mixer)) {
244 mxr_err(mdev,
"failed to get clock 'mixer'\n");
248 if (IS_ERR_OR_NULL(res->
vp)) {
249 mxr_err(mdev,
"failed to get clock 'vp'\n");
254 mxr_err(mdev,
"failed to get clock 'sclk_mixer'\n");
259 mxr_err(mdev,
"failed to get clock 'sclk_hdmi'\n");
263 if (IS_ERR_OR_NULL(res->
sclk_dac)) {
264 mxr_err(mdev,
"failed to get clock 'sclk_dac'\n");
270 mxr_release_clocks(mdev);
278 ret = mxr_acquire_plat_resources(mdev, pdev);
283 ret = mxr_acquire_clocks(mdev);
287 mxr_info(mdev,
"resources acquired\n");
291 mxr_release_plat_resources(mdev);
293 mxr_err(mdev,
"resources acquire failed\n");
297 static void mxr_release_resources(
struct mxr_device *mdev)
299 mxr_release_clocks(mdev);
300 mxr_release_plat_resources(mdev);
304 static void mxr_release_layers(
struct mxr_device *mdev)
314 struct mxr_platform_data *
pdata)
321 mxr_err(mdev,
"failed to acquire layers\n");
328 mxr_release_layers(mdev);
334 static int mxr_runtime_resume(
struct device *dev)
339 mxr_dbg(mdev,
"resume - start\n");
347 mxr_dbg(mdev,
"resume - finished\n");
353 static int mxr_runtime_suspend(
struct device *dev)
357 mxr_dbg(mdev,
"suspend - start\n");
364 mxr_dbg(mdev,
"suspend - finished\n");
369 .runtime_suspend = mxr_runtime_suspend,
370 .runtime_resume = mxr_runtime_resume,
387 dev_err(dev,
"not enough memory.\n");
400 ret = mxr_acquire_resources(mdev, pdev);
411 ret = mxr_acquire_layers(mdev, pdata);
417 mxr_info(mdev,
"probe successful\n");
424 mxr_release_resources(mdev);
439 pm_runtime_disable(dev);
441 mxr_release_layers(mdev);
443 mxr_release_resources(mdev);
447 dev_info(dev,
"remove successful\n");
461 static int __init mxr_init(
void)
465 "Samsung TV Mixer driver, "
466 "(c) 2010-2011 Samsung Electronics Co., Ltd.\n";
475 pr_err(
"s5p-tv: registration of MIXER driver failed\n");
483 static void __exit mxr_exit(
void)