Changeset 74db5a1 in mainline for uspace/drv/fb/amdm37x_dispc/main.c
- Timestamp:
- 2013-01-20T20:47:02Z (11 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 9cc4b2b4
- Parents:
- 163bc23
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/fb/amdm37x_dispc/main.c
r163bc23 r74db5a1 28 28 */ 29 29 30 /** @addtogroup kfb30 /** @addtogroup amdm37x 31 31 * @{ 32 32 */ … … 35 35 */ 36 36 37 #include <ddf/log.h> 37 38 #include <errno.h> 39 #include <str_error.h> 38 40 #include <stdio.h> 41 #include <ops/graph_dev.h> 42 #include <graph.h> 39 43 #include "port.h" 44 45 #include "amdm37x_dispc.h" 40 46 41 47 #define NAME "amdm37x_dispc" 42 48 49 static graph_dev_ops_t graph_vsl_dev_ops = { 50 .connect = (connect_func) &graph_visualizer_connection 51 }; 52 53 static ddf_dev_ops_t graph_fun_ops = { 54 .interfaces[GRAPH_DEV_IFACE] = &graph_vsl_dev_ops 55 }; 56 43 57 static int amdm37x_dispc_dev_add(ddf_dev_t *dev) 44 58 { 45 port_init(dev); 46 printf("%s: Accepting connections\n", NAME); 59 ddf_fun_t *fun = ddf_fun_create(dev, fun_exposed, "dispc"); 60 if (!fun) { 61 ddf_log_error("Failed to create visualizer function\n"); 62 return ENOMEM; 63 } 64 amdm37x_dispc_t *dispc = 65 ddf_fun_data_alloc(fun, sizeof(amdm37x_dispc_t)); 66 if (!dispc) { 67 ddf_log_error("Failed to allocate dispc structure\n"); 68 ddf_fun_destroy(fun); 69 return ENOMEM; 70 } 71 ddf_fun_set_ops(fun, &graph_fun_ops); 72 int ret = amdm37x_dispc_init(dispc); 73 if (ret != EOK) { 74 ddf_log_error("Failed to init dispc: %s\n", str_error(ret)); 75 ddf_fun_destroy(fun); 76 return ret; 77 } 78 ret = ddf_fun_bind(fun); 79 if (ret != EOK) { 80 ddf_log_error("Failed to bind function: %s\n", str_error(ret)); 81 amdm37x_dispc_fini(dispc); 82 ddf_fun_destroy(fun); 83 return ret; 84 } 47 85 return EOK; 48 86 } … … 60 98 { 61 99 printf("%s: HelenOS AM/DM37x framebuffer driver\n", NAME); 100 ddf_log_init(NAME); 62 101 return ddf_driver_main(&amdm37x_dispc_driver); 63 102 }
Note:
See TracChangeset
for help on using the changeset viewer.