4 * Copyright (c) 2012 Samsung Electronics Co., Ltd.
6 * Licensed under the Apache License, Version 2.0 (the License);
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
22 #include "core/devices.h"
23 #include "core/list.h"
25 static dd_list *apps_head = NULL;
27 void add_apps(const struct apps_ops *dev)
29 _I("add %s", dev->name);
30 DD_LIST_APPEND(apps_head, (void*)dev);
33 void remove_apps(const struct apps_ops *dev)
35 DD_LIST_REMOVE(apps_head, (void*)dev);
38 static void apps_init(void *data)
40 const struct apps_ops*dev;
42 struct apps_data *input_data;
43 static int initialized =0;
46 DD_LIST_FOREACH(apps_head, elem, dev) {
47 _D("[%s] initialize", dev->name);
55 input_data = (struct apps_data *)data;
56 if (input_data == NULL || input_data->name == NULL)
59 DD_LIST_FOREACH(apps_head, elem, dev) {
60 if (!strncmp(dev->name, (char *)input_data->name, strlen(dev->name))) {
68 static void apps_exit(void *data)
70 const struct apps_ops*dev;
72 struct apps_data *input_data;
74 input_data = (struct apps_data *)data;
75 if (input_data == NULL || input_data->name == NULL)
78 DD_LIST_FOREACH(apps_head, elem, dev) {
79 if (!strncmp(dev->name, (char *)input_data->name, strlen(dev->name))) {
87 static const struct device_ops apps_device_ops = {
88 .priority = DEVICE_PRIORITY_NORMAL,
94 DEVICE_OPS_REGISTER(&apps_device_ops)