Commit | Line | Data |
---|---|---|
d8408326 SWK |
1 | /* |
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 | ||
760285e7 | 14 | #include <drm/drmP.h> |
d8408326 SWK |
15 | |
16 | #include <linux/kernel.h> | |
17 | #include <linux/i2c.h> | |
d8408326 SWK |
18 | |
19 | ||
20 | #include "exynos_drm_drv.h" | |
21 | #include "exynos_hdmi.h" | |
22 | ||
23 | static int s5p_ddc_probe(struct i2c_client *client, | |
24 | const struct i2c_device_id *dev_id) | |
25 | { | |
26 | hdmi_attach_ddc_client(client); | |
27 | ||
9ff15948 RS |
28 | dev_info(&client->adapter->dev, |
29 | "attached %s into i2c adapter successfully\n", | |
30 | client->name); | |
d8408326 SWK |
31 | |
32 | return 0; | |
33 | } | |
34 | ||
35 | static int s5p_ddc_remove(struct i2c_client *client) | |
36 | { | |
9ff15948 RS |
37 | dev_info(&client->adapter->dev, |
38 | "detached %s from i2c adapter successfully\n", | |
39 | client->name); | |
d8408326 SWK |
40 | |
41 | return 0; | |
42 | } | |
43 | ||
44 | static struct i2c_device_id ddc_idtable[] = { | |
45 | {"s5p_ddc", 0}, | |
9ff15948 | 46 | {"exynos5-hdmiddc", 0}, |
d8408326 SWK |
47 | { }, |
48 | }; | |
49 | ||
65da0350 | 50 | #ifdef CONFIG_OF |
9ff15948 RS |
51 | static struct of_device_id hdmiddc_match_types[] = { |
52 | { | |
53 | .compatible = "samsung,exynos5-hdmiddc", | |
cc57caf0 RS |
54 | }, { |
55 | .compatible = "samsung,exynos4210-hdmiddc", | |
9ff15948 RS |
56 | }, { |
57 | /* end node */ | |
58 | } | |
59 | }; | |
65da0350 | 60 | #endif |
9ff15948 | 61 | |
d8408326 SWK |
62 | struct i2c_driver ddc_driver = { |
63 | .driver = { | |
9ff15948 | 64 | .name = "exynos-hdmiddc", |
d8408326 | 65 | .owner = THIS_MODULE, |
65da0350 | 66 | .of_match_table = of_match_ptr(hdmiddc_match_types), |
d8408326 SWK |
67 | }, |
68 | .id_table = ddc_idtable, | |
69 | .probe = s5p_ddc_probe, | |
56550d94 | 70 | .remove = s5p_ddc_remove, |
d8408326 SWK |
71 | .command = NULL, |
72 | }; |