blob: 95c75edef01a0440303a36f2692ce963fe6a135e [file] [log] [blame]
Seung-Woo Kimd8408322011-12-21 17:39:39 +09001/*
2 * Copyright (C) 2011 Samsung Electronics Co.Ltd
3 * Authors:
4 * Seung-Woo Kim <sw0312.kim@samsung.com>
5 * Inki Dae <inki.dae@samsung.com>
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation; either version 2 of the License, or (at your
10 * option) any later version.
11 *
12 */
13
David Howells760285e2012-10-02 18:01:07 +010014#include <drm/drmP.h>
Seung-Woo Kimd8408322011-12-21 17:39:39 +090015
16#include <linux/kernel.h>
17#include <linux/i2c.h>
18#include <linux/module.h>
19
20
21#include "exynos_drm_drv.h"
22#include "exynos_hdmi.h"
23
24static int s5p_ddc_probe(struct i2c_client *client,
25 const struct i2c_device_id *dev_id)
26{
27 hdmi_attach_ddc_client(client);
28
Rahul Sharma9ff15942012-10-04 20:48:49 +053029 dev_info(&client->adapter->dev,
30 "attached %s into i2c adapter successfully\n",
31 client->name);
Seung-Woo Kimd8408322011-12-21 17:39:39 +090032
33 return 0;
34}
35
36static int s5p_ddc_remove(struct i2c_client *client)
37{
Rahul Sharma9ff15942012-10-04 20:48:49 +053038 dev_info(&client->adapter->dev,
39 "detached %s from i2c adapter successfully\n",
40 client->name);
Seung-Woo Kimd8408322011-12-21 17:39:39 +090041
42 return 0;
43}
44
45static struct i2c_device_id ddc_idtable[] = {
46 {"s5p_ddc", 0},
Rahul Sharma9ff15942012-10-04 20:48:49 +053047 {"exynos5-hdmiddc", 0},
Seung-Woo Kimd8408322011-12-21 17:39:39 +090048 { },
49};
50
Sachin Kamat65da0352012-12-12 14:24:07 +053051#ifdef CONFIG_OF
Rahul Sharma9ff15942012-10-04 20:48:49 +053052static struct of_device_id hdmiddc_match_types[] = {
53 {
54 .compatible = "samsung,exynos5-hdmiddc",
55 }, {
Rahul Sharmacc57caf2013-06-19 18:21:07 +053056 .compatible = "samsung,exynos4210-hdmiddc",
57 }, {
Rahul Sharma9ff15942012-10-04 20:48:49 +053058 /* end node */
59 }
60};
Sachin Kamat65da0352012-12-12 14:24:07 +053061#endif
Rahul Sharma9ff15942012-10-04 20:48:49 +053062
Seung-Woo Kimd8408322011-12-21 17:39:39 +090063struct i2c_driver ddc_driver = {
64 .driver = {
Rahul Sharma9ff15942012-10-04 20:48:49 +053065 .name = "exynos-hdmiddc",
Seung-Woo Kimd8408322011-12-21 17:39:39 +090066 .owner = THIS_MODULE,
Sachin Kamat65da0352012-12-12 14:24:07 +053067 .of_match_table = of_match_ptr(hdmiddc_match_types),
Seung-Woo Kimd8408322011-12-21 17:39:39 +090068 },
69 .id_table = ddc_idtable,
70 .probe = s5p_ddc_probe,
Greg Kroah-Hartman56550d92012-12-21 15:09:25 -080071 .remove = s5p_ddc_remove,
Seung-Woo Kimd8408322011-12-21 17:39:39 +090072 .command = NULL,
73};