4 * Copyright (c) 2012 - 2013 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.
26 enum device_priority {
27 DEVICE_PRIORITY_NORMAL = 0,
32 enum device_priority priority;
34 void (*init) (void *data);
35 void (*exit) (void *data);
41 enum device_ops_status {
42 DEVICE_OPS_STATUS_UNINIT,
43 DEVICE_OPS_STATUS_START,
44 DEVICE_OPS_STATUS_STOP,
45 DEVICE_OPS_STATUS_MAX,
48 void devices_init(void *data);
49 void devices_exit(void *data);
51 static inline int device_start(const struct device_ops *dev)
53 if (dev && dev->start)
59 static inline int device_stop(const struct device_ops *dev)
67 static inline int device_get_status(const struct device_ops *dev)
69 if (dev && dev->status)
75 #define DEVICE_OPS_REGISTER(dev) \
76 static void __CONSTRUCTOR__ module_init(void) \
80 static void __DESTRUCTOR__ module_exit(void) \
85 void add_device(const struct device_ops *dev);
86 void remove_device(const struct device_ops *dev);
87 const struct device_ops *find_device(const char *name);