drivers: remove unimplemented open/close/ioctl interfaces

Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
This commit is contained in:
Petro Karashchenko
2022-04-12 12:16:13 +02:00
committed by Xiang Xiao
parent 6041a2f0db
commit 09b3fb25ab
96 changed files with 346 additions and 1991 deletions
+2 -30
View File
@@ -77,8 +77,6 @@ static int charger_online(FAR bool *online);
static int charger_get_temptable(FAR struct battery_temp_table_s *table);
static int charger_set_temptable(FAR struct battery_temp_table_s *table);
static int charger_open(FAR struct file *filep);
static int charger_close(FAR struct file *filep);
static ssize_t charger_read(FAR struct file *filep, FAR char *buffer,
size_t buflen);
static ssize_t charger_write(FAR struct file *filep,
@@ -92,8 +90,8 @@ static int charger_ioctl(FAR struct file *filep, int cmd,
static const struct file_operations g_chargerops =
{
charger_open, /* open */
charger_close, /* close */
NULL, /* open */
NULL, /* close */
charger_read, /* read */
charger_write, /* write */
NULL, /* seek */
@@ -419,32 +417,6 @@ static int charger_set_temptable(FAR struct battery_temp_table_s *table)
return cxd56_pmic_settemptable(&buf);
}
/****************************************************************************
* Name: charger_open
*
* Description:
* This function is called whenever the battery device is opened.
*
****************************************************************************/
static int charger_open(FAR struct file *filep)
{
return OK;
}
/****************************************************************************
* Name: charger_close
*
* Description:
* This routine is called when the battery device is closed.
*
****************************************************************************/
static int charger_close(FAR struct file *filep)
{
return OK;
}
/****************************************************************************
* Name: charger_read
****************************************************************************/
+2 -30
View File
@@ -62,8 +62,6 @@ struct bat_gauge_dev_s
* Private Function Prototypes
****************************************************************************/
static int gauge_open(FAR struct file *filep);
static int gauge_close(FAR struct file *filep);
static ssize_t gauge_read(FAR struct file *filep, FAR char *buffer,
size_t buflen);
static ssize_t gauge_write(FAR struct file *filep,
@@ -77,8 +75,8 @@ static int gauge_ioctl(FAR struct file *filep, int cmd,
static const struct file_operations g_gaugeops =
{
gauge_open, /* open */
gauge_close, /* close */
NULL, /* open */
NULL, /* close */
gauge_read, /* read */
gauge_write, /* write */
NULL, /* seek */
@@ -247,32 +245,6 @@ static int gauge_online(FAR bool *online)
return OK;
}
/****************************************************************************
* Name: gauge_open
*
* Description:
* This function is called whenever the battery device is opened.
*
****************************************************************************/
static int gauge_open(FAR struct file *filep)
{
return OK;
}
/****************************************************************************
* Name: gauge_close
*
* Description:
* This routine is called when the battery device is closed.
*
****************************************************************************/
static int gauge_close(FAR struct file *filep)
{
return OK;
}
/****************************************************************************
* Name: gauge_read
****************************************************************************/
+2 -26
View File
@@ -46,8 +46,6 @@
* Private Function Prototypes
****************************************************************************/
static int ge2d_open(FAR struct file *filep);
static int ge2d_close(FAR struct file *filep);
static ssize_t ge2d_read(FAR struct file *filep, FAR char *buffer,
size_t len);
static ssize_t ge2d_write(FAR struct file *filep, FAR const char *buffer,
@@ -63,12 +61,9 @@ static int ge2d_irqhandler(int irq, FAR void *context, FAR void *arg);
static const struct file_operations g_ge2dfops =
{
.open = ge2d_open,
.close = ge2d_close,
.read = ge2d_read,
.write = ge2d_write,
.seek = NULL,
.ioctl = ge2d_ioctl,
.ioctl = ge2d_ioctl
};
static sem_t g_wait;
@@ -96,24 +91,6 @@ static void ge2d_semgive(sem_t *id)
nxsem_post(id);
}
/****************************************************************************
* Name: ge2d_open
****************************************************************************/
static int ge2d_open(FAR struct file *filep)
{
return 0;
}
/****************************************************************************
* Name: ge2d_close
****************************************************************************/
static int ge2d_close(FAR struct file *filep)
{
return 0;
}
/****************************************************************************
* Name: ge2d_read
****************************************************************************/
@@ -129,8 +106,7 @@ static ssize_t ge2d_read(FAR struct file *filep,
* Name: ge2d_write
****************************************************************************/
static ssize_t ge2d_write(FAR struct file *filep,
FAR const char *buffer,
static ssize_t ge2d_write(FAR struct file *filep, FAR const char *buffer,
size_t len)
{
uint32_t bits;
+2 -46
View File
@@ -68,8 +68,6 @@ struct cxd56_geofence_dev_s
/* file operation functions */
static int cxd56_geofence_open(FAR struct file *filep);
static int cxd56_geofence_close(FAR struct file *filep);
static ssize_t cxd56_geofence_read(FAR struct file *filep,
FAR char *buffer,
size_t len);
@@ -101,8 +99,8 @@ static int cxd56_geofence_set_mode(unsigned long arg);
static const struct file_operations g_geofencefops =
{
cxd56_geofence_open, /* open */
cxd56_geofence_close, /* close */
NULL, /* open */
NULL, /* close */
cxd56_geofence_read, /* read */
NULL, /* write */
NULL, /* seek */
@@ -478,48 +476,6 @@ static int cxd56_geofence_initialize(FAR struct cxd56_geofence_dev_s *dev)
return ret;
}
/****************************************************************************
* Name: cxd56_geofence_open
*
* Description:
* Standard character driver open method.
*
* Input Parameters:
* filep - File structure pointer
*
* Returned Value:
* Zero (OK) on success; a negated errno value on failure.
*
****************************************************************************/
static int cxd56_geofence_open(FAR struct file *filep)
{
int32_t ret = 0;
return ret;
}
/****************************************************************************
* Name: cxd56_geofence_close
*
* Description:
* Standard character driver close method.
*
* Input Parameters:
* filep - File structure pointer
*
* Returned Value:
* Zero (OK) on success; a negated errno value on failure.
*
****************************************************************************/
static int cxd56_geofence_close(FAR struct file *filep)
{
int32_t ret = 0;
return ret;
}
/****************************************************************************
* Name: cxd56_geofence_read
*
-2
View File
@@ -2438,8 +2438,6 @@ static void cxd56_gnss_cpufifoapi_signalhandler(uint32_t data,
priv->apiret = CXD56_CPU1_GET_DATA((int)data);
nxsem_post(&priv->apiwait);
return;
}
/****************************************************************************
+6 -2
View File
@@ -141,8 +141,10 @@ static const struct file_operations g_hif_fops =
hif_write, /* write */
hif_seek, /* seek */
hif_ioctl, /* ioctl */
hif_poll, /* poll */
hif_unlink /* unlink */
hif_poll /* poll */
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
, hif_unlink /* unlink */
#endif
};
/****************************************************************************
@@ -343,10 +345,12 @@ static int hif_poll(FAR struct file *filep,
return OK;
}
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
static int hif_unlink(FAR struct inode *inode)
{
return OK;
}
#endif
static int hif_rxhandler(int cpuid, int protoid,
uint32_t pdata, uint32_t data,
+1 -5
View File
@@ -92,11 +92,7 @@ static int cxd56_sphirqhandler(int irq, FAR void *context, FAR void *arg);
static const struct file_operations sph_fops =
{
.open = sph_open,
.close = NULL,
.read = NULL,
.write = NULL,
.seek = NULL,
.ioctl = sph_ioctl,
.ioctl = sph_ioctl
};
static struct sph_dev_s g_sphdev[NR_HSEMS];
+1 -1
View File
@@ -73,7 +73,7 @@ static int g_errcode = 0;
static const struct file_operations g_sysctlfops =
{
.ioctl = sysctl_ioctl,
.ioctl = sysctl_ioctl
};
/****************************************************************************
+1 -13
View File
@@ -72,7 +72,6 @@ static ssize_t uart0_read(FAR struct file *filep,
FAR char *buffer, size_t len);
static ssize_t uart0_write(FAR struct file *filep,
FAR const char *buffer, size_t len);
static int uart0_ioctl(FAR struct file *filep, int cmd, unsigned long arg);
static int uart0_semtake(sem_t *id);
static void uart0_semgive(sem_t *id);
@@ -98,9 +97,7 @@ static const struct file_operations g_uart0fops =
.open = uart0_open,
.close = uart0_close,
.read = uart0_read,
.write = uart0_write,
.seek = NULL,
.ioctl = uart0_ioctl,
.write = uart0_write
};
static sem_t g_lock;
@@ -251,15 +248,6 @@ static ssize_t uart0_write(FAR struct file *filep,
return (ssize_t)ret;
}
/****************************************************************************
* Name: uart0_ioctl
****************************************************************************/
static int uart0_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
{
return -ENOTTY;
}
/****************************************************************************
* Name: cxd56_uart0initialize
****************************************************************************/
+6 -35
View File
@@ -52,8 +52,6 @@
* Private Function Prototypes
****************************************************************************/
static int phyplus_stub_open(FAR struct file *filep);
static int phyplus_stub_close(FAR struct file *filep);
static ssize_t phyplus_stub_read(
FAR struct file *filep, FAR char *buffer, size_t buflen);
static ssize_t phyplus_stub_write(
@@ -70,8 +68,8 @@ static int phyplus_stub_ioctl(
static const struct file_operations g_stub_drvrops =
{
phyplus_stub_open, /* open */
phyplus_stub_close, /* close */
NULL, /* open */
NULL, /* close */
phyplus_stub_read, /* read */
phyplus_stub_write, /* write */
phyplus_stub_seek, /* seek */
@@ -566,33 +564,6 @@ static int phyplus_parse_params_and_action(char *buff)
return 0;
}
/****************************************************************************
* Name: phyplus_stub_open
*
* Description:
* Standard character driver open method.
*
****************************************************************************/
static int phyplus_stub_open(FAR struct file *filep)
{
filep->f_pos = 0;
return OK;
}
/****************************************************************************
* Name: phyplus_stub_close
*
* Description:
* Standard character driver close method.
*
****************************************************************************/
static int phyplus_stub_close(FAR struct file *filep)
{
return OK;
}
/****************************************************************************
* Name: phyplus_gpio_read
*
@@ -686,8 +657,8 @@ static ssize_t phyplus_stub_write(FAR struct file *filep,
*
****************************************************************************/
static off_t phyplus_stub_seek(FAR struct file *filep,
off_t offset, int whence)
static off_t phyplus_stub_seek(FAR struct file *filep, off_t offset,
int whence)
{
/* Only SEEK_SET is supported, return ENOSYS for other valid options */
@@ -717,8 +688,8 @@ static off_t phyplus_stub_seek(FAR struct file *filep,
*
****************************************************************************/
static int phyplus_stub_ioctl(FAR struct file *filep,
int cmd, unsigned long arg)
static int phyplus_stub_ioctl(FAR struct file *filep, int cmd,
unsigned long arg)
{
FAR struct inode *inode;
int ret = 0;
+1 -1
View File
@@ -26,7 +26,7 @@
#include <fcntl.h>
#include <nuttx/serial/serial.h>
#include <nuttx/net/netdev.h>
#include <../../../../net/netdev/netdev.h>
#include <nuttx/net/netdev/netdev.h>
#include "amebaz_hci_board.h"
/****************************************************************************
+1 -1
View File
@@ -1675,7 +1675,7 @@ int sam_tsd_register(struct sam_adc_s *adc, int minor)
/* Register the device as an input device */
snprintf(devname, DEV_NAMELEN, DEV_FORMAT, minor);
snprintf(devname, sizeof(devname), DEV_FORMAT, minor);
iinfo("Registering %s\n", devname);
ret = register_driver(devname, &g_tsdops, 0666, priv);
+1 -1
View File
@@ -140,7 +140,7 @@ static const struct file_operations stm32_bbsram_fops =
.ioctl = stm32_bbsram_ioctl,
.poll = stm32_bbsram_poll,
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
.unlink = stm32_bbsram_unlink,
.unlink = stm32_bbsram_unlink
#endif
};
+1 -1
View File
@@ -140,7 +140,7 @@ static const struct file_operations stm32_bbsram_fops =
.ioctl = stm32_bbsram_ioctl,
.poll = stm32_bbsram_poll,
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
.unlink = stm32_bbsram_unlink,
.unlink = stm32_bbsram_unlink
#endif
};
+1 -1
View File
@@ -161,7 +161,7 @@ static const struct file_operations stm32_bbsram_fops =
.ioctl = stm32_bbsram_ioctl,
.poll = stm32_bbsram_poll,
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
.unlink = stm32_bbsram_unlink,
.unlink = stm32_bbsram_unlink
#endif
};
+1 -1
View File
@@ -135,7 +135,7 @@ static const struct file_operations rx65n_sbram_fops =
.ioctl = rx65n_sbram_ioctl,
.poll = rx65n_sbram_poll,
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
.unlink = rx65n_sbram_unlink,
.unlink = rx65n_sbram_unlink
#endif
};
+2 -2
View File
@@ -115,7 +115,7 @@ int sim_tsc_initialize(int minor)
/* Register the device as an input device */
snprintf(devname, DEV_NAMELEN, DEV_FORMAT, minor);
snprintf(devname, sizeof(devname), DEV_FORMAT, minor);
iinfo("Registering %s\n", devname);
ret = touch_register(&priv->lower, devname, 1);
@@ -162,7 +162,7 @@ int sim_tsc_uninitialize(void)
/* Un-register the device */
snprintf(devname, DEV_NAMELEN, DEV_FORMAT, priv->minor);
snprintf(devname, sizeof(devname), DEV_FORMAT, priv->minor);
iinfo("Un-registering %s\n", devname);
touch_unregister(&priv->lower, devname);
+2 -14
View File
@@ -203,8 +203,6 @@ typedef enum
* Private Function Prototypes
****************************************************************************/
static int keypad_open(struct file *filep);
static int keypad_close(struct file *filep);
static ssize_t keypad_read(struct file *filep, FAR char *buf, size_t buflen);
/****************************************************************************
@@ -253,8 +251,8 @@ static const unsigned char g_kdbus[128] =
static const struct file_operations g_keypadops =
{
keypad_open, /* open */
keypad_close, /* close */
NULL, /* open */
NULL, /* close */
keypad_read, /* read */
NULL, /* write */
NULL, /* seek */
@@ -269,16 +267,6 @@ static const struct file_operations g_keypadops =
* Private Functions
****************************************************************************/
static int keypad_open(struct file *filep)
{
return OK;
}
static int keypad_close(struct file *filep)
{
return OK;
}
static ssize_t keypad_read(struct file *filep, FAR char *buf, size_t buflen)
{
uint_fast8_t keycode = 0;
+6 -18
View File
@@ -109,11 +109,9 @@ static int vga_getpower(struct lcd_dev_s *dev);
static int vga_setpower(struct lcd_dev_s *dev, int power);
static int vga_getcontrast(struct lcd_dev_s *dev);
static int vga_setcontrast(struct lcd_dev_s *dev, unsigned int contrast);
static int vga_open(struct file *filep);
static int vga_close(struct file *filep);
static ssize_t vga_read(struct file *filep, FAR char *buf, size_t buflen);
static ssize_t vga_write(struct file *filep,
FAR const char *buf, size_t buflen);
static ssize_t vga_write(struct file *filep, FAR const char *buf,
size_t buflen);
static off_t vga_seek(FAR struct file *filp, off_t offset, int whence);
/****************************************************************************
@@ -233,8 +231,8 @@ static struct lcd_dev_s g_lcddev =
static const struct file_operations g_vgaops =
{
vga_open, /* open */
vga_close, /* close */
NULL, /* open */
NULL, /* close */
vga_read, /* read */
vga_write, /* write */
vga_seek, /* seek */
@@ -472,16 +470,6 @@ static int vga_setcontrast(struct lcd_dev_s *dev, unsigned int contrast)
return -ENOSYS;
}
static int vga_open(struct file * filep)
{
return OK;
}
static int vga_close(struct file * filep)
{
return OK;
}
static ssize_t vga_read(struct file *filep, FAR char *buf, size_t buflen)
{
if (buf == NULL || buflen < 1)
@@ -494,8 +482,8 @@ static ssize_t vga_read(struct file *filep, FAR char *buf, size_t buflen)
return buflen;
}
static ssize_t vga_write(struct file *filep,
FAR const char *buf, size_t buflen)
static ssize_t vga_write(struct file *filep, FAR const char *buf,
size_t buflen)
{
int i;
int j;
+2 -30
View File
@@ -103,8 +103,6 @@
/* Character driver methods */
static int himem_open(struct file *filep);
static int himem_close(struct file *filep);
static ssize_t himem_read(struct file *filep, char *buffer,
size_t buflen);
static ssize_t himem_write(struct file *filep, const char *buffer,
@@ -151,8 +149,8 @@ irqstate_t spinlock_flags;
static const struct file_operations g_himemfops =
{
himem_open, /* open */
himem_close, /* close */
NULL, /* open */
NULL, /* close */
himem_read, /* read */
himem_write, /* write */
NULL, /* seek */
@@ -647,32 +645,6 @@ int esp_himem_unmap(esp_himem_rangehandle_t range, void *ptr,
return OK;
}
/****************************************************************************
* Name: himem_open
*
* Description:
* This function is called whenever the LM-75 device is opened.
*
****************************************************************************/
static int himem_open(struct file *filep)
{
return OK;
}
/****************************************************************************
* Name: himem_close
*
* Description:
* This routine is called when the LM-75 device is closed.
*
****************************************************************************/
static int himem_close(struct file *filep)
{
return OK;
}
/****************************************************************************
* Name: himem_read
****************************************************************************/
@@ -175,9 +175,11 @@ static const struct file_operations g_bmp280pressfops =
bmp280_close_press, /* close */
bmp280_read_press, /* read */
bmp280_write, /* write */
0, /* seek */
bmp280_ioctl_press, /* ioctl */
0 /* unlink */
NULL, /* seek */
bmp280_ioctl_press /* ioctl */
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
, NULL /* unlink */
#endif
};
static const struct file_operations g_bmp280tempfops =
@@ -186,9 +188,11 @@ static const struct file_operations g_bmp280tempfops =
bmp280_close_temp, /* close */
bmp280_read_temp, /* read */
bmp280_write, /* write */
0, /* seek */
bmp280_ioctl_temp, /* ioctl */
0 /* unlink */
NULL, /* seek */
bmp280_ioctl_temp /* ioctl */
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
, NULL /* unlink */
#endif
};
/* SCU instructions for pick pressure sensing data. */
@@ -1517,7 +1517,7 @@ int stm32_tsc_setup(int minor)
/* Register the device as an input device */
snprintf(devname, DEV_NAMELEN, DEV_FORMAT, minor);
snprintf(devname, sizeof(devname), DEV_FORMAT, minor);
iinfo("Registering %s\n", devname);
ret = register_driver(devname, &tc_fops, 0666, priv);
@@ -1381,7 +1381,7 @@ int pic32mx_tsc_setup(int minor)
/* Register the device as an input device */
snprintf(devname, DEV_NAMELEN, DEV_FORMAT, minor);
snprintf(devname, sizeof(devname), DEV_FORMAT, minor);
iinfo("Registering %s\n", devname);
ret = register_driver(devname, &tc_fops, 0666, priv);
+2 -30
View File
@@ -65,8 +65,6 @@ struct efuse_upperhalf_s
* Private Function Prototypes
****************************************************************************/
static int efuse_open(FAR struct file *filep);
static int efuse_close(FAR struct file *filep);
static ssize_t efuse_read(FAR struct file *filep, FAR char *buffer,
size_t buflen);
static ssize_t efuse_write(FAR struct file *filep, FAR const char *buffer,
@@ -80,8 +78,8 @@ static int efuse_ioctl(FAR struct file *filep, int cmd,
static const struct file_operations g_efuseops =
{
efuse_open, /* open */
efuse_close, /* close */
NULL, /* open */
NULL, /* close */
efuse_read, /* read */
efuse_write, /* write */
NULL, /* seek */
@@ -96,32 +94,6 @@ static const struct file_operations g_efuseops =
* Private Functions
****************************************************************************/
/****************************************************************************
* Name: efuse_open
*
* Description:
* This function is called whenever the efuse timer device is opened.
*
****************************************************************************/
static int efuse_open(FAR struct file *filep)
{
return OK;
}
/****************************************************************************
* Name: efuse_close
*
* Description:
* This function is called when the efuse timer device is closed.
*
****************************************************************************/
static int efuse_close(FAR struct file *filep)
{
return OK;
}
/****************************************************************************
* Name: efuse_read
*
+1 -1
View File
@@ -1203,7 +1203,7 @@ int ads7843e_register(FAR struct spi_dev_s *spi,
/* Register the device as an input device */
snprintf(devname, DEV_NAMELEN, DEV_FORMAT, minor);
snprintf(devname, sizeof(devname), DEV_FORMAT, minor);
iinfo("Registering %s\n", devname);
ret = register_driver(devname, &ads7843e_fops, 0666, priv);
+1 -1
View File
@@ -1175,7 +1175,7 @@ int ft5x06_register(FAR struct i2c_master_s *i2c,
/* Register the device as an input device */
snprintf(devname, DEV_NAMELEN, DEV_FORMAT, minor);
snprintf(devname, sizeof(devname), DEV_FORMAT, minor);
iinfo("Registering %s\n", devname);
ret = register_driver(devname, &ft5x06_fops, 0666, priv);
+1 -1
View File
@@ -1236,7 +1236,7 @@ int max11802_register(FAR struct spi_dev_s *spi,
/* Register the device as an input device */
snprintf(devname, DEV_NAMELEN, DEV_FORMAT, minor);
snprintf(devname, sizeof(devname), DEV_FORMAT, minor);
iinfo("Registering %s\n", devname);
ret = register_driver(devname, &max11802_fops, 0666, priv);
+1 -1
View File
@@ -1915,7 +1915,7 @@ int mxt_register(FAR struct i2c_master_s *i2c,
/* Register the device as an input device */
snprintf(devname, DEV_NAMELEN, DEV_FORMAT, minor);
snprintf(devname, sizeof(devname), DEV_FORMAT, minor);
iinfo("Registering %s\n", devname);
ret = register_driver(devname, &mxt_fops, 0666, priv);
+1 -1
View File
@@ -1060,7 +1060,7 @@ int spq10kbd_register(FAR struct i2c_master_s *i2c,
priv->config->enable(priv->config, true);
snprintf(kbddevname, DEV_NAMELEN, DEV_FORMAT, kbdminor);
snprintf(kbddevname, sizeof(kbddevname), DEV_FORMAT, kbdminor);
iinfo("Registering %s\n", kbddevname);
ret = register_driver(kbddevname, &g_hidkbd_fops, 0666, priv);
+1 -1
View File
@@ -886,7 +886,7 @@ int stmpe811_register(STMPE811_HANDLE handle, int minor)
/* Register the character driver */
snprintf(devname, DEV_NAMELEN, DEV_FORMAT, minor);
snprintf(devname, sizeof(devname), DEV_FORMAT, minor);
ret = register_driver(devname, &g_stmpe811fops, 0666, priv);
if (ret < 0)
{
+2 -2
View File
@@ -222,8 +222,8 @@ static ssize_t touch_write(FAR struct file *filep, FAR const char *buffer,
* Name: touch_read
****************************************************************************/
static ssize_t
touch_read(FAR struct file *filep, FAR char *buffer, size_t len)
static ssize_t touch_read(FAR struct file *filep, FAR char *buffer,
size_t len)
{
FAR struct touch_openpriv_s *openpriv = filep->f_priv;
int ret;
+1 -1
View File
@@ -1267,7 +1267,7 @@ int tsc2007_register(FAR struct i2c_master_s *dev,
/* Register the device as an input device */
snprintf(devname, DEV_NAMELEN, DEV_FORMAT, minor);
snprintf(devname, sizeof(devname), DEV_FORMAT, minor);
iinfo("Registering %s\n", devname);
ret = register_driver(devname, &tsc2007_fops, 0666, priv);
+2 -31
View File
@@ -44,8 +44,6 @@
****************************************************************************/
static int gpio_handler(FAR struct gpio_dev_s *dev, uint8_t pin);
static int gpio_open(FAR struct file *filep);
static int gpio_close(FAR struct file *filep);
static ssize_t gpio_read(FAR struct file *filep, FAR char *buffer,
size_t buflen);
static ssize_t gpio_write(FAR struct file *filep, FAR const char *buffer,
@@ -60,8 +58,8 @@ static int gpio_ioctl(FAR struct file *filep, int cmd,
static const struct file_operations g_gpio_drvrops =
{
gpio_open, /* open */
gpio_close, /* close */
NULL, /* open */
NULL, /* close */
gpio_read, /* read */
gpio_write, /* write */
gpio_seek, /* seek */
@@ -106,33 +104,6 @@ static int gpio_handler(FAR struct gpio_dev_s *dev, uint8_t pin)
return OK;
}
/****************************************************************************
* Name: gpio_open
*
* Description:
* Standard character driver open method.
*
****************************************************************************/
static int gpio_open(FAR struct file *filep)
{
filep->f_pos = 0;
return OK;
}
/****************************************************************************
* Name: gpio_close
*
* Description:
* Standard character driver close method.
*
****************************************************************************/
static int gpio_close(FAR struct file *filep)
{
return OK;
}
/****************************************************************************
* Name: gpio_read
*
+3 -31
View File
@@ -137,8 +137,6 @@ static void ht16k33_clear_display(FAR struct ht16k33_dev_s *priv);
/* Character driver methods */
static int ht16k33_open(FAR struct file *filep);
static int ht16k33_close(FAR struct file *filep);
static ssize_t ht16k33_read(FAR struct file *filep, FAR char *buffer,
size_t buflen);
static ssize_t ht16k33_write(FAR struct file *filep, FAR const char *buffer,
@@ -154,8 +152,8 @@ static int ht16k33_ioctl(FAR struct file *filep, int cmd,
static const struct file_operations g_ht16k33fops =
{
ht16k33_open, /* open */
ht16k33_close, /* close */
NULL, /* open */
NULL, /* close */
ht16k33_read, /* read */
ht16k33_write, /* write */
ht16k33_seek, /* seek */
@@ -781,32 +779,6 @@ static void lcd_curpos_to_fpos(FAR struct ht16k33_dev_s *priv,
*fpos = (row * HT16K33_MAX_COL) + col + row;
}
/****************************************************************************
* Name: ht16k33_open
*
* Description:
* This function is called whenever the HT16K33 device is opened.
*
****************************************************************************/
static int ht16k33_open(FAR struct file *filep)
{
return OK;
}
/****************************************************************************
* Name: ht16k33_close
*
* Description:
* This routine is called when the LM-75 device is closed.
*
****************************************************************************/
static int ht16k33_close(FAR struct file *filep)
{
return OK;
}
/****************************************************************************
* Name: ht16k33_read
****************************************************************************/
@@ -1155,7 +1127,7 @@ int ht16k33_register(int devno, FAR struct i2c_master_s *i2c)
/* Create the character device name */
snprintf(devname, DEVNAME_FMTLEN, DEVNAME_FMT, devno);
snprintf(devname, sizeof(devname), DEVNAME_FMT, devno);
/* Register the driver */
+2 -26
View File
@@ -59,8 +59,6 @@ struct lcddev_dev_s
/* Character driver methods */
static int lcddev_open(FAR struct file *filep);
static int lcddev_close(FAR struct file *filep);
static int lcddev_ioctl(FAR struct file *filep, int cmd,
unsigned long arg);
@@ -70,8 +68,8 @@ static int lcddev_ioctl(FAR struct file *filep, int cmd,
static const struct file_operations lcddev_fops =
{
lcddev_open, /* open */
lcddev_close, /* close */
NULL, /* open */
NULL, /* close */
NULL, /* read */
NULL, /* write */
NULL, /* seek */
@@ -86,28 +84,6 @@ static const struct file_operations lcddev_fops =
* Private Functions
****************************************************************************/
/****************************************************************************
* Name: lcddev_open
****************************************************************************/
static int lcddev_open(FAR struct file *filep)
{
/* Nothing to do */
return OK;
}
/****************************************************************************
* Name: lcddev_close
****************************************************************************/
static int lcddev_close(FAR struct file *filep)
{
/* Nothing to do */
return OK;
}
/****************************************************************************
* Name: lcddev_ioctl
****************************************************************************/
+4 -4
View File
@@ -105,7 +105,7 @@ static off_t pcf8574_lcd_seek(FAR struct file *filep, off_t offset,
int whence);
static int pcf8574_lcd_ioctl(FAR struct file *filep, int cmd,
unsigned long arg);
static int pcf8574lcd_poll(FAR struct file *filep, FAR struct pollfd *fds,
static int pcf8574_lcd_poll(FAR struct file *filep, FAR struct pollfd *fds,
bool setup);
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
static int pcf8574_lcd_unlink(FAR struct inode *inode);
@@ -123,7 +123,7 @@ static const struct file_operations g_pcf8574_lcd_fops =
pcf8574_lcd_write, /* write */
pcf8574_lcd_seek, /* seek */
pcf8574_lcd_ioctl, /* ioctl */
pcf8574lcd_poll /* poll */
pcf8574_lcd_poll /* poll */
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
, pcf8574_lcd_unlink /* unlink */
#endif
@@ -1548,10 +1548,10 @@ static int pcf8574_lcd_ioctl(FAR struct file *filep, int cmd,
}
/****************************************************************************
* Name: pcf8574lcd_poll
* Name: pcf8574_lcd_poll
****************************************************************************/
static int pcf8574lcd_poll(FAR struct file *filep, FAR struct pollfd *fds,
static int pcf8574_lcd_poll(FAR struct file *filep, FAR struct pollfd *fds,
bool setup)
{
if (setup)
+2 -30
View File
@@ -94,8 +94,6 @@ static void lcd_scroll_up(FAR struct st7032_dev_s *priv);
/* Character driver methods */
static int st7032_open(FAR struct file *filep);
static int st7032_close(FAR struct file *filep);
static ssize_t st7032_read(FAR struct file *filep, FAR char *buffer,
size_t buflen);
static ssize_t st7032_write(FAR struct file *filep, FAR const char *buffer,
@@ -110,8 +108,8 @@ static int st7032_ioctl(FAR struct file *filep, int cmd,
static const struct file_operations g_st7032fops =
{
st7032_open, /* open */
st7032_close, /* close */
NULL, /* open */
NULL, /* close */
st7032_read, /* read */
st7032_write, /* write */
st7032_seek, /* seek */
@@ -703,32 +701,6 @@ static void lcd_curpos_to_fpos(FAR struct st7032_dev_s *priv,
*fpos = (row * ST7032_MAX_COL) + col + row;
}
/****************************************************************************
* Name: st7032_open
*
* Description:
* This function is called whenever the ST7032 device is opened.
*
****************************************************************************/
static int st7032_open(FAR struct file *filep)
{
return OK;
}
/****************************************************************************
* Name: st7032_close
*
* Description:
* This routine is called when the LM-75 device is closed.
*
****************************************************************************/
static int st7032_close(FAR struct file *filep)
{
return OK;
}
/****************************************************************************
* Name: st7032_read
****************************************************************************/
+2 -30
View File
@@ -60,8 +60,6 @@ static inline void apa102_write32(FAR struct apa102_dev_s *priv,
/* Character driver methods */
static int apa102_open(FAR struct file *filep);
static int apa102_close(FAR struct file *filep);
static ssize_t apa102_read(FAR struct file *filep, FAR char *buffer,
size_t buflen);
static ssize_t apa102_write(FAR struct file *filep, FAR const char *buffer,
@@ -73,8 +71,8 @@ static ssize_t apa102_write(FAR struct file *filep, FAR const char *buffer,
static const struct file_operations g_apa102fops =
{
apa102_open, /* open */
apa102_close, /* close */
NULL, /* open */
NULL, /* close */
apa102_read, /* read */
apa102_write, /* write */
NULL, /* seek */
@@ -138,32 +136,6 @@ static inline void apa102_write32(FAR struct apa102_dev_s *priv,
SPI_LOCK(priv->spi, false);
}
/****************************************************************************
* Name: apa102_open
*
* Description:
* This function is called whenever the APA102 device is opened.
*
****************************************************************************/
static int apa102_open(FAR struct file *filep)
{
return OK;
}
/****************************************************************************
* Name: apa102_close
*
* Description:
* This routine is called when the APA102 device is closed.
*
****************************************************************************/
static int apa102_close(FAR struct file *filep)
{
return OK;
}
/****************************************************************************
* Name: apa102_read
****************************************************************************/
+2 -30
View File
@@ -70,8 +70,6 @@ static inline void max7219_write16(FAR struct max7219_dev_s *priv,
/* Character driver methods */
static int max7219_open(FAR struct file *filep);
static int max7219_close(FAR struct file *filep);
static ssize_t max7219_read(FAR struct file *filep, FAR char *buffer,
size_t buflen);
static ssize_t max7219_write(FAR struct file *filep, FAR const char *buffer,
@@ -83,8 +81,8 @@ static ssize_t max7219_write(FAR struct file *filep, FAR const char *buffer,
static const struct file_operations g_max7219fops =
{
max7219_open, /* open */
max7219_close, /* close */
NULL, /* open */
NULL, /* close */
max7219_read, /* read */
max7219_write, /* write */
NULL, /* seek */
@@ -153,32 +151,6 @@ static inline void max7219_write16(FAR struct max7219_dev_s *priv,
SPI_LOCK(priv->spi, false);
}
/****************************************************************************
* Name: max7219_open
*
* Description:
* This function is called whenever the MAX7219 device is opened.
*
****************************************************************************/
static int max7219_open(FAR struct file *filep)
{
return OK;
}
/****************************************************************************
* Name: max7219_close
*
* Description:
* This routine is called when the LM-75 device is closed.
*
****************************************************************************/
static int max7219_close(FAR struct file *filep)
{
return OK;
}
/****************************************************************************
* Name: max7219_read
****************************************************************************/
+2 -30
View File
@@ -111,8 +111,6 @@ static void ws2812_pack(FAR uint8_t *buf, uint32_t rgb);
/* Character driver methods */
static int ws2812_open(FAR struct file *filep);
static int ws2812_close(FAR struct file *filep);
static ssize_t ws2812_read(FAR struct file *filep, FAR char *buffer,
size_t buflen);
static ssize_t ws2812_write(FAR struct file *filep, FAR const char *buffer,
@@ -125,8 +123,8 @@ static off_t ws2812_seek(FAR struct file *filep, off_t offset, int whence);
static const struct file_operations g_ws2812fops =
{
ws2812_open, /* open */
ws2812_close, /* close */
NULL, /* open */
NULL, /* close */
ws2812_read, /* read */
ws2812_write, /* write */
ws2812_seek, /* seek */
@@ -206,32 +204,6 @@ static void ws2812_pack(FAR uint8_t *buf, uint32_t rgb)
}
}
/****************************************************************************
* Name: ws2812_open
*
* Description:
* This function is called whenever the WS2812 device is opened.
*
****************************************************************************/
static int ws2812_open(FAR struct file *filep)
{
return OK;
}
/****************************************************************************
* Name: ws2812_close
*
* Description:
* This routine is called when the WS2812 device is closed.
*
****************************************************************************/
static int ws2812_close(FAR struct file *filep)
{
return OK;
}
/****************************************************************************
* Name: ws2812_read
****************************************************************************/
+2 -30
View File
@@ -60,8 +60,6 @@ struct cordic_upperhalf_s
* Private Function Prototypes
****************************************************************************/
static int cordic_open(FAR struct file *filep);
static int cordic_close(FAR struct file *filep);
static ssize_t cordic_read(FAR struct file *filep, FAR char *buffer,
size_t buflen);
static ssize_t cordic_write(FAR struct file *filep, FAR const char *buffer,
@@ -75,8 +73,8 @@ static int cordic_ioctl(FAR struct file *filep, int cmd,
static const struct file_operations g_cordicops =
{
cordic_open, /* open */
cordic_close, /* close */
NULL, /* open */
NULL, /* close */
cordic_read, /* read */
cordic_write, /* write */
NULL, /* seek */
@@ -91,32 +89,6 @@ static const struct file_operations g_cordicops =
* Private Functions
****************************************************************************/
/****************************************************************************
* Name: cordic_open
*
* Description:
* This function is called whenever the cordic timer device is opened.
*
****************************************************************************/
static int cordic_open(FAR struct file *filep)
{
return OK;
}
/****************************************************************************
* Name: cordic_close
*
* Description:
* This function is called when the cordic timer device is closed.
*
****************************************************************************/
static int cordic_close(FAR struct file *filep)
{
return OK;
}
/****************************************************************************
* Name: cordic_read
*
+1 -13
View File
@@ -110,8 +110,6 @@ static ssize_t lwlconsole_read(FAR struct file *filep, FAR char *buffer,
size_t buflen);
static ssize_t lwlconsole_write(FAR struct file *filep,
FAR const char *buffer, size_t buflen);
static int lwlconsole_ioctl(FAR struct file *filep, int cmd,
unsigned long arg);
/****************************************************************************
* Private Data
@@ -136,7 +134,7 @@ static const struct file_operations g_consoleops =
lwlconsole_read, /* read */
lwlconsole_write, /* write */
NULL, /* seek */
lwlconsole_ioctl, /* ioctl */
NULL, /* ioctl */
NULL /* poll */
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
, NULL /* unlink */
@@ -227,16 +225,6 @@ static bool read8bits(uint8_t port, FAR uint8_t *store)
return true;
}
/****************************************************************************
* Name: lwlconsole_ioctl
****************************************************************************/
static int lwlconsole_ioctl(FAR struct file *filep, int cmd,
unsigned long arg)
{
return -ENOTTY;
}
/****************************************************************************
* Name: lwlconsole_read
****************************************************************************/
+2 -30
View File
@@ -42,8 +42,6 @@
/* Character driver methods. */
static int altmdm_open(FAR struct file *filep);
static int altmdm_close(FAR struct file *filep);
static ssize_t altmdm_read(FAR struct file *filep, FAR char *buffer,
size_t len);
static ssize_t altmdm_write(FAR struct file *filep, FAR const char *buffer,
@@ -58,8 +56,8 @@ static int altmdm_ioctl(FAR struct file *filep, int cmd, unsigned long arg);
static const struct file_operations g_altmdmfops =
{
altmdm_open, /* open */
altmdm_close, /* close */
NULL, /* open */
NULL, /* close */
altmdm_read, /* read */
altmdm_write, /* write */
NULL, /* seek */
@@ -147,32 +145,6 @@ static int altmdm_uninitialize(FAR struct altmdm_dev_s *priv)
return ret;
}
/****************************************************************************
* Name: altmdm_open
*
* Description:
* Standard character driver open method.
*
****************************************************************************/
static int altmdm_open(FAR struct file *filep)
{
return OK;
}
/****************************************************************************
* Name: altmdm_close
*
* Description:
* Standard character driver close method.
*
****************************************************************************/
static int altmdm_close(FAR struct file *filep)
{
return OK;
}
/****************************************************************************
* Name: altmdm_read
*
+1 -12
View File
@@ -212,7 +212,6 @@ static void tun_dev_uninit(FAR struct tun_device_s *priv);
/* File interface */
static int tun_open(FAR struct file *filep);
static int tun_close(FAR struct file *filep);
static ssize_t tun_read(FAR struct file *filep, FAR char *buffer,
size_t buflen);
@@ -231,7 +230,7 @@ static struct tun_device_s g_tun_devices[CONFIG_TUN_NINTERFACES];
static const struct file_operations g_tun_file_ops =
{
tun_open, /* open */
NULL, /* open */
tun_close, /* close */
tun_read, /* read */
tun_write, /* write */
@@ -1151,16 +1150,6 @@ static void tun_dev_uninit(FAR struct tun_device_s *priv)
nxsem_destroy(&priv->write_wait_sem);
}
/****************************************************************************
* Name: tun_open
****************************************************************************/
static int tun_open(FAR struct file *filep)
{
filep->f_priv = 0;
return OK;
}
/****************************************************************************
* Name: tun_close
****************************************************************************/
+2 -32
View File
@@ -64,8 +64,6 @@ struct dat31r5sp_dev_s
/* Character driver methods */
static int dat31r5sp_open(FAR struct file *filep);
static int dat31r5sp_close(FAR struct file *filep);
static ssize_t dat31r5sp_read(FAR struct file *filep, FAR char *buffer,
size_t buflen);
static ssize_t dat31r5sp_write(FAR struct file *filep,
@@ -79,8 +77,8 @@ static int dat31r5sp_ioctl(FAR struct file *filep, int cmd,
static const struct file_operations g_dat31r5sp_fops =
{
dat31r5sp_open, /* open */
dat31r5sp_close, /* close */
NULL, /* open */
NULL, /* close */
dat31r5sp_read, /* read */
dat31r5sp_write, /* write */
NULL, /* seek */
@@ -142,34 +140,6 @@ static void dat31r5sp_set_attenuation(FAR struct dat31r5sp_dev_s *priv,
SPI_LOCK(priv->spi, false);
}
/****************************************************************************
* Name: dat31r5sp_open
*
* Description:
* This function is called whenever the DAT-31R5-SP+ device is
* opened.
*
****************************************************************************/
static int dat31r5sp_open(FAR struct file *filep)
{
return OK;
}
/****************************************************************************
* Name: dat31r5sp_close
*
* Description:
* This function is called whenever the DAT-31R5-SP+ device is
* closed.
*
****************************************************************************/
static int dat31r5sp_close(FAR struct file *filep)
{
return OK;
}
/****************************************************************************
* Name: dat31r5sp_write
*
+1 -15
View File
@@ -88,7 +88,6 @@ static int adt7320_readtemp(FAR struct adt7320_dev_s *priv, FAR b16_t *temp);
/* Character driver methods */
static int adt7320_open(FAR struct file *filep);
static int adt7320_close(FAR struct file *filep);
static ssize_t adt7320_read(FAR struct file *filep, FAR char *buffer,
size_t buflen);
static ssize_t adt7320_write(FAR struct file *filep, FAR const char *buffer,
@@ -102,7 +101,7 @@ static int adt7320_ioctl(FAR struct file *filep, int cmd, unsigned long arg);
static const struct file_operations g_adt7320fops =
{
adt7320_open, /* open */
adt7320_close, /* close */
NULL, /* close */
adt7320_read, /* read */
adt7320_write, /* write */
NULL, /* seek */
@@ -336,19 +335,6 @@ static int adt7320_open(FAR struct file *filep)
return OK;
}
/****************************************************************************
* Name: adt7320_close
*
* Description:
* This routine is called when the ADT7320 device is closed.
*
****************************************************************************/
static int adt7320_close(FAR struct file *filep)
{
return OK;
}
/****************************************************************************
* Name: adt7320_read
****************************************************************************/
+3 -31
View File
@@ -49,8 +49,6 @@
/* Character driver methods */
static int adxl345_open(FAR struct file *filep);
static int adxl345_close(FAR struct file *filep);
static ssize_t adxl345_read(FAR struct file *filep, FAR char *buffer,
size_t len);
@@ -62,8 +60,8 @@ static ssize_t adxl345_read(FAR struct file *filep, FAR char *buffer,
static const struct file_operations g_adxl345fops =
{
adxl345_open, /* open */
adxl345_close, /* close */
NULL, /* open */
NULL, /* close */
adxl345_read, /* read */
NULL, /* write */
NULL, /* seek */
@@ -74,32 +72,6 @@ static const struct file_operations g_adxl345fops =
#endif
};
/****************************************************************************
* Name: adxl345_open
*
* Description:
* Standard character driver open method.
*
****************************************************************************/
static int adxl345_open(FAR struct file *filep)
{
return OK;
}
/****************************************************************************
* Name: adxl345_close
*
* Description:
* Standard character driver close method.
*
****************************************************************************/
static int adxl345_close(FAR struct file *filep)
{
return OK;
}
/****************************************************************************
* Name: adxl345_read
*
@@ -210,7 +182,7 @@ int adxl345_register(ADXL345_HANDLE handle, int minor)
/* Register the character driver */
snprintf(devname, DEV_NAMELEN, DEV_FORMAT, minor);
snprintf(devname, sizeof(devname), DEV_FORMAT, minor);
ret = register_driver(devname, &g_adxl345fops, 0444, priv);
if (ret < 0)
{
+6 -32
View File
@@ -104,9 +104,11 @@ static bool apds9960_isgestureavailable(FAR struct apds9960_dev_s *priv);
/* I2C Helpers */
static int apds9960_i2c_read(FAR struct apds9960_dev_s *priv,
uint8_t const regaddr, FAR uint8_t *regval, int len);
uint8_t const regaddr, FAR uint8_t *regval,
int len);
static int apds9960_i2c_read8(FAR struct apds9960_dev_s *priv,
uint8_t const regaddr, FAR uint8_t *regval);
uint8_t const regaddr,
FAR uint8_t *regval);
static int apds9960_i2c_write(FAR struct apds9960_dev_s *priv,
uint8_t const *data, int len);
static int apds9960_i2c_write8(FAR struct apds9960_dev_s *priv,
@@ -114,8 +116,6 @@ static int apds9960_i2c_write8(FAR struct apds9960_dev_s *priv,
/* Character driver methods */
static int apds9960_open(FAR struct file *filep);
static int apds9960_close(FAR struct file *filep);
static ssize_t apds9960_read(FAR struct file *filep, FAR char *buffer,
size_t buflen);
static ssize_t apds9960_write(FAR struct file *filep,
@@ -127,8 +127,8 @@ static ssize_t apds9960_write(FAR struct file *filep,
static const struct file_operations g_apds9960_fops =
{
apds9960_open, /* open */
apds9960_close, /* close */
NULL, /* open */
NULL, /* close */
apds9960_read, /* read */
apds9960_write, /* write */
NULL, /* seek */
@@ -1129,32 +1129,6 @@ static int apds9960_readgesture(FAR struct apds9960_dev_s *priv)
}
}
/****************************************************************************
* Name: apds9960_open
*
* Description:
* This function is called whenever the APDS9960 device is opened.
*
****************************************************************************/
static int apds9960_open(FAR struct file *filep)
{
return OK;
}
/****************************************************************************
* Name: apds9960_close
*
* Description:
* This routine is called when the APDS9960 device is closed.
*
****************************************************************************/
static int apds9960_close(FAR struct file *filep)
{
return OK;
}
/****************************************************************************
* Name: apds9960_read
****************************************************************************/
+10 -38
View File
@@ -99,8 +99,6 @@ static void as726x_write8(FAR struct as726x_dev_s *priv, uint8_t regaddr,
/* Character driver methods */
static int as726x_open(FAR struct file *filep);
static int as726x_close(FAR struct file *filep);
static ssize_t as726x_read(FAR struct file *filep, FAR char *buffer,
size_t buflen);
static ssize_t as726x_write(FAR struct file *filep,
@@ -112,8 +110,8 @@ static ssize_t as726x_write(FAR struct file *filep,
static const struct file_operations g_as726x_fops =
{
as726x_open, /* open */
as726x_close, /* close */
NULL, /* open */
NULL, /* close */
as726x_read, /* read */
as726x_write, /* write */
NULL, /* seek */
@@ -331,32 +329,6 @@ static void as726x_write8(FAR struct as726x_dev_s *priv, uint8_t regaddr,
write_register(priv, AS72XX_SLAVE_WRITE_REG, regval);
}
/****************************************************************************
* Name: as726x_open
*
* Description:
* This function is called whenever the AS726X device is opened.
*
****************************************************************************/
static int as726x_open(FAR struct file *filep)
{
return OK;
}
/****************************************************************************
* Name: as726x_close
*
* Description:
* This routine is called when the AS726X device is closed.
*
****************************************************************************/
static int as726x_close(FAR struct file *filep)
{
return OK;
}
/****************************************************************************
* Name: as726x_read
****************************************************************************/
@@ -445,7 +417,7 @@ int as726x_register(FAR const char *devpath, FAR struct i2c_master_s *i2c)
/* Check HW version for AS7262 and AS7263 */
_sensor_version = as726x_read8(priv, AS726x_HW_VERSION);
_sensor_version = as726x_read8(priv, AS726X_HW_VERSION);
if (_sensor_version != 0x3e && _sensor_version != 0x3f)
{
snerr("ID (should be 0x3e or 0x3f): 0x %d\n", ret);
@@ -455,7 +427,7 @@ int as726x_register(FAR const char *devpath, FAR struct i2c_master_s *i2c)
* Read the register value toggle and disable led
*/
ret = as726x_read8(priv, AS726x_LED_CONTROL);
ret = as726x_read8(priv, AS726X_LED_CONTROL);
if (ret < 0)
{
snerr("ERROR: Failed to initialize the AS726X!\n");
@@ -465,16 +437,16 @@ int as726x_register(FAR const char *devpath, FAR struct i2c_master_s *i2c)
value = ret;
value &= ~(1 << 0); /* Clear the bit */
as726x_write8(priv, AS726x_LED_CONTROL, value);
as726x_write8(priv, AS726X_LED_CONTROL, value);
/* If you use Mode 2 or 3 (all the colors) then integration time is double.
* 140*2 = 280ms between readings.
* 50 * 2.8ms = 140ms. 0 to 255 is valid.
*/
as726x_write8(priv, AS726x_INT_T, AS726X_INTEGRATION_TIME);
as726x_write8(priv, AS726X_INT_T, AS726X_INTEGRATION_TIME);
ret = as726x_read8(priv, AS726x_CONTROL_SETUP);
ret = as726x_read8(priv, AS726X_CONTROL_SETUP);
if (ret < 0)
{
snerr("ERROR: Failed to initialize the AS726X!\n");
@@ -485,9 +457,9 @@ int as726x_register(FAR const char *devpath, FAR struct i2c_master_s *i2c)
value &= 0b11001111; /* Clear GAIN bits */
value |= (AS726X_GAIN << 4); /* Set GAIN bits with user's choice */
as726x_write8(priv, AS726x_CONTROL_SETUP, value);
as726x_write8(priv, AS726X_CONTROL_SETUP, value);
ret = as726x_read8(priv, AS726x_CONTROL_SETUP);
ret = as726x_read8(priv, AS726X_CONTROL_SETUP);
if (ret < 0)
{
snerr("ERROR: Failed to initialize the AS726X!\n");
@@ -499,7 +471,7 @@ int as726x_register(FAR const char *devpath, FAR struct i2c_master_s *i2c)
value |= (AS726X_MEASURMENT_MODE << 2); /* Set BANK bits with user's
* choice */
as726x_write8(priv, AS726x_CONTROL_SETUP, value);
as726x_write8(priv, AS726X_CONTROL_SETUP, value);
/* Register the character driver */
+2 -28
View File
@@ -85,8 +85,8 @@ static int bh1750fvi_ioctl(FAR struct file *filep, int cmd,
static const struct file_operations g_bh1750fvi_fops =
{
bh1750fvi_open, /* open */
bh1750fvi_close, /* close */
NULL, /* open */
NULL, /* close */
bh1750fvi_read, /* read */
bh1750fvi_write, /* write */
NULL, /* seek */
@@ -171,32 +171,6 @@ static int bh1750fvi_write8(FAR struct bh1750fvi_dev_s *priv, uint8_t regval)
return ret;
}
/****************************************************************************
* Name: bh1750fvi_open
*
* Description:
* This function is called whenever the BH1750FVI device is opened.
*
****************************************************************************/
static int bh1750fvi_open(FAR struct file *filep)
{
return OK;
}
/****************************************************************************
* Name: bh1750fvi_close
*
* Description:
* This routine is called when the BH1750FVI device is closed.
*
****************************************************************************/
static int bh1750fvi_close(FAR struct file *filep)
{
return OK;
}
/****************************************************************************
* Name: bh1750fvi_read
****************************************************************************/

Some files were not shown because too many files have changed in this diff Show More