drivers: Replace DEV_INVALID_OP by -ENOTSUP
This patch replaces all occurences of the macro DEV_INVALID_OP by -ENOTSUP at the driver level. So this patch touch the files under drivers/, include/ and samples/drivers/ when applicable. This patch is part of the effort to transition from DEV_* codes to errno.h codes. Change-Id: I46aec3c65963018c479b01602e4a3eec8650eaff Signed-off-by: Andre Guedes <andre.guedes@intel.com>
This commit is contained in:
parent
7c956d2ece
commit
245e140da6
25 changed files with 116 additions and 88 deletions
|
@ -115,7 +115,7 @@ static int adc_qmsi_read(struct device *dev, struct adc_seq_table *seq_tbl)
|
|||
struct adc_info *info = dev->driver_data;
|
||||
|
||||
if (qm_adc_get_config(QM_ADC_0, &cfg) != QM_RC_OK) {
|
||||
return DEV_INVALID_OP;
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
for (i = 0; i < seq_tbl->num_entries; i++) {
|
||||
|
@ -170,7 +170,7 @@ static int adc_qmsi_read(struct device *dev, struct adc_seq_table *seq_tbl)
|
|||
struct adc_info *info = dev->driver_data;
|
||||
|
||||
if (qm_adc_get_config(QM_ADC_0, &cfg) != QM_RC_OK) {
|
||||
return DEV_INVALID_OP;
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
for (i = 0; i < seq_tbl->num_entries; i++) {
|
||||
|
|
|
@ -157,7 +157,7 @@ static int spi_flash_wb_write(struct device *dev, off_t offset,
|
|||
uint8_t *buf = driver_data->buf;
|
||||
|
||||
if (len > CONFIG_SPI_FLASH_W25QXXDV_MAX_DATA_LEN || offset < 0) {
|
||||
return DEV_INVALID_OP;
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
nano_sem_take(&driver_data->sem, TICKS_UNLIMITED);
|
||||
|
@ -235,7 +235,7 @@ static inline int spi_flash_wb_erase_internal(struct device *dev,
|
|||
uint32_t len;
|
||||
|
||||
if (offset < 0) {
|
||||
return DEV_INVALID_OP;
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
wait_for_flash_idle(dev);
|
||||
|
|
|
@ -18,6 +18,8 @@
|
|||
* @file Driver for the Atmel SAM3 PIO Controller.
|
||||
*/
|
||||
|
||||
#include <errno.h>
|
||||
|
||||
#include <nanokernel.h>
|
||||
|
||||
#include <device.h>
|
||||
|
@ -121,7 +123,7 @@ static int gpio_sam3_config(struct device *dev, int access_op,
|
|||
_config(dev, (0xFFFFFFFF), flags);
|
||||
break;
|
||||
default:
|
||||
return DEV_INVALID_OP;
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
@ -162,7 +164,7 @@ static int gpio_sam3_write(struct device *dev, int access_op,
|
|||
}
|
||||
break;
|
||||
default:
|
||||
return DEV_INVALID_OP;
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
@ -192,7 +194,7 @@ static int gpio_sam3_read(struct device *dev, int access_op,
|
|||
case GPIO_ACCESS_BY_PORT:
|
||||
break;
|
||||
default:
|
||||
return DEV_INVALID_OP;
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
@ -250,7 +252,7 @@ static int gpio_sam3_enable_callback(struct device *dev,
|
|||
mask = 0xFFFFFFFF;
|
||||
break;
|
||||
default:
|
||||
return DEV_INVALID_OP;
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
cfg->enabled_cb |= mask;
|
||||
|
@ -273,7 +275,7 @@ static int gpio_sam3_disable_callback(struct device *dev,
|
|||
mask = 0xFFFFFFFF;
|
||||
break;
|
||||
default:
|
||||
return DEV_INVALID_OP;
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
cfg->enabled_cb &= ~mask;
|
||||
|
@ -286,14 +288,14 @@ static int gpio_sam3_suspend_port(struct device *dev)
|
|||
{
|
||||
ARG_UNUSED(dev);
|
||||
|
||||
return DEV_INVALID_OP;
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
static int gpio_sam3_resume_port(struct device *dev)
|
||||
{
|
||||
ARG_UNUSED(dev);
|
||||
|
||||
return DEV_INVALID_OP;
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
static struct gpio_driver_api gpio_sam3_drv_api_funcs = {
|
||||
|
|
|
@ -18,6 +18,8 @@
|
|||
* @file Driver for the Freescale K64 GPIO module.
|
||||
*/
|
||||
|
||||
#include <errno.h>
|
||||
|
||||
#include <nanokernel.h>
|
||||
#include <device.h>
|
||||
#include <init.h>
|
||||
|
@ -41,7 +43,7 @@ static int gpio_k64_config(struct device *dev, int access_op,
|
|||
|
||||
if (((flags & GPIO_INT) && (flags & GPIO_DIR_OUT)) ||
|
||||
((flags & GPIO_DIR_IN) && (flags & GPIO_DIR_OUT))) {
|
||||
return DEV_INVALID_OP;
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -79,7 +81,7 @@ static int gpio_k64_config(struct device *dev, int access_op,
|
|||
} else if ((flags & GPIO_PUD_MASK) == GPIO_PUD_NORMAL) {
|
||||
setting = K64_PINMUX_PULL_DISABLE;
|
||||
} else {
|
||||
return DEV_INVALID_OP;
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -243,7 +245,7 @@ static int gpio_k64_suspend_port(struct device *dev)
|
|||
{
|
||||
ARG_UNUSED(dev);
|
||||
|
||||
return DEV_INVALID_OP;
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
|
||||
|
@ -251,7 +253,7 @@ static int gpio_k64_resume_port(struct device *dev)
|
|||
{
|
||||
ARG_UNUSED(dev);
|
||||
|
||||
return DEV_INVALID_OP;
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -18,6 +18,8 @@
|
|||
* @file Driver for the MMIO-based GPIO driver.
|
||||
*/
|
||||
|
||||
#include <errno.h>
|
||||
|
||||
#include <nanokernel.h>
|
||||
|
||||
#include <gpio.h>
|
||||
|
@ -141,7 +143,7 @@ static int gpio_mmio_config(struct device *dev, int access_op,
|
|||
cfg->access.write(cfg->reg.dir, 0, value);
|
||||
break;
|
||||
default:
|
||||
return DEV_INVALID_OP;
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -172,7 +174,7 @@ static int gpio_mmio_config(struct device *dev, int access_op,
|
|||
cfg->access.write(cfg->reg.en, 0, value);
|
||||
break;
|
||||
default:
|
||||
return DEV_INVALID_OP;
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
@ -206,7 +208,7 @@ static int gpio_mmio_write(struct device *dev, int access_op,
|
|||
cfg->access.write(cfg->reg.output, 0, value);
|
||||
break;
|
||||
default:
|
||||
return DEV_INVALID_OP;
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
@ -241,7 +243,7 @@ static int gpio_mmio_read(struct device *dev, int access_op,
|
|||
*value = cfg->access.read(cfg->reg.input, 0, 0);
|
||||
break;
|
||||
default:
|
||||
return DEV_INVALID_OP;
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
@ -253,7 +255,7 @@ static int gpio_mmio_set_callback(struct device *dev,
|
|||
ARG_UNUSED(dev);
|
||||
ARG_UNUSED(callback);
|
||||
|
||||
return DEV_INVALID_OP;
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
static int gpio_mmio_enable_callback(struct device *dev,
|
||||
|
@ -263,7 +265,7 @@ static int gpio_mmio_enable_callback(struct device *dev,
|
|||
ARG_UNUSED(access_op);
|
||||
ARG_UNUSED(pin);
|
||||
|
||||
return DEV_INVALID_OP;
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
static int gpio_mmio_disable_callback(struct device *dev,
|
||||
|
@ -273,21 +275,21 @@ static int gpio_mmio_disable_callback(struct device *dev,
|
|||
ARG_UNUSED(access_op);
|
||||
ARG_UNUSED(pin);
|
||||
|
||||
return DEV_INVALID_OP;
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
static int gpio_mmio_suspend_port(struct device *dev)
|
||||
{
|
||||
ARG_UNUSED(dev);
|
||||
|
||||
return DEV_INVALID_OP;
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
static int gpio_mmio_resume_port(struct device *dev)
|
||||
{
|
||||
ARG_UNUSED(dev);
|
||||
|
||||
return DEV_INVALID_OP;
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
static struct gpio_driver_api gpio_mmio_drv_api_funcs = {
|
||||
|
|
|
@ -18,6 +18,8 @@
|
|||
* @file Driver for PCAL9535A I2C-based GPIO driver.
|
||||
*/
|
||||
|
||||
#include <errno.h>
|
||||
|
||||
#include <nanokernel.h>
|
||||
|
||||
#include <gpio.h>
|
||||
|
@ -203,7 +205,7 @@ static int _setup_pin_dir(struct device *dev, int access_op,
|
|||
}
|
||||
break;
|
||||
default:
|
||||
ret = DEV_INVALID_OP;
|
||||
ret = -ENOTSUP;
|
||||
goto done;
|
||||
}
|
||||
|
||||
|
@ -264,7 +266,7 @@ static int _setup_pin_pullupdown(struct device *dev, int access_op,
|
|||
}
|
||||
break;
|
||||
default:
|
||||
ret = DEV_INVALID_OP;
|
||||
ret = -ENOTSUP;
|
||||
goto done;
|
||||
}
|
||||
|
||||
|
@ -296,7 +298,7 @@ en_dis:
|
|||
}
|
||||
break;
|
||||
default:
|
||||
ret = DEV_INVALID_OP;
|
||||
ret = -ENOTSUP;
|
||||
goto done;
|
||||
}
|
||||
|
||||
|
@ -348,7 +350,7 @@ static int _setup_pin_polarity(struct device *dev, int access_op,
|
|||
}
|
||||
break;
|
||||
default:
|
||||
ret = DEV_INVALID_OP;
|
||||
ret = -ENOTSUP;
|
||||
goto done;
|
||||
}
|
||||
|
||||
|
@ -461,7 +463,7 @@ static int gpio_pcal9535a_write(struct device *dev, int access_op,
|
|||
|
||||
break;
|
||||
default:
|
||||
ret = DEV_INVALID_OP;
|
||||
ret = -ENOTSUP;
|
||||
goto done;
|
||||
}
|
||||
|
||||
|
@ -504,7 +506,7 @@ static int gpio_pcal9535a_read(struct device *dev, int access_op,
|
|||
*value = buf.all;
|
||||
break;
|
||||
default:
|
||||
ret = DEV_INVALID_OP;
|
||||
ret = -ENOTSUP;
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -518,7 +520,7 @@ static int gpio_pcal9535a_set_callback(struct device *dev,
|
|||
ARG_UNUSED(dev);
|
||||
ARG_UNUSED(callback);
|
||||
|
||||
return DEV_INVALID_OP;
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
static int gpio_pcal9535a_enable_callback(struct device *dev,
|
||||
|
@ -528,7 +530,7 @@ static int gpio_pcal9535a_enable_callback(struct device *dev,
|
|||
ARG_UNUSED(access_op);
|
||||
ARG_UNUSED(pin);
|
||||
|
||||
return DEV_INVALID_OP;
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
static int gpio_pcal9535a_disable_callback(struct device *dev,
|
||||
|
@ -538,7 +540,7 @@ static int gpio_pcal9535a_disable_callback(struct device *dev,
|
|||
ARG_UNUSED(access_op);
|
||||
ARG_UNUSED(pin);
|
||||
|
||||
return DEV_INVALID_OP;
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
static int gpio_pcal9535a_suspend_port(struct device *dev)
|
||||
|
@ -547,7 +549,7 @@ static int gpio_pcal9535a_suspend_port(struct device *dev)
|
|||
return DEV_INVALID_CONF;
|
||||
}
|
||||
|
||||
return DEV_INVALID_OP;
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
static int gpio_pcal9535a_resume_port(struct device *dev)
|
||||
|
@ -556,7 +558,7 @@ static int gpio_pcal9535a_resume_port(struct device *dev)
|
|||
return DEV_INVALID_CONF;
|
||||
}
|
||||
|
||||
return DEV_INVALID_OP;
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
static struct gpio_driver_api gpio_pcal9535a_drv_api_funcs = {
|
||||
|
|
|
@ -16,6 +16,8 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <errno.h>
|
||||
|
||||
#include <nanokernel.h>
|
||||
#include <board.h>
|
||||
#include <init.h>
|
||||
|
@ -159,7 +161,7 @@ static int gpio_sch_write(struct device *dev,
|
|||
|
||||
if (access_op == GPIO_ACCESS_BY_PIN) {
|
||||
if (pin >= info->bits) {
|
||||
return DEV_INVALID_OP;
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
_set_bit_glvl(info->regs, pin, value);
|
||||
|
@ -179,7 +181,7 @@ static int gpio_sch_read(struct device *dev,
|
|||
|
||||
if (access_op == GPIO_ACCESS_BY_PIN) {
|
||||
if (pin >= info->bits) {
|
||||
return DEV_INVALID_OP;
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
*value = !!(*value & BIT(pin));
|
||||
|
@ -272,7 +274,7 @@ static int gpio_sch_enable_callback(struct device *dev,
|
|||
uint32_t bits = BIT(pin);
|
||||
|
||||
if (pin >= info->bits) {
|
||||
return DEV_INVALID_OP;
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
gpio->cb_enabled |= bits;
|
||||
|
@ -298,7 +300,7 @@ static int gpio_sch_disable_callback(struct device *dev,
|
|||
|
||||
if (access_op == GPIO_ACCESS_BY_PIN) {
|
||||
if (pin >= info->bits) {
|
||||
return DEV_INVALID_OP;
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
gpio->cb_enabled &= ~BIT(pin);
|
||||
|
|
|
@ -482,7 +482,7 @@ static int i2c_sam3_transfer(struct device *dev,
|
|||
|
||||
/* Why bother processing no messages */
|
||||
if (!msgs || !num_msgs) {
|
||||
return DEV_INVALID_OP;
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
/* Device is busy servicing another transfer */
|
||||
|
|
|
@ -440,7 +440,7 @@ static int i2c_dw_transfer(struct device *dev,
|
|||
|
||||
/* Why bother processing no messages */
|
||||
if (!msgs || !num_msgs) {
|
||||
return DEV_INVALID_OP;
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
/* First step, check if there is current activity */
|
||||
|
|
|
@ -148,7 +148,7 @@ static int i2c_qmsi_transfer(struct device *dev, struct i2c_msg *msgs,
|
|||
return DEV_USED;
|
||||
|
||||
if (msgs == NULL || num_msgs == 0)
|
||||
return DEV_INVALID_OP;
|
||||
return -ENOTSUP;
|
||||
|
||||
for (int i = 0; i < num_msgs; i++) {
|
||||
uint8_t *buf = msgs[i].buf;
|
||||
|
|
|
@ -438,7 +438,7 @@ static int i2c_qse_ss_intr_transfer(struct device *dev,
|
|||
|
||||
/* Why bother processing no messages */
|
||||
if (!msgs || !num_msgs) {
|
||||
return DEV_INVALID_OP;
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
/* First step, check if device is idle */
|
||||
|
|
|
@ -16,6 +16,8 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <errno.h>
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <nanokernel.h>
|
||||
#include <device.h>
|
||||
|
@ -168,7 +170,7 @@ static int _fsl_k64_set_pin(struct device *dev,
|
|||
|
||||
if (pin_id >= CONFIG_PINMUX_NUM_PINS) {
|
||||
|
||||
return DEV_INVALID_OP;
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
if ((func & K64_PINMUX_ALT_MASK) == K64_PINMUX_FUNC_GPIO) {
|
||||
|
@ -235,7 +237,7 @@ static int _fsl_k64_get_pin(struct device *dev,
|
|||
uint32_t status;
|
||||
|
||||
if (pin_id >= CONFIG_PINMUX_NUM_PINS) {
|
||||
return DEV_INVALID_OP;
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
/* determine the pin's port register base address */
|
||||
|
|
|
@ -185,7 +185,7 @@ static int pwm_dw_set_values(struct device *dev, int access_op,
|
|||
return 0;
|
||||
}
|
||||
|
||||
return DEV_INVALID_OP;
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
static int pwm_dw_set_duty_cycle(struct device *dev, int access_op,
|
||||
|
@ -200,21 +200,21 @@ static int pwm_dw_set_duty_cycle(struct device *dev, int access_op,
|
|||
ARG_UNUSED(pwm);
|
||||
ARG_UNUSED(duty);
|
||||
|
||||
return DEV_INVALID_OP;
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
static int pwm_dw_suspend(struct device *dev)
|
||||
{
|
||||
ARG_UNUSED(dev);
|
||||
|
||||
return DEV_INVALID_OP;
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
static int pwm_dw_resume(struct device *dev)
|
||||
{
|
||||
ARG_UNUSED(dev);
|
||||
|
||||
return DEV_INVALID_OP;
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
static struct pwm_driver_api pwm_dw_drv_api_funcs = {
|
||||
|
|
|
@ -42,6 +42,8 @@
|
|||
* - CONFIG_PWM_K64_FTM_x_PHASE_ENABLE_3 support non-zero phase on channel 3
|
||||
*/
|
||||
|
||||
#include <errno.h>
|
||||
|
||||
#include <nanokernel.h>
|
||||
|
||||
#include <board.h>
|
||||
|
@ -199,7 +201,7 @@ static int pwm_ftm_configure(struct device *dev, int access_op,
|
|||
default:
|
||||
/* Illegal prescale value. Default to 1. */
|
||||
prescale = PWM_K64_FTM_SC_PS_D1;
|
||||
return_val = DEV_INVALID_OP;
|
||||
return_val = -ENOTSUP;
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -294,9 +296,9 @@ static int pwm_ftm_set_values(struct device *dev, int access_op,
|
|||
case PWM_ACCESS_BY_PIN:
|
||||
break;
|
||||
case PWM_ACCESS_ALL:
|
||||
return DEV_INVALID_OP;
|
||||
return -ENOTSUP;
|
||||
default:
|
||||
return DEV_INVALID_OP;
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
/* If either ON and/or OFF > max ticks, treat PWM as 100%.
|
||||
|
@ -523,7 +525,7 @@ static int pwm_ftm_set_duty_cycle(struct device *dev, int access_op,
|
|||
|
||||
/* check for valid off value */
|
||||
if (off > config->period)
|
||||
return DEV_INVALID_OP;
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
return pwm_ftm_set_values(dev, access_op, channel, on, off);
|
||||
|
@ -567,36 +569,36 @@ static int pwm_ftm_set_phase(struct device *dev, int access_op,
|
|||
DBG("pwm_ftm_set_phase...\n");
|
||||
|
||||
if ((phase < 0) || (phase > config->period))
|
||||
return DEV_INVALID_OP;
|
||||
return -ENOTSUP;
|
||||
|
||||
switch (channel) {
|
||||
case 0:
|
||||
if (!config->phase_enable0)
|
||||
return DEV_INVALID_OP;
|
||||
return -ENOTSUP;
|
||||
drv_data->phase[0] = phase;
|
||||
break;
|
||||
|
||||
case 2:
|
||||
if (!config->phase_enable2)
|
||||
return DEV_INVALID_OP;
|
||||
return -ENOTSUP;
|
||||
drv_data->phase[1] = phase;
|
||||
break;
|
||||
|
||||
case 4:
|
||||
if (!config->phase_enable4)
|
||||
return DEV_INVALID_OP;
|
||||
return -ENOTSUP;
|
||||
drv_data->phase[2] = phase;
|
||||
break;
|
||||
|
||||
case 6:
|
||||
if (!config->phase_enable6)
|
||||
return DEV_INVALID_OP;
|
||||
return -ENOTSUP;
|
||||
drv_data->phase[3] = phase;
|
||||
break;
|
||||
|
||||
default:
|
||||
/* channel must be 0, 2, 4, or 6 */
|
||||
return DEV_INVALID_OP;
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
DBG("pwm_ftm_set_phase done.\n");
|
||||
|
@ -611,7 +613,7 @@ static int pwm_ftm_set_phase(struct device *dev, int access_op,
|
|||
|
||||
DBG("ERROR: non-zero phase is not supported.\n");
|
||||
|
||||
return DEV_INVALID_OP;
|
||||
return -ENOTSUP;
|
||||
#endif /*COMBINE_MODE_SUPPORT*/
|
||||
}
|
||||
|
||||
|
|
|
@ -18,6 +18,8 @@
|
|||
* @file Driver for PCA9685 I2C-based PWM driver.
|
||||
*/
|
||||
|
||||
#include <errno.h>
|
||||
|
||||
#include <nanokernel.h>
|
||||
|
||||
#include <i2c.h>
|
||||
|
@ -100,7 +102,7 @@ static int pwm_pca9685_set_values(struct device *dev, int access_op,
|
|||
buf[0] = REG_ALL_LED_ON_L;
|
||||
break;
|
||||
default:
|
||||
return DEV_INVALID_OP;
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
/* If either ON and/or OFF > max ticks, treat PWM as 100%.
|
||||
|
@ -160,7 +162,7 @@ static int pwm_pca9685_suspend(struct device *dev)
|
|||
return DEV_INVALID_CONF;
|
||||
}
|
||||
|
||||
return DEV_INVALID_OP;
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
static int pwm_pca9685_resume(struct device *dev)
|
||||
|
@ -169,7 +171,7 @@ static int pwm_pca9685_resume(struct device *dev)
|
|||
return DEV_INVALID_CONF;
|
||||
}
|
||||
|
||||
return DEV_INVALID_OP;
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
static struct pwm_driver_api pwm_pca9685_drv_api_funcs = {
|
||||
|
|
|
@ -84,7 +84,7 @@ static int __set_one_port(qm_pwm_t id, uint32_t pwm, uint32_t on, uint32_t off)
|
|||
* on: Duration for pin to stay high (must be >= 2)
|
||||
* off: Duration for pin to stay low (must be >= 2)
|
||||
*
|
||||
* return 0, DEV_INVALID_OP
|
||||
* return 0, -ENOTSUP
|
||||
*/
|
||||
static int pwm_qmsi_set_values(struct device *dev, int access_op,
|
||||
uint32_t pwm, uint32_t on, uint32_t off)
|
||||
|
@ -105,7 +105,7 @@ static int pwm_qmsi_set_values(struct device *dev, int access_op,
|
|||
}
|
||||
break;
|
||||
default:
|
||||
return DEV_INVALID_OP;
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
@ -124,7 +124,7 @@ static int pwm_qmsi_set_duty_cycle(struct device *dev, int access_op,
|
|||
ARG_UNUSED(pwm);
|
||||
ARG_UNUSED(duty);
|
||||
|
||||
return DEV_INVALID_OP;
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -133,13 +133,13 @@ static int pwm_qmsi_set_duty_cycle(struct device *dev, int access_op,
|
|||
*
|
||||
* Parameters
|
||||
* dev: Device struct
|
||||
* return DEV_INVALID_OP
|
||||
* return -ENOTSUP
|
||||
*/
|
||||
static int pwm_qmsi_suspend(struct device *dev)
|
||||
{
|
||||
ARG_UNUSED(dev);
|
||||
|
||||
return DEV_INVALID_OP;
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -148,13 +148,13 @@ static int pwm_qmsi_suspend(struct device *dev)
|
|||
*
|
||||
* Parameters
|
||||
* dev: Device struct
|
||||
* return DEV_INVALID_OP
|
||||
* return -ENOTSUP
|
||||
*/
|
||||
static int pwm_qmsi_resume(struct device *dev)
|
||||
{
|
||||
ARG_UNUSED(dev);
|
||||
|
||||
return DEV_INVALID_OP;
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
static struct pwm_driver_api pwm_qmsi_drv_api_funcs = {
|
||||
|
|
|
@ -16,6 +16,8 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <errno.h>
|
||||
|
||||
#include <nanokernel.h>
|
||||
#include <i2c.h>
|
||||
#include <init.h>
|
||||
|
@ -66,7 +68,7 @@ static int mcp9808_channel_get(struct device *dev,
|
|||
|
||||
#ifdef CONFIG_SENSOR_DEBUG
|
||||
if (chan != SENSOR_CHAN_TEMP) {
|
||||
return DEV_INVALID_OP;
|
||||
return -ENOTSUP;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
@ -17,6 +17,8 @@
|
|||
#ifndef __SENSOR_MCP9808_H__
|
||||
#define __SENSOR_MCP9808_H__
|
||||
|
||||
#include <errno.h>
|
||||
|
||||
#include <stdint.h>
|
||||
#include <device.h>
|
||||
#include <sensor.h>
|
||||
|
@ -82,14 +84,14 @@ static inline int mcp9808_attr_set(struct device *dev,
|
|||
enum sensor_attribute attr,
|
||||
const struct sensor_value *val)
|
||||
{
|
||||
return DEV_INVALID_OP;
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
static inline int mcp9808_trigger_set(struct device *dev,
|
||||
const struct sensor_trigger *trig,
|
||||
sensor_trigger_handler_t handler)
|
||||
{
|
||||
return DEV_INVALID_OP;
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
static void mcp9808_setup_interrupt(struct device *dev)
|
||||
|
|
|
@ -16,6 +16,8 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <errno.h>
|
||||
|
||||
#include <nanokernel.h>
|
||||
#include <i2c.h>
|
||||
#include <sensor.h>
|
||||
|
@ -108,7 +110,7 @@ static int sx9500_channel_get(struct device *dev,
|
|||
|
||||
#ifdef CONFIG_SENSOR_DEBUG
|
||||
if (chan != SENSOR_CHAN_PROX) {
|
||||
return DEV_INVALID_OP;
|
||||
return -ENOTSUP;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
@ -30,6 +30,8 @@
|
|||
* UART_REG_ADDR_INTERVAL
|
||||
*/
|
||||
|
||||
#include <errno.h>
|
||||
|
||||
#include <nanokernel.h>
|
||||
#include <arch/cpu.h>
|
||||
#include <stdint.h>
|
||||
|
@ -297,7 +299,7 @@ static int uart_ns16550_init(struct device *dev)
|
|||
uint8_t mdc = 0;
|
||||
|
||||
if (!ns16550_pci_uart_scan(dev)) {
|
||||
return DEV_INVALID_OP;
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_UART_INTERRUPT_DRIVEN
|
||||
|
@ -658,7 +660,7 @@ static int uart_ns16550_line_ctrl_set(struct device *dev,
|
|||
return 0;
|
||||
}
|
||||
|
||||
return DEV_INVALID_OP;
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
#endif /* CONFIG_UART_NS16550_LINE_CTRL */
|
||||
|
@ -686,7 +688,7 @@ static int uart_ns16550_drv_cmd(struct device *dev, uint32_t cmd, uint32_t p)
|
|||
|
||||
}
|
||||
|
||||
return DEV_INVALID_OP;
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
#endif /* CONFIG_UART_NS16550_DRV_CMD */
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <errno.h>
|
||||
|
||||
#include <nanokernel.h>
|
||||
#include <arch/cpu.h>
|
||||
#include <sections.h>
|
||||
|
@ -70,7 +72,7 @@ unsigned char uart_nsim_poll_out(struct device *dev, unsigned char c)
|
|||
|
||||
static int uart_nsim_poll_in(struct device *dev, unsigned char *c)
|
||||
{
|
||||
return -DEV_INVALID_OP;
|
||||
return -ENOTSUP;
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -489,7 +489,7 @@ static int spi_k64_configure(struct device *dev, struct spi_config *config)
|
|||
|
||||
frame_sz = SPI_WORD_SIZE_GET(flags);
|
||||
if (frame_sz > SPI_K64_WORD_SIZE_MAX) {
|
||||
return DEV_INVALID_OP;
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
spi_data->frame_sz = frame_sz;
|
||||
|
@ -499,7 +499,7 @@ static int spi_k64_configure(struct device *dev, struct spi_config *config)
|
|||
/* Set baud rate and signal timing parameters (delays) */
|
||||
|
||||
if (spi_k64_set_baud_rate(config->max_sys_freq, &ctar) == 0) {
|
||||
return DEV_INVALID_OP;
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -513,7 +513,7 @@ static int spi_k64_configure(struct device *dev, struct spi_config *config)
|
|||
if (spi_k64_set_delay(DELAY_AFTER_SCK,
|
||||
(NSEC_PER_SEC / 2) / config->max_sys_freq,
|
||||
&ctar) == 0) {
|
||||
return DEV_INVALID_OP;
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -36,6 +36,7 @@ extern "C" {
|
|||
#define PWM_ACCESS_BY_PIN 0
|
||||
#define PWM_ACCESS_ALL 1
|
||||
|
||||
#include <errno.h>
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
#include <device.h>
|
||||
|
@ -145,7 +146,7 @@ static inline int pwm_pin_set_phase(struct device *dev, uint32_t pwm,
|
|||
return api->set_phase(dev, PWM_ACCESS_BY_PIN, pwm, phase);
|
||||
}
|
||||
|
||||
return DEV_INVALID_OP;
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -226,7 +227,7 @@ static inline int pwm_all_set_phase(struct device *dev, uint8_t phase)
|
|||
return api->set_phase(dev, PWM_ACCESS_ALL, 0, phase);
|
||||
}
|
||||
|
||||
return DEV_INVALID_OP;
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -201,7 +201,7 @@ static inline int sensor_attr_set(struct device *dev,
|
|||
|
||||
api = (struct sensor_driver_api *)dev->driver_api;
|
||||
if (!api->attr_set) {
|
||||
return DEV_INVALID_OP;
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
return api->attr_set(dev, chan, attr, val);
|
||||
|
@ -230,7 +230,7 @@ static inline int sensor_trigger_set(struct device *dev,
|
|||
|
||||
api = (struct sensor_driver_api *)dev->driver_api;
|
||||
if (!api->trigger_set) {
|
||||
return DEV_INVALID_OP;
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
return api->trigger_set(dev, trig, handler);
|
||||
|
|
|
@ -33,6 +33,7 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <errno.h>
|
||||
#include <stddef.h>
|
||||
|
||||
#include <device.h>
|
||||
|
@ -205,7 +206,7 @@ static inline int uart_err_check(struct device *dev)
|
|||
*
|
||||
* @retval 0 If a character arrived.
|
||||
* @retval -1 If the input buffer if empty.
|
||||
* @retval DEV_INVALID_OP If the operation is not supported.
|
||||
* @retval -ENOTSUP If the operation is not supported.
|
||||
*/
|
||||
static inline int uart_poll_in(struct device *dev, unsigned char *p_char)
|
||||
{
|
||||
|
@ -582,7 +583,7 @@ static inline int uart_line_ctrl_set(struct device *dev,
|
|||
return api->line_ctrl_set(dev, ctrl, val);
|
||||
}
|
||||
|
||||
return DEV_INVALID_OP;
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
#endif /* CONFIG_UART_LINE_CTRL */
|
||||
|
@ -612,7 +613,7 @@ static inline int uart_drv_cmd(struct device *dev, uint32_t cmd, uint32_t p)
|
|||
return api->drv_cmd(dev, cmd, p);
|
||||
}
|
||||
|
||||
return DEV_INVALID_OP;
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
#endif /* CONFIG_UART_DRV_CMD */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue