From 698f587e3a52121375e5677e14e56c0ade7a5b3c Mon Sep 17 00:00:00 2001 From: Daniel Leung Date: Sun, 3 Nov 2019 19:36:54 -0800 Subject: [PATCH] drivers: gpio_pca95xx: roll header file into source file The structures defined in the header file are only used by the driver source file, and should not be used by others. So roll the header file into the source file so it won't get #include. Signed-off-by: Daniel Leung --- drivers/gpio/gpio_pca95xx.c | 36 ++++++++++++++++++++-- drivers/gpio/gpio_pca95xx.h | 61 ------------------------------------- 2 files changed, 34 insertions(+), 63 deletions(-) delete mode 100644 drivers/gpio/gpio_pca95xx.h diff --git a/drivers/gpio/gpio_pca95xx.c b/drivers/gpio/gpio_pca95xx.c index 1ab895f1ae6..3202b0a9e28 100644 --- a/drivers/gpio/gpio_pca95xx.c +++ b/drivers/gpio/gpio_pca95xx.c @@ -17,8 +17,6 @@ #include #include -#include "gpio_pca95xx.h" - #define LOG_LEVEL CONFIG_GPIO_LOG_LEVEL #include LOG_MODULE_REGISTER(gpio_pca95xx); @@ -51,6 +49,40 @@ LOG_MODULE_REGISTER(gpio_pca95xx); /* Driver flags */ #define PCA_HAS_PUD BIT(0) +/** Configuration data */ +struct gpio_pca95xx_config { + /** The master I2C device's name */ + const char * const i2c_master_dev_name; + + /** The slave address of the chip */ + u16_t i2c_slave_addr; + + u8_t capabilities; +}; + +/** Store the port 0/1 data for each register pair. */ +union gpio_pca95xx_port_data { + u16_t all; + u8_t port[2]; + u8_t byte[2]; +}; + +/** Runtime driver data */ +struct gpio_pca95xx_drv_data { + /* gpio_driver_data needs to be first */ + struct gpio_driver_data common; + + /** Master I2C device */ + struct device *i2c_master; + + struct { + union gpio_pca95xx_port_data output; + union gpio_pca95xx_port_data dir; + union gpio_pca95xx_port_data pud_en; + union gpio_pca95xx_port_data pud_sel; + } reg_cache; +}; + /** * @brief Read both port 0 and port 1 registers of certain register function. * diff --git a/drivers/gpio/gpio_pca95xx.h b/drivers/gpio/gpio_pca95xx.h deleted file mode 100644 index f6d2ae6aad7..00000000000 --- a/drivers/gpio/gpio_pca95xx.h +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright (c) 2015 Intel Corporation. - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/** - * @file Header file for the PCA95XX driver. - */ - -#ifndef ZEPHYR_DRIVERS_GPIO_GPIO_PCA95XX_H_ -#define ZEPHYR_DRIVERS_GPIO_GPIO_PCA95XX_H_ - -#include - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/** Configuration data */ -struct gpio_pca95xx_config { - /** The master I2C device's name */ - const char * const i2c_master_dev_name; - - /** The slave address of the chip */ - u16_t i2c_slave_addr; - - u8_t capabilities; -}; - -/** Store the port 0/1 data for each register pair. */ -union gpio_pca95xx_port_data { - u16_t all; - u8_t port[2]; - u8_t byte[2]; -}; - -/** Runtime driver data */ -struct gpio_pca95xx_drv_data { - /* gpio_driver_data needs to be first */ - struct gpio_driver_data common; - - /** Master I2C device */ - struct device *i2c_master; - - struct { - union gpio_pca95xx_port_data output; - union gpio_pca95xx_port_data dir; - union gpio_pca95xx_port_data pud_en; - union gpio_pca95xx_port_data pud_sel; - } reg_cache; -}; - -#ifdef __cplusplus -} -#endif - -#endif /* ZEPHYR_DRIVERS_GPIO_GPIO_PCA95XX_H_ */