4 * Copyright (c) 2015 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.
20 #ifndef __HW_COMMON_H__
21 #define __HW_COMMON_H__
25 #define MAKE_TAG_CONSTANT(A,B,C,D) (((A) << 24) | ((B) << 16) | ((C) << 8) | (D))
26 #define HARDWARE_INFO_TAG MAKE_TAG_CONSTANT('T','H','I','T')
30 /* magic must be initialized to HARDWARE_INFO_TAG */
35 uint16_t device_version;
44 /* reserved for future use */
47 int (*open)(struct hw_info *info,
48 const char *id, struct hw_common **common);
50 int (*close)(struct hw_common *common);
54 /* indicate to this device information structure */
58 #define MAKE_VERSION(maj,min) \
59 ((((maj) & 0xff) << 8) | ((min) & 0xff))
62 * Version of the struct hw_info
64 #define HARDWARE_INFO_VERSION MAKE_VERSION(1,0)
67 * Name of the hardware info symbolic (Tizen Hardware Info)
69 #define HARDWARE_INFO_SYM TizenHwInfo
71 int hw_get_info(const char *id, const struct hw_info **info);
74 * Structure define of hardware info module
75 * All hardware module should be use below define
76 * to make a specific structure for Tizen HAL.
77 * hw_get_info function will load a hw_info structure
78 * by using TizenHwInfo name at runtime.
79 * TizenHwInfo means Tizen Hardware Info.
81 #define HARDWARE_MODULE_STRUCTURE \
82 __attribute__ ((visibility("default"))) \
83 struct hw_info HARDWARE_INFO_SYM