2 * Copyright (c) 2018 Samsung Electronics Co., Ltd.
4 * Contact: Jin Yoon <jinny.yoon@samsung.com>
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.
19 #include <peripheral_io.h>
24 static resource_s resource_info[PIN_MAX] = { {0, NULL, NULL}, };
26 resource_s *resource_get_info(int pin_num)
28 return &resource_info[pin_num];
31 void resource_close_all(void)
34 for (i = 0; i < PIN_MAX; i++) {
35 if (!resource_info[i].opened) continue;
36 _I("GPIO[%d] is closing...", i);
38 if (resource_info[i].close)
39 resource_info[i].close(i);
41 resource_close_illuminance_sensor();