4 * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
6 * Contact: DongGi Jang <dg0402.jang@samsung.com>
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
26 #include "devman_error.h"
28 #include "device_engine.h"
30 API int device_get_property(devtype_t devtype, int property, int *value)
32 struct device *dev = NULL;
39 DBG("devtype cannot find");
41 return DEVMAN_ERROR_OPERATION_FAILED;
45 dev = find_device(dev, devtype);
47 DBG("devtype cannot find");
49 return DEVMAN_ERROR_OPERATION_FAILED;
51 if (dev->get_int == NULL) {
52 DBG("get_int of %s is null", dev->devname);
56 ret = dev->get_int(property, value);
58 DBG("not support driver");
60 return DEVMAN_ERROR_NOT_SUPPORTED;
63 DBG("get_int of %s return fails", dev->devname);
71 API int device_set_property(devtype_t devtype, int property, int value)
73 struct device *dev = NULL;
80 DBG("devtype cannot find");
82 return DEVMAN_ERROR_OPERATION_FAILED;
86 dev = find_device(dev, devtype);
88 DBG("devtype cannot find");
90 return DEVMAN_ERROR_OPERATION_FAILED;
92 if (dev->set_int == NULL) {
93 DBG("set_int of %s is null", dev->devname);
97 ret = dev->set_int(property, value);
99 DBG("not support driver");
101 return DEVMAN_ERROR_NOT_SUPPORTED;
104 DBG("set_int of %s return fails", dev->devname);