arch/arm: Remove FAR and CODE from chip folder(1)
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
parent
fead1964cb
commit
03c31d332f
330 changed files with 6149 additions and 6159 deletions
|
|
@ -555,7 +555,7 @@ CXD56_AUDIO_ECODE cxd56_audio_poweroff_dnc(void);
|
|||
*/
|
||||
|
||||
CXD56_AUDIO_ECODE cxd56_audio_en_dnc(cxd56_audio_dnc_id_t id,
|
||||
FAR cxd56_audio_dnc_bin_t *bin);
|
||||
cxd56_audio_dnc_bin_t *bin);
|
||||
|
||||
/* Disable DNC
|
||||
*
|
||||
|
|
@ -573,7 +573,7 @@ CXD56_AUDIO_ECODE cxd56_audio_dis_dnc(cxd56_audio_dnc_id_t id);
|
|||
* CXD56_AUDIO_ECODE return code
|
||||
*/
|
||||
|
||||
CXD56_AUDIO_ECODE cxd56_audio_en_deq(FAR cxd56_audio_deq_coef_t *coef);
|
||||
CXD56_AUDIO_ECODE cxd56_audio_en_deq(cxd56_audio_deq_coef_t *coef);
|
||||
|
||||
/* Disable DEQ
|
||||
*
|
||||
|
|
@ -708,7 +708,7 @@ CXD56_AUDIO_ECODE cxd56_audio_stop_beep(void);
|
|||
* CXD56_AUDIO_ECODE return code
|
||||
*/
|
||||
|
||||
CXD56_AUDIO_ECODE cxd56_audio_set_micgain(FAR cxd56_audio_mic_gain_t *gain);
|
||||
CXD56_AUDIO_ECODE cxd56_audio_set_micgain(cxd56_audio_mic_gain_t *gain);
|
||||
|
||||
/* Set DEQ table
|
||||
*
|
||||
|
|
@ -719,7 +719,7 @@ CXD56_AUDIO_ECODE cxd56_audio_set_micgain(FAR cxd56_audio_mic_gain_t *gain);
|
|||
*/
|
||||
|
||||
CXD56_AUDIO_ECODE cxd56_audio_set_deq(bool en,
|
||||
FAR cxd56_audio_deq_coef_t *deq);
|
||||
cxd56_audio_deq_coef_t *deq);
|
||||
|
||||
/* Get dma handle
|
||||
*
|
||||
|
|
@ -730,7 +730,7 @@ CXD56_AUDIO_ECODE cxd56_audio_set_deq(bool en,
|
|||
*/
|
||||
|
||||
CXD56_AUDIO_ECODE cxd56_audio_get_dmahandle(cxd56_audio_dma_path_t path,
|
||||
FAR cxd56_audio_dma_t *handle);
|
||||
cxd56_audio_dma_t *handle);
|
||||
|
||||
/* Free dma handle
|
||||
*
|
||||
|
|
@ -739,7 +739,7 @@ CXD56_AUDIO_ECODE cxd56_audio_get_dmahandle(cxd56_audio_dma_path_t path,
|
|||
* CXD56_AUDIO_ECODE return code
|
||||
*/
|
||||
|
||||
CXD56_AUDIO_ECODE cxd56_audio_free_dmahandle(FAR cxd56_audio_dma_t handle);
|
||||
CXD56_AUDIO_ECODE cxd56_audio_free_dmahandle(cxd56_audio_dma_t handle);
|
||||
|
||||
/* Set internal data path
|
||||
*
|
||||
|
|
@ -763,7 +763,7 @@ CXD56_AUDIO_ECODE cxd56_audio_set_datapath(cxd56_audio_signal_t sig,
|
|||
|
||||
CXD56_AUDIO_ECODE cxd56_audio_init_dma(cxd56_audio_dma_t handle,
|
||||
cxd56_audio_samp_fmt_t fmt,
|
||||
FAR uint8_t *ch_num);
|
||||
uint8_t *ch_num);
|
||||
|
||||
/* Initialize dma transfer function
|
||||
*
|
||||
|
|
@ -774,7 +774,7 @@ CXD56_AUDIO_ECODE cxd56_audio_init_dma(cxd56_audio_dma_t handle,
|
|||
*/
|
||||
|
||||
CXD56_AUDIO_ECODE cxd56_audio_set_dmacb(cxd56_audio_dma_t handle,
|
||||
FAR cxd56_audio_dma_cb_t cb);
|
||||
cxd56_audio_dma_cb_t cb);
|
||||
|
||||
/* Enable dma interrupt
|
||||
*
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ struct bat_monitor_rec_s
|
|||
|
||||
struct bat_monitor_log_s
|
||||
{
|
||||
FAR struct bat_monitor_rec_s *rec;
|
||||
struct bat_monitor_rec_s *rec;
|
||||
int index;
|
||||
int size;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -40,8 +40,8 @@ extern "C"
|
|||
* Public Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
int cxd56_ge2dinitialize(FAR const char *devname);
|
||||
void cxd56_ge2duninitialize(FAR const char *devname);
|
||||
int cxd56_ge2dinitialize(const char *devname);
|
||||
void cxd56_ge2duninitialize(const char *devname);
|
||||
|
||||
#undef EXTERN
|
||||
#if defined(__cplusplus)
|
||||
|
|
|
|||
|
|
@ -699,11 +699,11 @@ struct cxd56_gnss_ope_mode_param_s
|
|||
|
||||
struct cxd56_gnss_orbital_param_s
|
||||
{
|
||||
uint32_t type; /* One of #CXD56_GNSS_DATA_GPS,
|
||||
* #CXD56_GNSS_DATA_GLONASS or
|
||||
* #CXD56_GNSS_DATA_QZSSL1CA.
|
||||
*/
|
||||
FAR uint32_t *data; /* Address pointing to almanac or ephemeris data buffer */
|
||||
uint32_t type; /* One of #CXD56_GNSS_DATA_GPS,
|
||||
* #CXD56_GNSS_DATA_GLONASS or
|
||||
* #CXD56_GNSS_DATA_QZSSL1CA.
|
||||
*/
|
||||
uint32_t *data; /* Address pointing to almanac or ephemeris data buffer */
|
||||
};
|
||||
|
||||
/* date and time */
|
||||
|
|
@ -736,9 +736,9 @@ struct cxd56_gnss_orthogonal_position_s
|
|||
|
||||
struct cxd56_gnss_cep_data_s
|
||||
{
|
||||
FAR uint32_t *data;
|
||||
uint32_t size;
|
||||
uint32_t counter;
|
||||
uint32_t *data;
|
||||
uint32_t size;
|
||||
uint32_t counter;
|
||||
};
|
||||
|
||||
/* CEP age info */
|
||||
|
|
@ -753,24 +753,24 @@ struct cxd56_gnss_cep_age_s
|
|||
|
||||
struct cxd56_gnss_agps_acquist_s
|
||||
{
|
||||
FAR uint8_t *data; /* Address pointing to aquist data buffer */
|
||||
uint16_t size; /* Aquist data size */
|
||||
uint8_t *data; /* Address pointing to aquist data buffer */
|
||||
uint16_t size; /* Aquist data size */
|
||||
};
|
||||
|
||||
/* tow assist data and size for AGPS */
|
||||
|
||||
struct cxd56_gnss_agps_tow_assist_s
|
||||
{
|
||||
FAR uint8_t *data; /* Address pointing to tow assist data buffer */
|
||||
uint16_t size; /* assist data size */
|
||||
uint8_t *data; /* Address pointing to tow assist data buffer */
|
||||
uint16_t size; /* assist data size */
|
||||
};
|
||||
|
||||
/* utc model data and size for AGPS */
|
||||
|
||||
struct cxd56_gnss_agps_utc_model_s
|
||||
{
|
||||
FAR uint8_t *data; /* Address pointing to utc model data buffer */
|
||||
uint16_t size; /* utc model data size */
|
||||
uint8_t *data; /* Address pointing to utc model data buffer */
|
||||
uint16_t size; /* utc model data size */
|
||||
};
|
||||
|
||||
/* Time from frame start[sec]. */
|
||||
|
|
@ -833,21 +833,21 @@ struct cxd56_gnss_test_result_s
|
|||
|
||||
struct cxd56_gnss_signal_setting_s
|
||||
{
|
||||
int fd; /* The descriptor for signal handler */
|
||||
uint8_t enable; /* 1 when set this setting, 0 is clear */
|
||||
uint8_t gnsssig; /* GNSS signal as CXD56_GNSS_SIG_GNSS, _AGPS, etc. */
|
||||
int signo; /* system signal number to notify read completion */
|
||||
FAR void *data; /* user data */
|
||||
int fd; /* The descriptor for signal handler */
|
||||
uint8_t enable; /* 1 when set this setting, 0 is clear */
|
||||
uint8_t gnsssig; /* GNSS signal as CXD56_GNSS_SIG_GNSS, _AGPS, etc. */
|
||||
int signo; /* system signal number to notify read completion */
|
||||
void *data; /* user data */
|
||||
};
|
||||
|
||||
/* Information for use after being signaled to read data asynchronously */
|
||||
|
||||
struct cxd56_gnss_signal_info_s
|
||||
{
|
||||
int fd; /* The file descriptor to use in signal handler */
|
||||
uint8_t gnsssig; /* GNSS signal as CXD56_GNSS_SIG_GNSS, _AGPS, etc. */
|
||||
int signo; /* system signal number to notify read completion */
|
||||
FAR void *data; /* user data */
|
||||
int fd; /* The file descriptor to use in signal handler */
|
||||
uint8_t gnsssig; /* GNSS signal as CXD56_GNSS_SIG_GNSS, _AGPS, etc. */
|
||||
int signo; /* system signal number to notify read completion */
|
||||
void *data; /* user data */
|
||||
};
|
||||
|
||||
/* PVTLOG setting Parameter.
|
||||
|
|
|
|||
|
|
@ -101,7 +101,7 @@ extern "C"
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
int hostif_i2cinitialize(FAR struct hostif_i2cconf_s *config);
|
||||
int hostif_i2cinitialize(struct hostif_i2cconf_s *config);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: hostif_spiinitialize
|
||||
|
|
@ -117,7 +117,7 @@ int hostif_i2cinitialize(FAR struct hostif_i2cconf_s *config);
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
int hostif_spiinitialize(FAR struct hostif_spiconf_s *config);
|
||||
int hostif_spiinitialize(struct hostif_spiconf_s *config);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: hostif_uninitialize
|
||||
|
|
|
|||
|
|
@ -327,7 +327,7 @@ struct scuev_notify_s
|
|||
|
||||
uint32_t ctrl; /* Event control */
|
||||
|
||||
FAR struct scuev_arg_s *arg; /* Arguments for event raised */
|
||||
struct scuev_arg_s *arg; /* Arguments for event raised */
|
||||
};
|
||||
|
||||
/* Offset/gain adjustment parameter */
|
||||
|
|
@ -364,7 +364,7 @@ struct scufifo_wm_s
|
|||
|
||||
/* Pointer to memory to be timestamp stored */
|
||||
|
||||
FAR struct scutimestamp_s *ts;
|
||||
struct scutimestamp_s *ts;
|
||||
|
||||
/* Watermark value. SCU notifies when
|
||||
* stored samples over watermark in FIFO.
|
||||
|
|
@ -389,14 +389,14 @@ struct seq_s; /* The sequencer object */
|
|||
* return: struct seq_s pointer is success. NULL is failure.
|
||||
*/
|
||||
|
||||
FAR struct seq_s *seq_open(int type, int bustype);
|
||||
struct seq_s *seq_open(int type, int bustype);
|
||||
|
||||
/* Close sequencer device
|
||||
*
|
||||
* param [in] seq : Sequencer instance
|
||||
*/
|
||||
|
||||
void seq_close(FAR struct seq_s *seq);
|
||||
void seq_close(struct seq_s *seq);
|
||||
|
||||
/* Read sequencer FIFO data
|
||||
*
|
||||
|
|
@ -408,7 +408,7 @@ void seq_close(FAR struct seq_s *seq);
|
|||
* return : OK(0) is success. negative value is failure.
|
||||
*/
|
||||
|
||||
int seq_read(FAR struct seq_s *seq, int fifoid, char *buffer, int length);
|
||||
int seq_read(struct seq_s *seq, int fifoid, char *buffer, int length);
|
||||
|
||||
/* Sequencer specific ioctl
|
||||
*
|
||||
|
|
@ -424,7 +424,7 @@ int seq_read(FAR struct seq_s *seq, int fifoid, char *buffer, int length);
|
|||
* return: OK(0) is success. negative value is failure.
|
||||
*/
|
||||
|
||||
int seq_ioctl(FAR struct seq_s *seq, int fifoid, int cmd, unsigned long arg);
|
||||
int seq_ioctl(struct seq_s *seq, int fifoid, int cmd, unsigned long arg);
|
||||
|
||||
/* Set cyclic sequencer instruction
|
||||
*
|
||||
|
|
@ -435,7 +435,7 @@ int seq_ioctl(FAR struct seq_s *seq, int fifoid, int cmd, unsigned long arg);
|
|||
* return OK(0) is success. negative value is failure.
|
||||
*/
|
||||
|
||||
int seq_setinstruction(FAR struct seq_s *seq, const uint16_t *inst,
|
||||
int seq_setinstruction(struct seq_s *seq, const uint16_t *inst,
|
||||
uint16_t nr_insts);
|
||||
|
||||
/* Set sample data format
|
||||
|
|
@ -449,7 +449,7 @@ int seq_setinstruction(FAR struct seq_s *seq, const uint16_t *inst,
|
|||
* return OK(0) is success. negative value is failure.
|
||||
*/
|
||||
|
||||
void seq_setsample(FAR struct seq_s *seq, uint8_t sample, uint8_t offset,
|
||||
void seq_setsample(struct seq_s *seq, uint8_t sample, uint8_t offset,
|
||||
uint8_t elemsize, bool swapbyte);
|
||||
|
||||
/* Set slave ID or address
|
||||
|
|
@ -458,7 +458,7 @@ void seq_setsample(FAR struct seq_s *seq, uint8_t sample, uint8_t offset,
|
|||
* param [in] slave_addr : In SPI, slave select ID. In I2C, bus address.
|
||||
*/
|
||||
|
||||
void seq_setaddress(FAR struct seq_s *seq, uint32_t slave_addr);
|
||||
void seq_setaddress(struct seq_s *seq, uint32_t slave_addr);
|
||||
|
||||
/* SPI data transfer via sequencer.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -47,8 +47,8 @@
|
|||
|
||||
struct timer_sethandler_s
|
||||
{
|
||||
FAR void *arg; /* An argument */
|
||||
CODE tccb_t handler; /* The timer interrupt handler */
|
||||
void *arg; /* An argument */
|
||||
tccb_t handler; /* The timer interrupt handler */
|
||||
};
|
||||
|
||||
#endif /* __ARCH_ARM_INCLUDE_CXD56XX_TIMER_H */
|
||||
|
|
|
|||
|
|
@ -40,8 +40,8 @@ extern "C"
|
|||
* Public Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
int cxd56_uart0initialize(FAR const char *devname);
|
||||
void cxd56_uart0uninitialize(FAR const char *devname);
|
||||
int cxd56_uart0initialize(const char *devname);
|
||||
void cxd56_uart0uninitialize(const char *devname);
|
||||
|
||||
#undef EXTERN
|
||||
#if defined(__cplusplus)
|
||||
|
|
|
|||
|
|
@ -126,20 +126,20 @@ static void can_putreg(struct up_dev_s *priv, int offset, uint32_t value);
|
|||
|
||||
/* CAN methods */
|
||||
|
||||
static void can_reset(FAR struct can_dev_s *dev);
|
||||
static int can_setup(FAR struct can_dev_s *dev);
|
||||
static void can_shutdown(FAR struct can_dev_s *dev);
|
||||
static void can_rxint(FAR struct can_dev_s *dev, bool enable);
|
||||
static void can_txint(FAR struct can_dev_s *dev, bool enable);
|
||||
static int can_ioctl(FAR struct can_dev_s *dev, int cmd, unsigned long arg);
|
||||
static int can_remoterequest(FAR struct can_dev_s *dev, uint16_t id);
|
||||
static int can_send(FAR struct can_dev_s *dev, FAR struct can_msg_s *msg);
|
||||
static bool candev_txready(FAR struct can_dev_s *dev);
|
||||
static bool candev_txempty(FAR struct can_dev_s *dev);
|
||||
static void can_reset(struct can_dev_s *dev);
|
||||
static int can_setup(struct can_dev_s *dev);
|
||||
static void can_shutdown(struct can_dev_s *dev);
|
||||
static void can_rxint(struct can_dev_s *dev, bool enable);
|
||||
static void can_txint(struct can_dev_s *dev, bool enable);
|
||||
static int can_ioctl(struct can_dev_s *dev, int cmd, unsigned long arg);
|
||||
static int can_remoterequest(struct can_dev_s *dev, uint16_t id);
|
||||
static int can_send(struct can_dev_s *dev, struct can_msg_s *msg);
|
||||
static bool candev_txready(struct can_dev_s *dev);
|
||||
static bool candev_txempty(struct can_dev_s *dev);
|
||||
|
||||
/* CAN interrupts */
|
||||
|
||||
static int can_interrupt(int irq, FAR void *context, FAR void *arg);
|
||||
static int can_interrupt(int irq, void *context, void *arg);
|
||||
|
||||
/* Message Processing */
|
||||
|
||||
|
|
@ -357,9 +357,9 @@ static void can_putreg(struct up_dev_s *priv, int offset, uint32_t value)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static void can_reset(FAR struct can_dev_s *dev)
|
||||
static void can_reset(struct can_dev_s *dev)
|
||||
{
|
||||
FAR struct up_dev_s *priv = (FAR struct up_dev_s *)dev->cd_priv;
|
||||
struct up_dev_s *priv = (struct up_dev_s *)dev->cd_priv;
|
||||
|
||||
caninfo("CAN%d reset\n", priv->port);
|
||||
|
||||
|
|
@ -387,9 +387,9 @@ static void can_reset(FAR struct can_dev_s *dev)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int can_setup(FAR struct can_dev_s *dev)
|
||||
static int can_setup(struct can_dev_s *dev)
|
||||
{
|
||||
FAR struct up_dev_s *priv = (FAR struct up_dev_s *) dev->cd_priv;
|
||||
struct up_dev_s *priv = (struct up_dev_s *)dev->cd_priv;
|
||||
uint32_t regval;
|
||||
uint8_t i;
|
||||
int ret = ERROR;
|
||||
|
|
@ -415,7 +415,7 @@ static int can_setup(FAR struct can_dev_s *dev)
|
|||
{
|
||||
}
|
||||
|
||||
ret = irq_attach(priv->irq, can_interrupt, (FAR void *)dev);
|
||||
ret = irq_attach(priv->irq, can_interrupt, (void *)dev);
|
||||
if (ret == OK)
|
||||
{
|
||||
up_enable_irq(priv->irq);
|
||||
|
|
@ -445,9 +445,9 @@ static int can_setup(FAR struct can_dev_s *dev)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static void can_shutdown(FAR struct can_dev_s *dev)
|
||||
static void can_shutdown(struct can_dev_s *dev)
|
||||
{
|
||||
FAR struct up_dev_s *priv = (FAR struct up_dev_s *) dev->cd_priv;
|
||||
struct up_dev_s *priv = (struct up_dev_s *)dev->cd_priv;
|
||||
uint32_t regval;
|
||||
|
||||
caninfo("CAN%d\n", priv->port);
|
||||
|
|
@ -488,9 +488,9 @@ static void can_shutdown(FAR struct can_dev_s *dev)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static void can_rxint(FAR struct can_dev_s *dev, bool enable)
|
||||
static void can_rxint(struct can_dev_s *dev, bool enable)
|
||||
{
|
||||
FAR struct up_dev_s *priv = (FAR struct up_dev_s *) dev->cd_priv;
|
||||
struct up_dev_s *priv = (struct up_dev_s *)dev->cd_priv;
|
||||
|
||||
if (enable == true)
|
||||
{
|
||||
|
|
@ -520,7 +520,7 @@ static void can_rxint(FAR struct can_dev_s *dev, bool enable)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static void can_txint(FAR struct can_dev_s *dev, bool enable)
|
||||
static void can_txint(struct can_dev_s *dev, bool enable)
|
||||
{
|
||||
/* The TX interrupt is automatically enabled in can_send within a
|
||||
* message object.
|
||||
|
|
@ -541,7 +541,7 @@ static void can_txint(FAR struct can_dev_s *dev, bool enable)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int can_ioctl(FAR struct can_dev_s *dev, int cmd, unsigned long arg)
|
||||
static int can_ioctl(struct can_dev_s *dev, int cmd, unsigned long arg)
|
||||
{
|
||||
caninfo("Fix me:Not Implemented\n");
|
||||
return 0;
|
||||
|
|
@ -561,7 +561,7 @@ static int can_ioctl(FAR struct can_dev_s *dev, int cmd, unsigned long arg)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int can_remoterequest(FAR struct can_dev_s *dev, uint16_t id)
|
||||
static int can_remoterequest(struct can_dev_s *dev, uint16_t id)
|
||||
{
|
||||
caninfo("Fix me:Not Implemented\n");
|
||||
return 0;
|
||||
|
|
@ -590,9 +590,9 @@ static int can_remoterequest(FAR struct can_dev_s *dev, uint16_t id)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int can_send(FAR struct can_dev_s *dev, FAR struct can_msg_s *msg)
|
||||
static int can_send(struct can_dev_s *dev, struct can_msg_s *msg)
|
||||
{
|
||||
FAR struct up_dev_s *priv = (FAR struct up_dev_s *) dev->cd_priv;
|
||||
struct up_dev_s *priv = (struct up_dev_s *)dev->cd_priv;
|
||||
uint32_t regval;
|
||||
uint32_t num;
|
||||
uint32_t id;
|
||||
|
|
@ -686,9 +686,9 @@ static int can_send(FAR struct can_dev_s *dev, FAR struct can_msg_s *msg)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static bool candev_txready(FAR struct can_dev_s *dev)
|
||||
static bool candev_txready(struct can_dev_s *dev)
|
||||
{
|
||||
FAR struct up_dev_s *priv = (FAR struct up_dev_s *) dev->cd_priv;
|
||||
struct up_dev_s *priv = (struct up_dev_s *)dev->cd_priv;
|
||||
|
||||
if (can_getreg(priv, AM335X_DCAN_TXRQ34_OFFSET) != 0xffffffff)
|
||||
{
|
||||
|
|
@ -721,9 +721,9 @@ static bool candev_txready(FAR struct can_dev_s *dev)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static bool candev_txempty(FAR struct can_dev_s *dev)
|
||||
static bool candev_txempty(struct can_dev_s *dev)
|
||||
{
|
||||
FAR struct up_dev_s *priv = (FAR struct up_dev_s *) dev->cd_priv;
|
||||
struct up_dev_s *priv = (struct up_dev_s *)dev->cd_priv;
|
||||
return (!((can_getreg(priv, AM335X_DCAN_TXRQ_X_OFFSET)) & 0xffff));
|
||||
}
|
||||
|
||||
|
|
@ -744,10 +744,10 @@ static bool candev_txempty(FAR struct can_dev_s *dev)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int can_interrupt(int irq, FAR void *context, FAR void *arg)
|
||||
static int can_interrupt(int irq, void *context, void *arg)
|
||||
{
|
||||
struct can_dev_s *dev = (FAR struct can_dev_s *)arg;
|
||||
FAR struct up_dev_s *priv;
|
||||
struct can_dev_s *dev = (struct can_dev_s *)arg;
|
||||
struct up_dev_s *priv;
|
||||
uint32_t regval = 0;
|
||||
|
||||
DEBUGASSERT(dev != NULL && dev->cd_priv != NULL);
|
||||
|
|
@ -1070,9 +1070,9 @@ static int can_bittiming(struct up_dev_s *priv)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
FAR struct can_dev_s *am335x_can_initialize(int port)
|
||||
struct can_dev_s *am335x_can_initialize(int port)
|
||||
{
|
||||
FAR struct can_dev_s *candev;
|
||||
struct can_dev_s *candev;
|
||||
irqstate_t flags;
|
||||
|
||||
syslog(LOG_DEBUG, "CAN%d\n", port);
|
||||
|
|
@ -1116,7 +1116,7 @@ FAR struct can_dev_s *am335x_can_initialize(int port)
|
|||
return candev;
|
||||
}
|
||||
|
||||
void am335x_can_uninitialize(FAR struct can_dev_s *dev)
|
||||
void am335x_can_uninitialize(struct can_dev_s *dev)
|
||||
{
|
||||
irqstate_t flags;
|
||||
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
FAR struct can_dev_s *am335x_can_initialize(int port);
|
||||
struct can_dev_s *am335x_can_initialize(int port);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: am335x_can_uninitialize
|
||||
|
|
@ -66,6 +66,6 @@ FAR struct can_dev_s *am335x_can_initialize(int port);
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
void am335x_can_uninitialize(FAR struct can_dev_s *dev);
|
||||
void am335x_can_uninitialize(struct can_dev_s *dev);
|
||||
|
||||
#endif /* __ARCH_ARM_SRC_AM335X_AM335X_CAN_H */
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@
|
|||
****************************************************************************/
|
||||
|
||||
static uint32_t
|
||||
am335x_videomode_vrefresh(FAR const struct videomode_s *videomode)
|
||||
am335x_videomode_vrefresh(const struct videomode_s *videomode)
|
||||
{
|
||||
uint32_t refresh;
|
||||
|
||||
|
|
@ -114,7 +114,7 @@ static uint32_t
|
|||
****************************************************************************/
|
||||
|
||||
static bool
|
||||
am335x_videomode_valid(FAR const struct videomode_s *videomode)
|
||||
am335x_videomode_valid(const struct videomode_s *videomode)
|
||||
{
|
||||
size_t fbstride;
|
||||
size_t fbsize;
|
||||
|
|
@ -218,9 +218,9 @@ static bool
|
|||
****************************************************************************/
|
||||
|
||||
static const struct videomode_s *
|
||||
am335x_lcd_pickmode(FAR struct edid_info_s *ei)
|
||||
am335x_lcd_pickmode(struct edid_info_s *ei)
|
||||
{
|
||||
FAR const struct videomode_s *videomode;
|
||||
const struct videomode_s *videomode;
|
||||
int n;
|
||||
|
||||
/* Get standard VGA as default */
|
||||
|
|
@ -281,8 +281,8 @@ static const struct videomode_s *
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
void am335x_lcd_videomode(FAR const struct videomode_s *videomode,
|
||||
FAR struct am335x_panel_info_s *panel)
|
||||
void am335x_lcd_videomode(const struct videomode_s *videomode,
|
||||
struct am335x_panel_info_s *panel)
|
||||
{
|
||||
lcdinfo("Detected videomode: %dx%d @ %" PRId32 "KHz\n",
|
||||
videomode->hdisplay, videomode->vdisplay,
|
||||
|
|
@ -354,11 +354,11 @@ void am335x_lcd_videomode(FAR const struct videomode_s *videomode,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
void am335x_lcd_edid(FAR const uint8_t *edid, size_t edid_len,
|
||||
FAR struct am335x_panel_info_s *panel,
|
||||
FAR const struct videomode_s **selected)
|
||||
void am335x_lcd_edid(const uint8_t *edid, size_t edid_len,
|
||||
struct am335x_panel_info_s *panel,
|
||||
const struct videomode_s **selected)
|
||||
{
|
||||
FAR const struct videomode_s *videomode = NULL;
|
||||
const struct videomode_s *videomode = NULL;
|
||||
struct edid_info_s ei;
|
||||
|
||||
/* Do we have EDID data? */
|
||||
|
|
|
|||
|
|
@ -180,7 +180,7 @@ static int am335x_gpio_interrupt(uint32_t base, int irq0, void *context)
|
|||
}
|
||||
|
||||
#ifdef CONFIG_AM335X_GPIO0_IRQ
|
||||
static int am335x_gpio0_interrupt(int irq, FAR void *context, FAR void *arg)
|
||||
static int am335x_gpio0_interrupt(int irq, void *context, void *arg)
|
||||
{
|
||||
return am335x_gpio_interrupt(AM335X_GPIO0_VADDR,
|
||||
AM335X_IRQ_GPIO0P0, context);
|
||||
|
|
@ -188,7 +188,7 @@ static int am335x_gpio0_interrupt(int irq, FAR void *context, FAR void *arg)
|
|||
#endif
|
||||
|
||||
#ifdef CONFIG_AM335X_GPIO1_IRQ
|
||||
static int am335x_gpio1_interrupt(int irq, FAR void *context, FAR void *arg)
|
||||
static int am335x_gpio1_interrupt(int irq, void *context, void *arg)
|
||||
{
|
||||
return am335x_gpio_interrupt(AM335X_GPIO1_VADDR,
|
||||
AM335X_IRQ_GPIO1P0, context);
|
||||
|
|
@ -196,7 +196,7 @@ static int am335x_gpio1_interrupt(int irq, FAR void *context, FAR void *arg)
|
|||
#endif
|
||||
|
||||
#ifdef CONFIG_AM335X_GPIO2_IRQ
|
||||
static int am335x_gpio2_interrupt(int irq, FAR void *context, FAR void *arg)
|
||||
static int am335x_gpio2_interrupt(int irq, void *context, void *arg)
|
||||
{
|
||||
return am335x_gpio_interrupt(AM335X_GPIO2_VADDR,
|
||||
AM335X_IRQ_GPIO2P0, context);
|
||||
|
|
@ -204,7 +204,7 @@ static int am335x_gpio2_interrupt(int irq, FAR void *context, FAR void *arg)
|
|||
#endif
|
||||
|
||||
#ifdef CONFIG_AM335X_GPIO3_IRQ
|
||||
static int am335x_gpio3_interrupt(int irq, FAR void *context, FAR void *arg)
|
||||
static int am335x_gpio3_interrupt(int irq, void *context, void *arg)
|
||||
{
|
||||
return am335x_gpio_interrupt(AM335X_GPIO3_VADDR,
|
||||
AM335X_IRQ_GPIO3P0, context);
|
||||
|
|
|
|||
|
|
@ -212,59 +212,59 @@ struct am335x_i2c_priv_s
|
|||
* Private Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
static inline uint32_t am335x_i2c_getreg(FAR struct am335x_i2c_priv_s *priv,
|
||||
static inline uint32_t am335x_i2c_getreg(struct am335x_i2c_priv_s *priv,
|
||||
uint16_t offset);
|
||||
static inline void am335x_i2c_putreg(FAR struct am335x_i2c_priv_s *priv,
|
||||
static inline void am335x_i2c_putreg(struct am335x_i2c_priv_s *priv,
|
||||
uint16_t offset, uint32_t value);
|
||||
static inline void am335x_i2c_modifyreg(FAR struct am335x_i2c_priv_s *priv,
|
||||
static inline void am335x_i2c_modifyreg(struct am335x_i2c_priv_s *priv,
|
||||
uint16_t offset, uint32_t clearbits,
|
||||
uint32_t setbits);
|
||||
static inline int am335x_i2c_sem_wait(FAR struct am335x_i2c_priv_s *priv);
|
||||
static inline int am335x_i2c_sem_wait(struct am335x_i2c_priv_s *priv);
|
||||
static int
|
||||
am335x_i2c_sem_wait_noncancelable(FAR struct am335x_i2c_priv_s *priv);
|
||||
am335x_i2c_sem_wait_noncancelable(struct am335x_i2c_priv_s *priv);
|
||||
|
||||
#ifdef CONFIG_AM335X_I2C_DYNTIMEO
|
||||
static useconds_t am335x_i2c_tousecs(int msgc, FAR struct i2c_msg_s *msgs);
|
||||
static useconds_t am335x_i2c_tousecs(int msgc, struct i2c_msg_s *msgs);
|
||||
#endif /* CONFIG_AM335X_I2C_DYNTIMEO */
|
||||
|
||||
static inline int
|
||||
am335x_i2c_sem_waitdone(FAR struct am335x_i2c_priv_s *priv);
|
||||
am335x_i2c_sem_waitdone(struct am335x_i2c_priv_s *priv);
|
||||
static inline bool
|
||||
am335x_i2c_sem_waitstop(FAR struct am335x_i2c_priv_s *priv);
|
||||
static inline void am335x_i2c_sem_post(FAR struct am335x_i2c_priv_s *priv);
|
||||
static inline void am335x_i2c_sem_init(FAR struct am335x_i2c_priv_s *priv);
|
||||
am335x_i2c_sem_waitstop(struct am335x_i2c_priv_s *priv);
|
||||
static inline void am335x_i2c_sem_post(struct am335x_i2c_priv_s *priv);
|
||||
static inline void am335x_i2c_sem_init(struct am335x_i2c_priv_s *priv);
|
||||
static inline void
|
||||
am335x_i2c_sem_destroy(FAR struct am335x_i2c_priv_s *priv);
|
||||
am335x_i2c_sem_destroy(struct am335x_i2c_priv_s *priv);
|
||||
|
||||
#ifdef CONFIG_I2C_TRACE
|
||||
static void am335x_i2c_tracereset(FAR struct am335x_i2c_priv_s *priv);
|
||||
static void am335x_i2c_tracenew(FAR struct am335x_i2c_priv_s *priv,
|
||||
static void am335x_i2c_tracereset(struct am335x_i2c_priv_s *priv);
|
||||
static void am335x_i2c_tracenew(struct am335x_i2c_priv_s *priv,
|
||||
uint32_t status);
|
||||
static void am335x_i2c_traceevent(FAR struct am335x_i2c_priv_s *priv,
|
||||
static void am335x_i2c_traceevent(struct am335x_i2c_priv_s *priv,
|
||||
enum am335x_trace_e event, uint32_t parm);
|
||||
static void am335x_i2c_tracedump(FAR struct am335x_i2c_priv_s *priv);
|
||||
static void am335x_i2c_tracedump(struct am335x_i2c_priv_s *priv);
|
||||
#endif /* CONFIG_I2C_TRACE */
|
||||
|
||||
static void am335x_i2c_setclock(FAR struct am335x_i2c_priv_s *priv,
|
||||
static void am335x_i2c_setclock(struct am335x_i2c_priv_s *priv,
|
||||
uint32_t frequency);
|
||||
static inline void am335x_i2c_sendstart(FAR struct am335x_i2c_priv_s *priv,
|
||||
static inline void am335x_i2c_sendstart(struct am335x_i2c_priv_s *priv,
|
||||
uint16_t address);
|
||||
static inline void am335x_i2c_sendstop(FAR struct am335x_i2c_priv_s *priv);
|
||||
static inline void am335x_i2c_sendstop(struct am335x_i2c_priv_s *priv);
|
||||
static inline uint32_t
|
||||
am335x_i2c_getstatus(FAR struct am335x_i2c_priv_s *priv);
|
||||
am335x_i2c_getstatus(struct am335x_i2c_priv_s *priv);
|
||||
|
||||
static int am335x_i2c_isr_process(struct am335x_i2c_priv_s * priv);
|
||||
|
||||
#ifndef CONFIG_I2C_POLLED
|
||||
static int am335x_i2c_isr(int irq, void *context, FAR void *arg);
|
||||
static int am335x_i2c_isr(int irq, void *context, void *arg);
|
||||
#endif /* !CONFIG_I2C_POLLED */
|
||||
|
||||
static int am335x_i2c_init(FAR struct am335x_i2c_priv_s *priv);
|
||||
static int am335x_i2c_deinit(FAR struct am335x_i2c_priv_s *priv);
|
||||
static int am335x_i2c_transfer(FAR struct i2c_master_s *dev,
|
||||
FAR struct i2c_msg_s *msgs, int count);
|
||||
static int am335x_i2c_init(struct am335x_i2c_priv_s *priv);
|
||||
static int am335x_i2c_deinit(struct am335x_i2c_priv_s *priv);
|
||||
static int am335x_i2c_transfer(struct i2c_master_s *dev,
|
||||
struct i2c_msg_s *msgs, int count);
|
||||
#ifdef CONFIG_I2C_RESET
|
||||
static int am335x_i2c_reset(FAR struct i2c_master_s *dev);
|
||||
static int am335x_i2c_reset(struct i2c_master_s *dev);
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
|
|
@ -404,7 +404,7 @@ static struct am335x_i2c_priv_s am335x_i2c2_priv =
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static inline uint32_t am335x_i2c_getreg(FAR struct am335x_i2c_priv_s *priv,
|
||||
static inline uint32_t am335x_i2c_getreg(struct am335x_i2c_priv_s *priv,
|
||||
uint16_t offset)
|
||||
{
|
||||
return getreg32(priv->config->base + offset);
|
||||
|
|
@ -418,7 +418,7 @@ static inline uint32_t am335x_i2c_getreg(FAR struct am335x_i2c_priv_s *priv,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static inline void am335x_i2c_putreg(FAR struct am335x_i2c_priv_s *priv,
|
||||
static inline void am335x_i2c_putreg(struct am335x_i2c_priv_s *priv,
|
||||
uint16_t offset, uint32_t value)
|
||||
{
|
||||
putreg32(value, priv->config->base + offset);
|
||||
|
|
@ -432,7 +432,7 @@ static inline void am335x_i2c_putreg(FAR struct am335x_i2c_priv_s *priv,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static inline void am335x_i2c_modifyreg(FAR struct am335x_i2c_priv_s *priv,
|
||||
static inline void am335x_i2c_modifyreg(struct am335x_i2c_priv_s *priv,
|
||||
uint16_t offset, uint32_t clearbits,
|
||||
uint32_t setbits)
|
||||
{
|
||||
|
|
@ -448,7 +448,7 @@ static inline void am335x_i2c_modifyreg(FAR struct am335x_i2c_priv_s *priv,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static inline int am335x_i2c_sem_wait(FAR struct am335x_i2c_priv_s *priv)
|
||||
static inline int am335x_i2c_sem_wait(struct am335x_i2c_priv_s *priv)
|
||||
{
|
||||
return nxsem_wait(&priv->sem_excl);
|
||||
}
|
||||
|
|
@ -462,7 +462,7 @@ static inline int am335x_i2c_sem_wait(FAR struct am335x_i2c_priv_s *priv)
|
|||
****************************************************************************/
|
||||
|
||||
static int
|
||||
am335x_i2c_sem_wait_noncancelable(FAR struct am335x_i2c_priv_s *priv)
|
||||
am335x_i2c_sem_wait_noncancelable(struct am335x_i2c_priv_s *priv)
|
||||
{
|
||||
return nxsem_wait_uninterruptible(&priv->sem_excl);
|
||||
}
|
||||
|
|
@ -477,7 +477,7 @@ static int
|
|||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_AM335X_I2C_DYNTIMEO
|
||||
static useconds_t am335x_i2c_tousecs(int msgc, FAR struct i2c_msg_s *msgs)
|
||||
static useconds_t am335x_i2c_tousecs(int msgc, struct i2c_msg_s *msgs)
|
||||
{
|
||||
size_t bytecount = 0;
|
||||
int i;
|
||||
|
|
@ -506,7 +506,7 @@ static useconds_t am335x_i2c_tousecs(int msgc, FAR struct i2c_msg_s *msgs)
|
|||
****************************************************************************/
|
||||
|
||||
#ifndef CONFIG_I2C_POLLED
|
||||
static inline int am335x_i2c_sem_waitdone(FAR struct am335x_i2c_priv_s *priv)
|
||||
static inline int am335x_i2c_sem_waitdone(struct am335x_i2c_priv_s *priv)
|
||||
{
|
||||
struct timespec abstime;
|
||||
irqstate_t flags;
|
||||
|
|
@ -611,7 +611,7 @@ static inline int am335x_i2c_sem_waitdone(FAR struct am335x_i2c_priv_s *priv)
|
|||
return ret;
|
||||
}
|
||||
#else
|
||||
static inline int am335x_i2c_sem_waitdone(FAR struct am335x_i2c_priv_s *priv)
|
||||
static inline int am335x_i2c_sem_waitdone(struct am335x_i2c_priv_s *priv)
|
||||
{
|
||||
clock_t timeout;
|
||||
clock_t start;
|
||||
|
|
@ -666,7 +666,7 @@ static inline int am335x_i2c_sem_waitdone(FAR struct am335x_i2c_priv_s *priv)
|
|||
****************************************************************************/
|
||||
|
||||
static inline bool
|
||||
am335x_i2c_sem_waitstop(FAR struct am335x_i2c_priv_s *priv)
|
||||
am335x_i2c_sem_waitstop(struct am335x_i2c_priv_s *priv)
|
||||
{
|
||||
clock_t start;
|
||||
clock_t elapsed;
|
||||
|
|
@ -736,7 +736,7 @@ static inline void am335x_i2c_sem_post(struct am335x_i2c_priv_s *priv)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static inline void am335x_i2c_sem_init(FAR struct am335x_i2c_priv_s *priv)
|
||||
static inline void am335x_i2c_sem_init(struct am335x_i2c_priv_s *priv)
|
||||
{
|
||||
nxsem_init(&priv->sem_excl, 0, 1);
|
||||
|
||||
|
|
@ -758,7 +758,7 @@ static inline void am335x_i2c_sem_init(FAR struct am335x_i2c_priv_s *priv)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static inline void am335x_i2c_sem_destroy(FAR struct am335x_i2c_priv_s *priv)
|
||||
static inline void am335x_i2c_sem_destroy(struct am335x_i2c_priv_s *priv)
|
||||
{
|
||||
nxsem_destroy(&priv->sem_excl);
|
||||
#ifndef CONFIG_I2C_POLLED
|
||||
|
|
@ -775,7 +775,7 @@ static inline void am335x_i2c_sem_destroy(FAR struct am335x_i2c_priv_s *priv)
|
|||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_I2C_TRACE
|
||||
static void am335x_i2c_traceclear(FAR struct am335x_i2c_priv_s *priv)
|
||||
static void am335x_i2c_traceclear(struct am335x_i2c_priv_s *priv)
|
||||
{
|
||||
struct am335x_trace_s *trace = &priv->trace[priv->tndx];
|
||||
|
||||
|
|
@ -786,7 +786,7 @@ static void am335x_i2c_traceclear(FAR struct am335x_i2c_priv_s *priv)
|
|||
trace->time = 0; /* Time of first status or event */
|
||||
}
|
||||
|
||||
static void am335x_i2c_tracereset(FAR struct am335x_i2c_priv_s *priv)
|
||||
static void am335x_i2c_tracereset(struct am335x_i2c_priv_s *priv)
|
||||
{
|
||||
/* Reset the trace info for a new data collection */
|
||||
|
||||
|
|
@ -795,7 +795,7 @@ static void am335x_i2c_tracereset(FAR struct am335x_i2c_priv_s *priv)
|
|||
am335x_i2c_traceclear(priv);
|
||||
}
|
||||
|
||||
static void am335x_i2c_tracenew(FAR struct am335x_i2c_priv_s *priv,
|
||||
static void am335x_i2c_tracenew(struct am335x_i2c_priv_s *priv,
|
||||
uint32_t status)
|
||||
{
|
||||
struct am335x_trace_s *trace = &priv->trace[priv->tndx];
|
||||
|
|
@ -835,7 +835,7 @@ static void am335x_i2c_tracenew(FAR struct am335x_i2c_priv_s *priv,
|
|||
}
|
||||
}
|
||||
|
||||
static void am335x_i2c_traceevent(FAR struct am335x_i2c_priv_s *priv,
|
||||
static void am335x_i2c_traceevent(struct am335x_i2c_priv_s *priv,
|
||||
enum am335x_trace_e event, uint32_t parm)
|
||||
{
|
||||
struct am335x_trace_s *trace;
|
||||
|
|
@ -862,7 +862,7 @@ static void am335x_i2c_traceevent(FAR struct am335x_i2c_priv_s *priv,
|
|||
}
|
||||
}
|
||||
|
||||
static void am335x_i2c_tracedump(FAR struct am335x_i2c_priv_s *priv)
|
||||
static void am335x_i2c_tracedump(struct am335x_i2c_priv_s *priv)
|
||||
{
|
||||
struct am335x_trace_s *trace;
|
||||
int i;
|
||||
|
|
@ -891,7 +891,7 @@ static void am335x_i2c_tracedump(FAR struct am335x_i2c_priv_s *priv)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static void am335x_i2c_setclock(FAR struct am335x_i2c_priv_s *priv,
|
||||
static void am335x_i2c_setclock(struct am335x_i2c_priv_s *priv,
|
||||
uint32_t frequency)
|
||||
{
|
||||
uint32_t src_freq = AM335X_I2C_SCLK;
|
||||
|
|
@ -992,7 +992,7 @@ static void am335x_i2c_setclock(FAR struct am335x_i2c_priv_s *priv,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static inline void am335x_i2c_sendstart(FAR struct am335x_i2c_priv_s *priv,
|
||||
static inline void am335x_i2c_sendstart(struct am335x_i2c_priv_s *priv,
|
||||
uint16_t address)
|
||||
{
|
||||
uint32_t regval;
|
||||
|
|
@ -1033,7 +1033,7 @@ static inline void am335x_i2c_sendstart(FAR struct am335x_i2c_priv_s *priv,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static inline void am335x_i2c_sendstop(FAR struct am335x_i2c_priv_s *priv)
|
||||
static inline void am335x_i2c_sendstop(struct am335x_i2c_priv_s *priv)
|
||||
{
|
||||
am335x_i2c_modifyreg(priv, AM335X_I2C_CON_OFFSET, 0, I2C_CON_STP);
|
||||
}
|
||||
|
|
@ -1047,7 +1047,7 @@ static inline void am335x_i2c_sendstop(FAR struct am335x_i2c_priv_s *priv)
|
|||
****************************************************************************/
|
||||
|
||||
static inline uint32_t
|
||||
am335x_i2c_getstatus(FAR struct am335x_i2c_priv_s *priv)
|
||||
am335x_i2c_getstatus(struct am335x_i2c_priv_s *priv)
|
||||
{
|
||||
#ifndef CONFIG_I2C_POLLED
|
||||
return am335x_i2c_getreg(priv, AM335X_I2C_IRQ_STAT_OFFSET);
|
||||
|
|
@ -1288,7 +1288,7 @@ static int am335x_i2c_isr_process(struct am335x_i2c_priv_s *priv)
|
|||
****************************************************************************/
|
||||
|
||||
#ifndef CONFIG_I2C_POLLED
|
||||
static int am335x_i2c_isr(int irq, void *context, FAR void *arg)
|
||||
static int am335x_i2c_isr(int irq, void *context, void *arg)
|
||||
{
|
||||
struct am335x_i2c_priv_s *priv = (struct am335x_i2c_priv_s *)arg;
|
||||
|
||||
|
|
@ -1305,7 +1305,7 @@ static int am335x_i2c_isr(int irq, void *context, FAR void *arg)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int am335x_i2c_init(FAR struct am335x_i2c_priv_s *priv)
|
||||
static int am335x_i2c_init(struct am335x_i2c_priv_s *priv)
|
||||
{
|
||||
/* Power-up and configure GPIOs */
|
||||
|
||||
|
|
@ -1364,7 +1364,7 @@ static int am335x_i2c_init(FAR struct am335x_i2c_priv_s *priv)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int am335x_i2c_deinit(FAR struct am335x_i2c_priv_s *priv)
|
||||
static int am335x_i2c_deinit(struct am335x_i2c_priv_s *priv)
|
||||
{
|
||||
/* Disable I2C module */
|
||||
|
||||
|
|
@ -1396,10 +1396,10 @@ static int am335x_i2c_deinit(FAR struct am335x_i2c_priv_s *priv)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int am335x_i2c_transfer(FAR struct i2c_master_s *dev,
|
||||
FAR struct i2c_msg_s *msgs, int count)
|
||||
static int am335x_i2c_transfer(struct i2c_master_s *dev,
|
||||
struct i2c_msg_s *msgs, int count)
|
||||
{
|
||||
FAR struct am335x_i2c_priv_s *priv = (struct am335x_i2c_priv_s *)dev;
|
||||
struct am335x_i2c_priv_s *priv = (struct am335x_i2c_priv_s *)dev;
|
||||
int ret;
|
||||
|
||||
DEBUGASSERT(count > 0);
|
||||
|
|
@ -1541,9 +1541,9 @@ static int am335x_i2c_transfer(FAR struct i2c_master_s *dev,
|
|||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_I2C_RESET
|
||||
static int am335x_i2c_reset(FAR struct i2c_master_s *dev)
|
||||
static int am335x_i2c_reset(struct i2c_master_s *dev)
|
||||
{
|
||||
FAR struct am335x_i2c_priv_s *priv = (FAR struct am335x_i2c_priv_s *)dev;
|
||||
struct am335x_i2c_priv_s *priv = (struct am335x_i2c_priv_s *)dev;
|
||||
unsigned int clock_count;
|
||||
unsigned int stretch_count;
|
||||
gpio_pinset_t scl_gpio;
|
||||
|
|
@ -1671,7 +1671,7 @@ out:
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
FAR struct i2c_master_s *am335x_i2cbus_initialize(int port)
|
||||
struct i2c_master_s *am335x_i2cbus_initialize(int port)
|
||||
{
|
||||
struct am335x_i2c_priv_s * priv = NULL;
|
||||
irqstate_t flags;
|
||||
|
|
@ -1724,9 +1724,9 @@ FAR struct i2c_master_s *am335x_i2cbus_initialize(int port)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
int am335x_i2cbus_uninitialize(FAR struct i2c_master_s *dev)
|
||||
int am335x_i2cbus_uninitialize(struct i2c_master_s *dev)
|
||||
{
|
||||
FAR struct am335x_i2c_priv_s *priv = (struct am335x_i2c_priv_s *)dev;
|
||||
struct am335x_i2c_priv_s *priv = (struct am335x_i2c_priv_s *)dev;
|
||||
irqstate_t flags;
|
||||
|
||||
DEBUGASSERT(dev);
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
FAR struct i2c_master_s *am335x_i2cbus_initialize(int port);
|
||||
struct i2c_master_s *am335x_i2cbus_initialize(int port);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: am335x_i2cbus_uninitialize
|
||||
|
|
@ -66,6 +66,6 @@ FAR struct i2c_master_s *am335x_i2cbus_initialize(int port);
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
int am335x_i2cbus_uninitialize(FAR struct i2c_master_s *dev);
|
||||
int am335x_i2cbus_uninitialize(struct i2c_master_s *dev);
|
||||
|
||||
#endif /* __ARCH_ARM_SRC_AM335X_AM335X_I2C_H */
|
||||
|
|
|
|||
|
|
@ -81,20 +81,20 @@
|
|||
* configuration of each color plane.
|
||||
*/
|
||||
|
||||
static int am335x_getvideoinfo(FAR struct fb_vtable_s *vtable,
|
||||
FAR struct fb_videoinfo_s *vinfo);
|
||||
static int am335x_getplaneinfo(FAR struct fb_vtable_s *vtable, int planeno,
|
||||
FAR struct fb_planeinfo_s *pinfo);
|
||||
static int am335x_getvideoinfo(struct fb_vtable_s *vtable,
|
||||
struct fb_videoinfo_s *vinfo);
|
||||
static int am335x_getplaneinfo(struct fb_vtable_s *vtable, int planeno,
|
||||
struct fb_planeinfo_s *pinfo);
|
||||
|
||||
/* The following is provided only if the video hardware supports RGB color
|
||||
* mapping
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_FB_CMAP
|
||||
static int am335x_getcmap(FAR struct fb_vtable_s *vtable,
|
||||
FAR struct fb_cmap_s *cmap);
|
||||
static int am335x_putcmap(FAR struct fb_vtable_s *vtable,
|
||||
FAR const struct fb_cmap_s *cmap);
|
||||
static int am335x_getcmap(struct fb_vtable_s *vtable,
|
||||
struct fb_cmap_s *cmap);
|
||||
static int am335x_putcmap(struct fb_vtable_s *vtable,
|
||||
const struct fb_cmap_s *cmap);
|
||||
#endif
|
||||
|
||||
/* The following is provided only if the video hardware supports a hardware
|
||||
|
|
@ -102,18 +102,18 @@ static int am335x_putcmap(FAR struct fb_vtable_s *vtable,
|
|||
*/
|
||||
|
||||
#ifdef CONFIG_FB_HWCURSOR
|
||||
static int am335x_getcursor(FAR struct fb_vtable_s *vtable,
|
||||
FAR struct fb_cursorattrib_s *attrib);
|
||||
static int am335x_setcursor(FAR struct fb_vtable_s *vtable,
|
||||
FAR struct fb_setcursor_s *settings);
|
||||
static int am335x_getcursor(struct fb_vtable_s *vtable,
|
||||
struct fb_cursorattrib_s *attrib);
|
||||
static int am335x_setcursor(struct fb_vtable_s *vtable,
|
||||
struct fb_setcursor_s *settings);
|
||||
#endif
|
||||
|
||||
/* Miscellaneous internal functions */
|
||||
|
||||
static int am335x_lcd_interrupt(int irq, void *context, void *arg);
|
||||
static int am335x_lcd_interrupt(int irq, void *context, void *arg);
|
||||
static uint32_t am335x_lcd_divisor(uint32_t reference, uint32_t frequency);
|
||||
static int am335x_set_refclk(uint32_t frequency);
|
||||
static int am335x_get_refclk(uint32_t *frequency);
|
||||
static int am335x_set_refclk(uint32_t frequency);
|
||||
static int am335x_get_refclk(uint32_t *frequency);
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
|
|
@ -166,8 +166,8 @@ static struct am335x_lcd_dev_s g_lcddev;
|
|||
* Name: am335x_getvideoinfo
|
||||
****************************************************************************/
|
||||
|
||||
static int am335x_getvideoinfo(FAR struct fb_vtable_s *vtable,
|
||||
FAR struct fb_videoinfo_s *vinfo)
|
||||
static int am335x_getvideoinfo(struct fb_vtable_s *vtable,
|
||||
struct fb_videoinfo_s *vinfo)
|
||||
{
|
||||
struct am335x_lcd_dev_s *priv = &g_lcddev;
|
||||
|
||||
|
|
@ -192,8 +192,8 @@ static int am335x_getvideoinfo(FAR struct fb_vtable_s *vtable,
|
|||
* Name: am335x_getplaneinfo
|
||||
****************************************************************************/
|
||||
|
||||
static int am335x_getplaneinfo(FAR struct fb_vtable_s *vtable, int planeno,
|
||||
FAR struct fb_planeinfo_s *pinfo)
|
||||
static int am335x_getplaneinfo(struct fb_vtable_s *vtable, int planeno,
|
||||
struct fb_planeinfo_s *pinfo)
|
||||
{
|
||||
struct am335x_lcd_dev_s *priv = &g_lcddev;
|
||||
|
||||
|
|
@ -202,9 +202,9 @@ static int am335x_getplaneinfo(FAR struct fb_vtable_s *vtable, int planeno,
|
|||
if (vtable != NULL && planeno == 0 && pinfo != NULL)
|
||||
{
|
||||
#ifdef CONFIG_BUILD_KERNEL
|
||||
pinfo->fbmem = (FAR void *)CONFIG_AM335X_LCDC_FB_PBASE;
|
||||
pinfo->fbmem = (void *)CONFIG_AM335X_LCDC_FB_PBASE;
|
||||
#else
|
||||
pinfo->fbmem = (FAR void *)CONFIG_AM335X_LCDC_FB_VBASE;
|
||||
pinfo->fbmem = (void *)CONFIG_AM335X_LCDC_FB_VBASE;
|
||||
#endif
|
||||
pinfo->fblen = priv->fbsize;
|
||||
pinfo->stride = priv->stride;
|
||||
|
|
@ -222,8 +222,8 @@ static int am335x_getplaneinfo(FAR struct fb_vtable_s *vtable, int planeno,
|
|||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_FB_CMAP
|
||||
static int am335x_getcmap(FAR struct fb_vtable_s *vtable,
|
||||
FAR struct fb_cmap_s *cmap)
|
||||
static int am335x_getcmap(struct fb_vtable_s *vtable,
|
||||
struct fb_cmap_s *cmap)
|
||||
{
|
||||
return -ENOSYS;
|
||||
}
|
||||
|
|
@ -234,8 +234,8 @@ static int am335x_getcmap(FAR struct fb_vtable_s *vtable,
|
|||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_FB_CMAP
|
||||
static int am335x_putcmap(FAR struct fb_vtable_s *vtable,
|
||||
FAR const struct fb_cmap_s *cmap)
|
||||
static int am335x_putcmap(struct fb_vtable_s *vtable,
|
||||
const struct fb_cmap_s *cmap)
|
||||
{
|
||||
return -ENOSYS;
|
||||
}
|
||||
|
|
@ -246,8 +246,8 @@ static int am335x_putcmap(FAR struct fb_vtable_s *vtable,
|
|||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_FB_HWCURSOR
|
||||
static int am335x_getcursor(FAR struct fb_vtable_s *vtable,
|
||||
FAR struct fb_cursorattrib_s *attrib)
|
||||
static int am335x_getcursor(struct fb_vtable_s *vtable,
|
||||
struct fb_cursorattrib_s *attrib)
|
||||
{
|
||||
lcdinfo("vtable=%p attrib=%p\n", vtable, attrib);
|
||||
return -ENOSYS;
|
||||
|
|
@ -259,8 +259,8 @@ static int am335x_getcursor(FAR struct fb_vtable_s *vtable,
|
|||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_FB_HWCURSOR
|
||||
static int am335x_setcursor(FAR struct fb_vtable_s *vtable,
|
||||
FAR struct fb_setcursor_s *settings)
|
||||
static int am335x_setcursor(struct fb_vtable_s *vtable,
|
||||
struct fb_setcursor_s *settings)
|
||||
{
|
||||
lcdinfo("vtable=%p settings=%p\n", vtable, settings);
|
||||
return -ENOSYS;
|
||||
|
|
@ -507,7 +507,7 @@ static int am335x_get_refclk(uint32_t *frequency)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
int am335x_lcd_initialize(FAR const struct am335x_panel_info_s *panel)
|
||||
int am335x_lcd_initialize(const struct am335x_panel_info_s *panel)
|
||||
{
|
||||
struct am335x_lcd_dev_s *priv = &g_lcddev;
|
||||
uint32_t regval;
|
||||
|
|
@ -832,7 +832,7 @@ int am335x_lcd_initialize(FAR const struct am335x_panel_info_s *panel)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
FAR struct fb_vtable_s *up_fbgetvplane(int display, int vplane)
|
||||
struct fb_vtable_s *up_fbgetvplane(int display, int vplane)
|
||||
{
|
||||
lcdinfo("vplane: %d\n", vplane);
|
||||
if (vplane == 0)
|
||||
|
|
|
|||
|
|
@ -220,7 +220,7 @@ struct am335x_panel_info_s
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
int am335x_lcd_initialize(FAR const struct am335x_panel_info_s *panel);
|
||||
int am335x_lcd_initialize(const struct am335x_panel_info_s *panel);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: am335x_lcdclear
|
||||
|
|
@ -255,8 +255,8 @@ void am335x_lcdclear(nxgl_mxpixel_t color);
|
|||
|
||||
struct videomode_s; /* Forward reference */
|
||||
|
||||
void am335x_lcd_videomode(FAR const struct videomode_s *videomode,
|
||||
FAR struct am335x_panel_info_s *panel);
|
||||
void am335x_lcd_videomode(const struct videomode_s *videomode,
|
||||
struct am335x_panel_info_s *panel);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: am335x_lcd_edid
|
||||
|
|
@ -281,9 +281,9 @@ void am335x_lcd_videomode(FAR const struct videomode_s *videomode,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
void am335x_lcd_edid(FAR const uint8_t *edid, size_t edid_len,
|
||||
FAR struct am335x_panel_info_s *panel,
|
||||
FAR const struct videomode_s **selected);
|
||||
void am335x_lcd_edid(const uint8_t *edid, size_t edid_len,
|
||||
struct am335x_panel_info_s *panel,
|
||||
const struct videomode_s **selected);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: am335x_backlight
|
||||
|
|
|
|||
|
|
@ -280,7 +280,7 @@
|
|||
|
||||
/* This is a helper pointer for accessing the contents of Ethernet header */
|
||||
|
||||
#define BUF ((FAR struct eth_hdr_s *)priv->c_dev.d_buf)
|
||||
#define BUF ((struct eth_hdr_s *)priv->c_dev.d_buf)
|
||||
|
||||
/****************************************************************************
|
||||
* Private Types
|
||||
|
|
@ -389,15 +389,15 @@ static void c5471_txstatus(struct c5471_driver_s *priv);
|
|||
#endif
|
||||
static void c5471_txdone(struct c5471_driver_s *priv);
|
||||
|
||||
static void c5471_interrupt_work(FAR void *arg);
|
||||
static int c5471_interrupt(int irq, FAR void *context, FAR void *arg);
|
||||
static void c5471_interrupt_work(void *arg);
|
||||
static int c5471_interrupt(int irq, void *context, void *arg);
|
||||
|
||||
/* Watchdog timer expirations */
|
||||
|
||||
static void c5471_txtimeout_work(FAR void *arg);
|
||||
static void c5471_txtimeout_work(void *arg);
|
||||
static void c5471_txtimeout_expiry(wdparm_t arg);
|
||||
|
||||
static void c5471_poll_work(FAR void *arg);
|
||||
static void c5471_poll_work(void *arg);
|
||||
static void c5471_poll_expiry(wdparm_t arg);
|
||||
|
||||
/* NuttX callback functions */
|
||||
|
|
@ -405,12 +405,12 @@ static void c5471_poll_expiry(wdparm_t arg);
|
|||
static int c5471_ifup(struct net_driver_s *dev);
|
||||
static int c5471_ifdown(struct net_driver_s *dev);
|
||||
|
||||
static void c5471_txavail_work(FAR void *arg);
|
||||
static void c5471_txavail_work(void *arg);
|
||||
static int c5471_txavail(struct net_driver_s *dev);
|
||||
|
||||
#ifdef CONFIG_NET_MCASTGROUP
|
||||
static int c5471_addmac(struct net_driver_s *dev, FAR const uint8_t *mac);
|
||||
static int c5471_rmmac(struct net_driver_s *dev, FAR const uint8_t *mac);
|
||||
static int c5471_addmac(struct net_driver_s *dev, const uint8_t *mac);
|
||||
static int c5471_rmmac(struct net_driver_s *dev, const uint8_t *mac);
|
||||
#endif
|
||||
|
||||
/* Initialization functions */
|
||||
|
|
@ -1580,9 +1580,9 @@ static void c5471_txdone(struct c5471_driver_s *priv)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static void c5471_interrupt_work(FAR void *arg)
|
||||
static void c5471_interrupt_work(void *arg)
|
||||
{
|
||||
FAR struct c5471_driver_s *priv = (FAR struct c5471_driver_s *)arg;
|
||||
struct c5471_driver_s *priv = (struct c5471_driver_s *)arg;
|
||||
|
||||
/* Process pending Ethernet interrupts */
|
||||
|
||||
|
|
@ -1663,7 +1663,7 @@ static void c5471_interrupt_work(FAR void *arg)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int c5471_interrupt(int irq, FAR void *context, FAR void *arg)
|
||||
static int c5471_interrupt(int irq, void *context, void *arg)
|
||||
{
|
||||
#if CONFIG_C5471_NET_NINTERFACES == 1
|
||||
register struct c5471_driver_s *priv = &g_c5471[0];
|
||||
|
|
@ -1712,9 +1712,9 @@ static int c5471_interrupt(int irq, FAR void *context, FAR void *arg)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static void c5471_txtimeout_work(FAR void *arg)
|
||||
static void c5471_txtimeout_work(void *arg)
|
||||
{
|
||||
FAR struct c5471_driver_s *priv = (FAR struct c5471_driver_s *)arg;
|
||||
struct c5471_driver_s *priv = (struct c5471_driver_s *)arg;
|
||||
|
||||
/* Increment statistics */
|
||||
|
||||
|
|
@ -1788,9 +1788,9 @@ static void c5471_txtimeout_expiry(wdparm_t arg)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static void c5471_poll_work(FAR void *arg)
|
||||
static void c5471_poll_work(void *arg)
|
||||
{
|
||||
FAR struct c5471_driver_s *priv = (FAR struct c5471_driver_s *)arg;
|
||||
struct c5471_driver_s *priv = (struct c5471_driver_s *)arg;
|
||||
|
||||
/* Check if the ESM has let go of the RX descriptor giving us access rights
|
||||
* to submit another Ethernet frame.
|
||||
|
|
@ -1976,9 +1976,9 @@ static int c5471_ifdown(struct net_driver_s *dev)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static void c5471_txavail_work(FAR void *arg)
|
||||
static void c5471_txavail_work(void *arg)
|
||||
{
|
||||
FAR struct c5471_driver_s *priv = (FAR struct c5471_driver_s *)arg;
|
||||
struct c5471_driver_s *priv = (struct c5471_driver_s *)arg;
|
||||
|
||||
ninfo("Polling\n");
|
||||
|
||||
|
|
@ -2021,7 +2021,7 @@ static void c5471_txavail_work(FAR void *arg)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int c5471_txavail(FAR struct net_driver_s *dev)
|
||||
static int c5471_txavail(struct net_driver_s *dev)
|
||||
{
|
||||
struct c5471_driver_s *priv = (struct c5471_driver_s *)dev->d_private;
|
||||
|
||||
|
|
@ -2059,10 +2059,10 @@ static int c5471_txavail(FAR struct net_driver_s *dev)
|
|||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_NET_MCASTGROUP
|
||||
static int c5471_addmac(struct net_driver_s *dev, FAR const uint8_t *mac)
|
||||
static int c5471_addmac(struct net_driver_s *dev, const uint8_t *mac)
|
||||
{
|
||||
FAR struct c5471_driver_s *priv =
|
||||
(FAR struct c5471_driver_s *)dev->d_private;
|
||||
struct c5471_driver_s *priv =
|
||||
(struct c5471_driver_s *)dev->d_private;
|
||||
|
||||
/* Add the MAC address to the hardware multicast routing table */
|
||||
|
||||
|
|
@ -2090,10 +2090,10 @@ static int c5471_addmac(struct net_driver_s *dev, FAR const uint8_t *mac)
|
|||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_NET_MCASTGROUP
|
||||
static int c5471_rmmac(struct net_driver_s *dev, FAR const uint8_t *mac)
|
||||
static int c5471_rmmac(struct net_driver_s *dev, const uint8_t *mac)
|
||||
{
|
||||
FAR struct c5471_driver_s *priv =
|
||||
(FAR struct c5471_driver_s *)dev->d_private;
|
||||
struct c5471_driver_s *priv =
|
||||
(struct c5471_driver_s *)dev->d_private;
|
||||
|
||||
/* Add the MAC address to the hardware multicast routing table */
|
||||
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int c5471_timerisr(int irq, uint32_t *regs, FAR void *arg)
|
||||
static int c5471_timerisr(int irq, uint32_t *regs, void *arg)
|
||||
{
|
||||
/* Process timer interrupt */
|
||||
|
||||
|
|
|
|||
|
|
@ -80,14 +80,14 @@
|
|||
static inline unsigned int wdt_prescaletoptv(unsigned int prescale);
|
||||
|
||||
static int wdt_setusec(uint32_t usec);
|
||||
static int wdt_interrupt(int irq, void *context, FAR void *arg);
|
||||
static int wdt_interrupt(int irq, void *context, void *arg);
|
||||
|
||||
static int wdt_open(struct file *filep);
|
||||
static int wdt_close(struct file *filep);
|
||||
static ssize_t wdt_read(struct file *filep, char *buffer, size_t buflen);
|
||||
static ssize_t wdt_write(struct file *filep, const char *buffer,
|
||||
size_t buflen);
|
||||
static int wdt_ioctl(FAR struct file *filep, int cmd, unsigned long arg);
|
||||
static int wdt_ioctl(struct file *filep, int cmd, unsigned long arg);
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
|
|
@ -220,7 +220,7 @@ static int wdt_setusec(uint32_t usec)
|
|||
* Name: wdt_interrupt
|
||||
****************************************************************************/
|
||||
|
||||
static int wdt_interrupt(int irq, void *context, FAR void *arg)
|
||||
static int wdt_interrupt(int irq, void *context, void *arg)
|
||||
{
|
||||
wdinfo("expired\n");
|
||||
|
||||
|
|
@ -281,7 +281,7 @@ static ssize_t wdt_write(struct file *filep, const char *buffer,
|
|||
* Name: wdt_ioctl
|
||||
****************************************************************************/
|
||||
|
||||
static int wdt_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
|
||||
static int wdt_ioctl(struct file *filep, int cmd, unsigned long arg)
|
||||
{
|
||||
wdinfo("ioctl Call: cmd=0x%x arg=0x%lx", cmd, arg);
|
||||
|
||||
|
|
|
|||
|
|
@ -165,7 +165,7 @@ typedef enum adc_ch
|
|||
struct cxd56adc_dev_s
|
||||
{
|
||||
adc_ch_t ch; /* adc channel number */
|
||||
FAR struct seq_s *seq; /* sequencer */
|
||||
struct seq_s *seq; /* sequencer */
|
||||
uint8_t freq; /* coefficient of adc sampling frequency */
|
||||
uint16_t fsize; /* SCU FIFO size */
|
||||
uint16_t ofst; /* offset */
|
||||
|
|
@ -184,11 +184,11 @@ struct cxd56adc_dev_s
|
|||
|
||||
/* Character driver methods */
|
||||
|
||||
static int cxd56_adc_open(FAR struct file *filep);
|
||||
static int cxd56_adc_close(FAR struct file *filep);
|
||||
static ssize_t cxd56_adc_read(FAR struct file *filep, FAR char *buffer,
|
||||
static int cxd56_adc_open(struct file *filep);
|
||||
static int cxd56_adc_close(struct file *filep);
|
||||
static ssize_t cxd56_adc_read(struct file *filep, char *buffer,
|
||||
size_t len);
|
||||
static int cxd56_adc_ioctl(FAR struct file *filep, int cmd,
|
||||
static int cxd56_adc_ioctl(struct file *filep, int cmd,
|
||||
unsigned long arg);
|
||||
|
||||
/****************************************************************************
|
||||
|
|
@ -324,7 +324,7 @@ static bool adc_active[CH_MAX] =
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int set_ofstgain(FAR struct cxd56adc_dev_s *priv)
|
||||
static int set_ofstgain(struct cxd56adc_dev_s *priv)
|
||||
{
|
||||
int ret = OK;
|
||||
uint32_t addr;
|
||||
|
|
@ -370,7 +370,7 @@ static int set_ofstgain(FAR struct cxd56adc_dev_s *priv)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int adc_start(adc_ch_t ch, uint8_t freq, FAR struct seq_s *seq,
|
||||
static int adc_start(adc_ch_t ch, uint8_t freq, struct seq_s *seq,
|
||||
int fsize, int fifomode,
|
||||
struct scufifo_wm_s *wm,
|
||||
struct math_filter_s *filter,
|
||||
|
|
@ -619,7 +619,7 @@ static int adc_start(adc_ch_t ch, uint8_t freq, FAR struct seq_s *seq,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int adc_stop(adc_ch_t ch, FAR struct seq_s *seq)
|
||||
static int adc_stop(adc_ch_t ch, struct seq_s *seq)
|
||||
{
|
||||
uint32_t *addr;
|
||||
uint32_t val;
|
||||
|
|
@ -706,10 +706,10 @@ static bool adc_validcheck(int cmd)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int cxd56_adc_open(FAR struct file *filep)
|
||||
static int cxd56_adc_open(struct file *filep)
|
||||
{
|
||||
FAR struct inode *inode = filep->f_inode;
|
||||
FAR struct cxd56adc_dev_s *priv = inode->i_private;
|
||||
struct inode *inode = filep->f_inode;
|
||||
struct cxd56adc_dev_s *priv = inode->i_private;
|
||||
int ret = OK;
|
||||
int type;
|
||||
|
||||
|
|
@ -770,10 +770,10 @@ static int cxd56_adc_open(FAR struct file *filep)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int cxd56_adc_close(FAR struct file *filep)
|
||||
static int cxd56_adc_close(struct file *filep)
|
||||
{
|
||||
FAR struct inode *inode = filep->f_inode;
|
||||
FAR struct cxd56adc_dev_s *priv = inode->i_private;
|
||||
struct inode *inode = filep->f_inode;
|
||||
struct cxd56adc_dev_s *priv = inode->i_private;
|
||||
|
||||
DEBUGASSERT(priv != NULL);
|
||||
DEBUGASSERT(priv->seq != NULL);
|
||||
|
|
@ -828,11 +828,11 @@ static int cxd56_adc_close(FAR struct file *filep)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static ssize_t cxd56_adc_read(FAR struct file *filep, FAR char *buffer,
|
||||
static ssize_t cxd56_adc_read(struct file *filep, char *buffer,
|
||||
size_t len)
|
||||
{
|
||||
FAR struct inode *inode = filep->f_inode;
|
||||
FAR struct cxd56adc_dev_s *priv = inode->i_private;
|
||||
struct inode *inode = filep->f_inode;
|
||||
struct cxd56adc_dev_s *priv = inode->i_private;
|
||||
int ret = OK;
|
||||
|
||||
DEBUGASSERT(priv != NULL);
|
||||
|
|
@ -853,11 +853,11 @@ static ssize_t cxd56_adc_read(FAR struct file *filep, FAR char *buffer,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int cxd56_adc_ioctl(FAR struct file *filep, int cmd,
|
||||
static int cxd56_adc_ioctl(struct file *filep, int cmd,
|
||||
unsigned long arg)
|
||||
{
|
||||
FAR struct inode *inode = filep->f_inode;
|
||||
FAR struct cxd56adc_dev_s *priv = inode->i_private;
|
||||
struct inode *inode = filep->f_inode;
|
||||
struct cxd56adc_dev_s *priv = inode->i_private;
|
||||
int ret = OK;
|
||||
DEBUGASSERT(priv != NULL);
|
||||
DEBUGASSERT(priv->seq != NULL);
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@ extern char __stack[];
|
|||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_HEAP_COLORATION
|
||||
static inline void up_heap_color(FAR void *start, size_t size)
|
||||
static inline void up_heap_color(void *start, size_t size)
|
||||
{
|
||||
memset(start, HEAP_COLOR, size);
|
||||
}
|
||||
|
|
@ -109,12 +109,12 @@ static inline void up_heap_color(FAR void *start, size_t size)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
void up_allocate_heap(FAR void **heap_start, size_t *heap_size)
|
||||
void up_allocate_heap(void **heap_start, size_t *heap_size)
|
||||
{
|
||||
/* Start with the first SRAM region */
|
||||
|
||||
board_autoled_on(LED_HEAPALLOCATE);
|
||||
*heap_start = (FAR void *)g_idle_topstack;
|
||||
*heap_start = (void *)g_idle_topstack;
|
||||
*heap_size = (uint32_t)&__stack - g_idle_topstack;
|
||||
|
||||
/* Colorize the heap for debug */
|
||||
|
|
|
|||
|
|
@ -71,17 +71,17 @@ struct charger_dev_s
|
|||
* Private Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
static int charger_get_status(FAR enum battery_status_e *status);
|
||||
static int charger_get_health(FAR enum battery_health_e *health);
|
||||
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_get_status(enum battery_status_e *status);
|
||||
static int charger_get_health(enum battery_health_e *health);
|
||||
static int charger_online(bool *online);
|
||||
static int charger_get_temptable(struct battery_temp_table_s *table);
|
||||
static int charger_set_temptable(struct battery_temp_table_s *table);
|
||||
|
||||
static ssize_t charger_read(FAR struct file *filep, FAR char *buffer,
|
||||
static ssize_t charger_read(struct file *filep, char *buffer,
|
||||
size_t buflen);
|
||||
static ssize_t charger_write(FAR struct file *filep,
|
||||
FAR const char *buffer, size_t buflen);
|
||||
static int charger_ioctl(FAR struct file *filep, int cmd,
|
||||
static ssize_t charger_write(struct file *filep,
|
||||
const char *buffer, size_t buflen);
|
||||
static int charger_ioctl(struct file *filep, int cmd,
|
||||
unsigned long arg);
|
||||
|
||||
/****************************************************************************
|
||||
|
|
@ -198,7 +198,7 @@ static int charger_therm2temp(int val)
|
|||
* Name: charger_get_status
|
||||
****************************************************************************/
|
||||
|
||||
static int charger_get_status(FAR enum battery_status_e *status)
|
||||
static int charger_get_status(enum battery_status_e *status)
|
||||
{
|
||||
uint8_t state;
|
||||
int ret;
|
||||
|
|
@ -257,9 +257,9 @@ static int charger_get_status(FAR enum battery_status_e *status)
|
|||
* Name: charger_get_health
|
||||
****************************************************************************/
|
||||
|
||||
static int charger_get_health(FAR enum battery_health_e *health)
|
||||
static int charger_get_health(enum battery_health_e *health)
|
||||
{
|
||||
FAR struct pmic_gauge_s gauge;
|
||||
struct pmic_gauge_s gauge;
|
||||
uint8_t state;
|
||||
int temp;
|
||||
int ret;
|
||||
|
|
@ -307,7 +307,7 @@ static int charger_get_health(FAR enum battery_health_e *health)
|
|||
* Name: charger_online
|
||||
****************************************************************************/
|
||||
|
||||
static int charger_online(FAR bool *online)
|
||||
static int charger_online(bool *online)
|
||||
{
|
||||
if (online == NULL)
|
||||
{
|
||||
|
|
@ -322,9 +322,9 @@ static int charger_online(FAR bool *online)
|
|||
* Name: charger_get_current
|
||||
****************************************************************************/
|
||||
|
||||
static int charger_get_current(FAR int *current)
|
||||
static int charger_get_current(int *current)
|
||||
{
|
||||
FAR struct pmic_gauge_s gauge;
|
||||
struct pmic_gauge_s gauge;
|
||||
int ret;
|
||||
|
||||
ASSERT(current);
|
||||
|
|
@ -354,9 +354,9 @@ static int charger_get_current(FAR int *current)
|
|||
* Name: charger_get_voltage
|
||||
****************************************************************************/
|
||||
|
||||
static int charger_get_voltage(FAR int *voltage)
|
||||
static int charger_get_voltage(int *voltage)
|
||||
{
|
||||
FAR struct pmic_gauge_s gauge;
|
||||
struct pmic_gauge_s gauge;
|
||||
int ret;
|
||||
|
||||
ASSERT(voltage);
|
||||
|
|
@ -382,7 +382,7 @@ static int charger_get_voltage(FAR int *voltage)
|
|||
* Name: charger_get_temptable
|
||||
****************************************************************************/
|
||||
|
||||
static int charger_get_temptable(FAR struct battery_temp_table_s *table)
|
||||
static int charger_get_temptable(struct battery_temp_table_s *table)
|
||||
{
|
||||
struct pmic_temp_table_s buf;
|
||||
int ret;
|
||||
|
|
@ -405,7 +405,7 @@ static int charger_get_temptable(FAR struct battery_temp_table_s *table)
|
|||
* Name: charger_set_temptable
|
||||
****************************************************************************/
|
||||
|
||||
static int charger_set_temptable(FAR struct battery_temp_table_s *table)
|
||||
static int charger_set_temptable(struct battery_temp_table_s *table)
|
||||
{
|
||||
struct pmic_temp_table_s buf;
|
||||
|
||||
|
|
@ -421,7 +421,7 @@ static int charger_set_temptable(FAR struct battery_temp_table_s *table)
|
|||
* Name: charger_read
|
||||
****************************************************************************/
|
||||
|
||||
static ssize_t charger_read(FAR struct file *filep, FAR char *buffer,
|
||||
static ssize_t charger_read(struct file *filep, char *buffer,
|
||||
size_t buflen)
|
||||
{
|
||||
/* Return nothing read */
|
||||
|
|
@ -433,8 +433,8 @@ static ssize_t charger_read(FAR struct file *filep, FAR char *buffer,
|
|||
* Name: charger_write
|
||||
****************************************************************************/
|
||||
|
||||
static ssize_t charger_write(FAR struct file *filep,
|
||||
FAR const char *buffer, size_t buflen)
|
||||
static ssize_t charger_write(struct file *filep,
|
||||
const char *buffer, size_t buflen)
|
||||
{
|
||||
/* Return nothing written */
|
||||
|
||||
|
|
@ -445,10 +445,10 @@ static ssize_t charger_write(FAR struct file *filep,
|
|||
* Name: charger_ioctl
|
||||
****************************************************************************/
|
||||
|
||||
static int charger_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
|
||||
static int charger_ioctl(struct file *filep, int cmd, unsigned long arg)
|
||||
{
|
||||
FAR struct inode *inode = filep->f_inode;
|
||||
FAR struct charger_dev_s *priv = inode->i_private;
|
||||
struct inode *inode = filep->f_inode;
|
||||
struct charger_dev_s *priv = inode->i_private;
|
||||
int ret = -ENOTTY;
|
||||
|
||||
nxsem_wait_uninterruptible(&priv->batsem);
|
||||
|
|
@ -457,30 +457,30 @@ static int charger_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
|
|||
{
|
||||
case BATIOC_STATE:
|
||||
{
|
||||
FAR enum battery_status_e *status =
|
||||
(FAR enum battery_status_e *)(uintptr_t)arg;
|
||||
enum battery_status_e *status =
|
||||
(enum battery_status_e *)(uintptr_t)arg;
|
||||
ret = charger_get_status(status);
|
||||
}
|
||||
break;
|
||||
|
||||
case BATIOC_HEALTH:
|
||||
{
|
||||
FAR enum battery_health_e *health =
|
||||
(FAR enum battery_health_e *)(uintptr_t)arg;
|
||||
enum battery_health_e *health =
|
||||
(enum battery_health_e *)(uintptr_t)arg;
|
||||
ret = charger_get_health(health);
|
||||
}
|
||||
break;
|
||||
|
||||
case BATIOC_ONLINE:
|
||||
{
|
||||
FAR bool *online = (FAR bool *)(uintptr_t)arg;
|
||||
bool *online = (bool *)(uintptr_t)arg;
|
||||
ret = charger_online(online);
|
||||
}
|
||||
break;
|
||||
|
||||
case BATIOC_VOLTAGE:
|
||||
{
|
||||
FAR int *voltage = (FAR int *)(uintptr_t)arg;
|
||||
int *voltage = (int *)(uintptr_t)arg;
|
||||
ret = cxd56_pmic_setchargevol(*voltage);
|
||||
}
|
||||
break;
|
||||
|
|
@ -495,72 +495,72 @@ static int charger_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
|
|||
|
||||
case BATIOC_INPUT_CURRENT:
|
||||
{
|
||||
FAR int *current = (FAR int *)(uintptr_t)arg;
|
||||
int *current = (int *)(uintptr_t)arg;
|
||||
ret = cxd56_pmic_setchargecurrent(*current);
|
||||
}
|
||||
break;
|
||||
|
||||
case BATIOC_GET_CHGVOLTAGE:
|
||||
{
|
||||
FAR int *voltage = (FAR int *)(uintptr_t)arg;
|
||||
int *voltage = (int *)(uintptr_t)arg;
|
||||
ret = cxd56_pmic_getchargevol(voltage);
|
||||
}
|
||||
break;
|
||||
|
||||
case BATIOC_GET_CHGCURRENT:
|
||||
{
|
||||
FAR int *current = (FAR int *)(uintptr_t)arg;
|
||||
int *current = (int *)(uintptr_t)arg;
|
||||
ret = cxd56_pmic_getchargecurrent(current);
|
||||
}
|
||||
break;
|
||||
|
||||
case BATIOC_GET_RECHARGEVOL:
|
||||
{
|
||||
FAR int *voltage = (FAR int *)(uintptr_t)arg;
|
||||
int *voltage = (int *)(uintptr_t)arg;
|
||||
ret = cxd56_pmic_getrechargevol(voltage);
|
||||
}
|
||||
break;
|
||||
|
||||
case BATIOC_SET_RECHARGEVOL:
|
||||
{
|
||||
FAR int *voltage = (FAR int *)(uintptr_t)arg;
|
||||
int *voltage = (int *)(uintptr_t)arg;
|
||||
ret = cxd56_pmic_setrechargevol(*voltage);
|
||||
}
|
||||
break;
|
||||
|
||||
case BATIOC_GET_COMPCURRENT:
|
||||
{
|
||||
FAR int *current = (FAR int *)(uintptr_t)arg;
|
||||
int *current = (int *)(uintptr_t)arg;
|
||||
ret = cxd56_pmic_getchargecompcurrent(current);
|
||||
}
|
||||
break;
|
||||
|
||||
case BATIOC_GET_TEMPTABLE:
|
||||
{
|
||||
FAR struct battery_temp_table_s *table =
|
||||
(FAR struct battery_temp_table_s *)(uintptr_t)arg;
|
||||
struct battery_temp_table_s *table =
|
||||
(struct battery_temp_table_s *)(uintptr_t)arg;
|
||||
ret = charger_get_temptable(table);
|
||||
}
|
||||
break;
|
||||
|
||||
case BATIOC_SET_TEMPTABLE:
|
||||
{
|
||||
FAR struct battery_temp_table_s *table =
|
||||
(FAR struct battery_temp_table_s *)(uintptr_t)arg;
|
||||
struct battery_temp_table_s *table =
|
||||
(struct battery_temp_table_s *)(uintptr_t)arg;
|
||||
ret = charger_set_temptable(table);
|
||||
}
|
||||
break;
|
||||
|
||||
case BATIOC_SET_COMPCURRENT:
|
||||
{
|
||||
FAR int *current = (FAR int *)(uintptr_t)arg;
|
||||
int *current = (int *)(uintptr_t)arg;
|
||||
ret = cxd56_pmic_setchargecompcurrent(*current);
|
||||
}
|
||||
break;
|
||||
|
||||
case BATIOC_GET_CURRENT:
|
||||
{
|
||||
FAR int *curr = (FAR int *)(uintptr_t)arg;
|
||||
int *curr = (int *)(uintptr_t)arg;
|
||||
|
||||
if (curr)
|
||||
{
|
||||
|
|
@ -575,7 +575,7 @@ static int charger_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
|
|||
|
||||
case BATIOC_GET_VOLTAGE:
|
||||
{
|
||||
FAR int *vol = (FAR int *)(uintptr_t)arg;
|
||||
int *vol = (int *)(uintptr_t)arg;
|
||||
|
||||
if (vol)
|
||||
{
|
||||
|
|
@ -616,9 +616,9 @@ static int charger_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
int cxd56_charger_initialize(FAR const char *devpath)
|
||||
int cxd56_charger_initialize(const char *devpath)
|
||||
{
|
||||
FAR struct charger_dev_s *priv = &g_chargerdev;
|
||||
struct charger_dev_s *priv = &g_chargerdev;
|
||||
int ret;
|
||||
|
||||
/* Initialize the CXD5247 device structure */
|
||||
|
|
@ -651,7 +651,7 @@ int cxd56_charger_initialize(FAR const char *devpath)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
int cxd56_charger_uninitialize(FAR const char *devpath)
|
||||
int cxd56_charger_uninitialize(const char *devpath)
|
||||
{
|
||||
unregister_driver(devpath);
|
||||
return OK;
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
|
||||
/* initialize function */
|
||||
|
||||
int cxd56_charger_initialize(FAR const char *devpath);
|
||||
int cxd56_charger_uninitialize(FAR const char *devpath);
|
||||
int cxd56_charger_initialize(const char *devpath);
|
||||
int cxd56_charger_uninitialize(const char *devpath);
|
||||
|
||||
#endif /* __ARCH_ARM_SRC_CXD56XX_CXD56_CHARGER_H */
|
||||
|
|
|
|||
|
|
@ -198,7 +198,7 @@ static int cisif_set_jpg_sarea(uint8_t *addr, uint32_t size);
|
|||
static int cisif_set_intlev_sarea(uint8_t *addr,
|
||||
uint32_t total_size,
|
||||
uint32_t yuv_size);
|
||||
static int cisif_intc_handler(int irq, FAR void *context, FAR void *arg);
|
||||
static int cisif_intc_handler(int irq, void *context, void *arg);
|
||||
|
||||
/* video image data operations */
|
||||
|
||||
|
|
@ -206,12 +206,12 @@ static int cxd56_cisif_init(void);
|
|||
static int cxd56_cisif_uninit(void);
|
||||
static int cxd56_cisif_validate_frame_setting
|
||||
(uint8_t nr_datafmt,
|
||||
FAR imgdata_format_t *datafmt,
|
||||
FAR imgdata_interval_t *interval);
|
||||
imgdata_format_t *datafmt,
|
||||
imgdata_interval_t *interval);
|
||||
static int cxd56_cisif_start_capture
|
||||
(uint8_t nr_datafmt,
|
||||
FAR imgdata_format_t *datafmt,
|
||||
FAR imgdata_interval_t *interval,
|
||||
imgdata_format_t *datafmt,
|
||||
imgdata_interval_t *interval,
|
||||
imgdata_capture_t callback);
|
||||
static int cxd56_cisif_stop_capture(void);
|
||||
static int cxd56_cisif_validate_buf(uint8_t *addr, uint32_t size);
|
||||
|
|
@ -514,7 +514,7 @@ static void cisif_jpg_err_int(uint8_t code)
|
|||
* cisif_intc_handler
|
||||
****************************************************************************/
|
||||
|
||||
static int cisif_intc_handler(int irq, FAR void *context, FAR void *arg)
|
||||
static int cisif_intc_handler(int irq, void *context, void *arg)
|
||||
{
|
||||
uint32_t value;
|
||||
uint32_t enable;
|
||||
|
|
@ -835,8 +835,8 @@ static int cxd56_cisif_uninit(void)
|
|||
|
||||
static int cxd56_cisif_start_capture
|
||||
(uint8_t nr_fmt,
|
||||
FAR imgdata_format_t *fmt,
|
||||
FAR imgdata_interval_t *interval,
|
||||
imgdata_format_t *fmt,
|
||||
imgdata_interval_t *interval,
|
||||
imgdata_capture_t callback)
|
||||
{
|
||||
cisif_param_t param =
|
||||
|
|
@ -1007,8 +1007,8 @@ static int cxd56_cisif_set_buf(uint8_t *addr, uint32_t size)
|
|||
|
||||
static int cxd56_cisif_validate_frame_setting
|
||||
(uint8_t nr_datafmt,
|
||||
FAR imgdata_format_t *datafmt,
|
||||
FAR imgdata_interval_t *interval)
|
||||
imgdata_format_t *datafmt,
|
||||
imgdata_interval_t *interval)
|
||||
{
|
||||
int ret = OK;
|
||||
|
||||
|
|
|
|||
|
|
@ -127,11 +127,11 @@ struct power_domain
|
|||
static void cxd56_img_clock_enable(void);
|
||||
static void cxd56_img_clock_disable(void);
|
||||
static void cxd56_scu_clock_ctrl(uint32_t block, uint32_t intr, int on);
|
||||
static void cxd56_scu_peri_clock_enable(FAR const struct scu_peripheral *p)
|
||||
static void cxd56_scu_peri_clock_enable(const struct scu_peripheral *p)
|
||||
unused_code;
|
||||
static void cxd56_scu_peri_clock_disable(FAR const struct scu_peripheral *p)
|
||||
static void cxd56_scu_peri_clock_disable(const struct scu_peripheral *p)
|
||||
unused_code;
|
||||
static void cxd56_scu_peri_clock_gating(FAR const struct scu_peripheral *p,
|
||||
static void cxd56_scu_peri_clock_gating(const struct scu_peripheral *p,
|
||||
int enable) unused_code;
|
||||
|
||||
/****************************************************************************
|
||||
|
|
@ -1965,7 +1965,7 @@ void cxd56_scuseq_clock_disable(void)
|
|||
disable_pwd(PDID_SCU);
|
||||
}
|
||||
|
||||
static void cxd56_scu_peri_clock_enable(FAR const struct scu_peripheral *p)
|
||||
static void cxd56_scu_peri_clock_enable(const struct scu_peripheral *p)
|
||||
{
|
||||
uint32_t val;
|
||||
uint32_t rst;
|
||||
|
|
@ -1994,7 +1994,7 @@ static void cxd56_scu_peri_clock_enable(FAR const struct scu_peripheral *p)
|
|||
cxd56_scu_clock_ctrl(cken, crgintmask, 1);
|
||||
}
|
||||
|
||||
static void cxd56_scu_peri_clock_disable(FAR const struct scu_peripheral *p)
|
||||
static void cxd56_scu_peri_clock_disable(const struct scu_peripheral *p)
|
||||
{
|
||||
uint32_t val;
|
||||
uint32_t rst;
|
||||
|
|
@ -2019,7 +2019,7 @@ static void cxd56_scu_peri_clock_disable(FAR const struct scu_peripheral *p)
|
|||
}
|
||||
|
||||
static void cxd56_scu_peri_clock_gating(
|
||||
FAR const struct scu_peripheral *p, int enable)
|
||||
const struct scu_peripheral *p, int enable)
|
||||
{
|
||||
uint32_t cken = 1u << p->cken;
|
||||
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ struct cxd56_sigtype_s
|
|||
{
|
||||
int use;
|
||||
cxd56_cpu1sighandler_t handler;
|
||||
FAR void * data;
|
||||
void *data;
|
||||
};
|
||||
|
||||
struct cxd56cpu1_info_s
|
||||
|
|
@ -82,7 +82,7 @@ static struct cxd56cpu1_info_s g_cpu1_info =
|
|||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
static int cxd56cpu1_worker(int argc, FAR char *argv[])
|
||||
static int cxd56cpu1_worker(int argc, char *argv[])
|
||||
{
|
||||
struct cxd56cpu1_info_s *priv = &g_cpu1_info;
|
||||
iccmsg_t msg;
|
||||
|
|
@ -156,7 +156,7 @@ void cxd56_cpu1sigunregisterhandler(uint8_t sigtype)
|
|||
priv->sigtype[sigtype].handler = NULL;
|
||||
}
|
||||
|
||||
int cxd56_cpu1siginit(uint8_t sigtype, FAR void *data)
|
||||
int cxd56_cpu1siginit(uint8_t sigtype, void *data)
|
||||
{
|
||||
struct cxd56cpu1_info_s *priv = &g_cpu1_info;
|
||||
int pid;
|
||||
|
|
@ -200,7 +200,7 @@ int cxd56_cpu1siginit(uint8_t sigtype, FAR void *data)
|
|||
pid = kthread_create("gnss_receiver",
|
||||
CONFIG_CXD56CPU1_WORKER_THREAD_PRIORITY,
|
||||
CONFIG_CXD56CPU1_WORKER_STACKSIZE, cxd56cpu1_worker,
|
||||
(FAR char * const *) NULL);
|
||||
NULL);
|
||||
|
||||
if (pid < 0)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -55,9 +55,9 @@
|
|||
#error "CXD56_CPU1_DEV must be smaller than 0xf"
|
||||
#endif
|
||||
|
||||
typedef void (*cxd56_cpu1sighandler_t)(uint32_t data, FAR void *userdata);
|
||||
typedef void (*cxd56_cpu1sighandler_t)(uint32_t data, void *userdata);
|
||||
|
||||
extern int cxd56_cpu1siginit(uint8_t cpu1dev, FAR void *data);
|
||||
extern int cxd56_cpu1siginit(uint8_t cpu1dev, void *data);
|
||||
extern int cxd56_cpu1siguninit(uint8_t cpu1dev);
|
||||
extern void cxd56_cpu1sigregisterhandler(uint8_t cpu1dev,
|
||||
cxd56_cpu1sighandler_t handler);
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@
|
|||
|
||||
struct cfpushdata_s
|
||||
{
|
||||
FAR sq_entry_t entry;
|
||||
sq_entry_t entry;
|
||||
uint32_t data[2];
|
||||
};
|
||||
|
||||
|
|
@ -61,8 +61,8 @@ struct cfpushdata_s
|
|||
* Private Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
static int cpufifo_txhandler(int irq, FAR void *context, FAR void *arg);
|
||||
static int cpufifo_rxhandler(int irq, FAR void *context, FAR void *arg);
|
||||
static int cpufifo_txhandler(int irq, void *context, void *arg);
|
||||
static int cpufifo_rxhandler(int irq, void *context, void *arg);
|
||||
static int cpufifo_trypush(uint32_t data[2]);
|
||||
static int cpufifo_reserve(uint32_t data[2]);
|
||||
|
||||
|
|
@ -81,11 +81,11 @@ static cpufifo_handler_t g_cfrxhandler;
|
|||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
static int cpufifo_txhandler(int irq, FAR void *context, FAR void *arg)
|
||||
static int cpufifo_txhandler(int irq, void *context, void *arg)
|
||||
{
|
||||
FAR struct cfpushdata_s *pd;
|
||||
struct cfpushdata_s *pd;
|
||||
|
||||
pd = (FAR struct cfpushdata_s *)sq_remfirst(&g_pushqueue);
|
||||
pd = (struct cfpushdata_s *)sq_remfirst(&g_pushqueue);
|
||||
if (pd)
|
||||
{
|
||||
/* Ignore error because always FIFO is not full at here */
|
||||
|
|
@ -102,7 +102,7 @@ static int cpufifo_txhandler(int irq, FAR void *context, FAR void *arg)
|
|||
return OK;
|
||||
}
|
||||
|
||||
static int cpufifo_rxhandler(int irq, FAR void *context, FAR void *arg)
|
||||
static int cpufifo_rxhandler(int irq, void *context, void *arg)
|
||||
{
|
||||
uint32_t word[2] =
|
||||
{
|
||||
|
|
@ -144,9 +144,9 @@ static int cpufifo_trypush(uint32_t data[2])
|
|||
|
||||
static int cpufifo_reserve(uint32_t data[2])
|
||||
{
|
||||
FAR struct cfpushdata_s *pd;
|
||||
struct cfpushdata_s *pd;
|
||||
|
||||
pd = (FAR struct cfpushdata_s *)sq_remfirst(&g_emptyqueue);
|
||||
pd = (struct cfpushdata_s *)sq_remfirst(&g_emptyqueue);
|
||||
|
||||
/* This error indicates that need more sending buffer, it can be
|
||||
* configured by CONFIG_CXD56_CPUFIFO_ENTRIES.
|
||||
|
|
@ -252,7 +252,7 @@ int cxd56_cfinitialize(void)
|
|||
|
||||
for (i = 0; i < NR_PUSHBUFENTRIES; i++)
|
||||
{
|
||||
sq_addlast((FAR sq_entry_t *)&g_pushbuffer[i], &g_emptyqueue);
|
||||
sq_addlast((sq_entry_t *)&g_pushbuffer[i], &g_emptyqueue);
|
||||
}
|
||||
|
||||
/* Clear user defined receive handler. */
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
int up_cpu_idlestack(int cpu, FAR struct tcb_s *tcb, size_t stack_size)
|
||||
int up_cpu_idlestack(int cpu, struct tcb_s *tcb, size_t stack_size)
|
||||
{
|
||||
#if CONFIG_SMP_NCPUS > 1
|
||||
up_create_stack(tcb, stack_size, TCB_FLAG_TTYPE_KERNEL);
|
||||
|
|
|
|||
|
|
@ -201,7 +201,7 @@ int up_cpu_paused(int cpu)
|
|||
return OK;
|
||||
}
|
||||
|
||||
FAR struct tcb_s *tcb = this_task();
|
||||
struct tcb_s *tcb = this_task();
|
||||
|
||||
/* Update scheduler parameters */
|
||||
|
||||
|
|
@ -264,7 +264,7 @@ int up_cpu_paused(int cpu)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
int arm_pause_handler(int irq, void *c, FAR void *arg)
|
||||
int arm_pause_handler(int irq, void *c, void *arg)
|
||||
{
|
||||
int cpu = up_cpu_index();
|
||||
int ret = OK;
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@
|
|||
|
||||
volatile static spinlock_t g_appdsp_boot;
|
||||
|
||||
extern int arm_pause_handler(int irq, void *c, FAR void *arg);
|
||||
extern int arm_pause_handler(int irq, void *c, void *arg);
|
||||
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
|
|
|
|||
|
|
@ -235,11 +235,11 @@ typedef struct
|
|||
|
||||
static int open_channels = 0;
|
||||
|
||||
static int intr_handler_admac0(int irq, FAR void *context, FAR void *arg);
|
||||
static int intr_handler_admac1(int irq, FAR void *context, FAR void *arg);
|
||||
static int intr_handler_idmac(int irq, FAR void *context, FAR void *arg);
|
||||
static int intr_handler_skdmac0(int irq, FAR void *context, FAR void *arg);
|
||||
static int intr_handler_skdmac1(int irq, FAR void *context, FAR void *arg);
|
||||
static int intr_handler_admac0(int irq, void *context, void *arg);
|
||||
static int intr_handler_admac1(int irq, void *context, void *arg);
|
||||
static int intr_handler_idmac(int irq, void *context, void *arg);
|
||||
static int intr_handler_skdmac0(int irq, void *context, void *arg);
|
||||
static int intr_handler_skdmac1(int irq, void *context, void *arg);
|
||||
static uint32_t irq_map[] =
|
||||
{
|
||||
CXD56_IRQ_APP_DMAC0,
|
||||
|
|
@ -253,7 +253,7 @@ static uint32_t irq_map[] =
|
|||
CXD56_IRQ_SKDMAC_1,
|
||||
};
|
||||
|
||||
static int (*intc_handler[])(int irq, FAR void *context, FAR void *arg) =
|
||||
static int (*intc_handler[])(int irq, void *context, void *arg) =
|
||||
{
|
||||
intr_handler_admac0,
|
||||
intr_handler_admac1,
|
||||
|
|
@ -420,19 +420,19 @@ static void _dmac_intc_handler(int ch)
|
|||
}
|
||||
}
|
||||
|
||||
static int intr_handler_admac0(int irq, FAR void *context, FAR void *arg)
|
||||
static int intr_handler_admac0(int irq, void *context, void *arg)
|
||||
{
|
||||
_dmac_intc_handler(0);
|
||||
return OK;
|
||||
}
|
||||
|
||||
static int intr_handler_admac1(int irq, FAR void *context, FAR void *arg)
|
||||
static int intr_handler_admac1(int irq, void *context, void *arg)
|
||||
{
|
||||
_dmac_intc_handler(1);
|
||||
return OK;
|
||||
}
|
||||
|
||||
static int intr_handler_idmac(int irq, FAR void *context, FAR void *arg)
|
||||
static int intr_handler_idmac(int irq, void *context, void *arg)
|
||||
{
|
||||
struct dmac_register_map *dev = get_device(2); /* XXX */
|
||||
uint32_t stat = dev->intstatus & 0x1f;
|
||||
|
|
@ -449,13 +449,13 @@ static int intr_handler_idmac(int irq, FAR void *context, FAR void *arg)
|
|||
return OK;
|
||||
}
|
||||
|
||||
static int intr_handler_skdmac0(int irq, FAR void *context, FAR void *arg)
|
||||
static int intr_handler_skdmac0(int irq, void *context, void *arg)
|
||||
{
|
||||
_dmac_intc_handler(7);
|
||||
return OK;
|
||||
}
|
||||
|
||||
static int intr_handler_skdmac1(int irq, FAR void *context, FAR void *arg)
|
||||
static int intr_handler_skdmac1(int irq, void *context, void *arg)
|
||||
{
|
||||
_dmac_intc_handler(8);
|
||||
return OK;
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@
|
|||
* DMA channel.
|
||||
*/
|
||||
|
||||
typedef FAR void *DMA_HANDLE;
|
||||
typedef void *DMA_HANDLE;
|
||||
|
||||
/* Description:
|
||||
* This is the type of the callback that is used to inform the user of the
|
||||
|
|
|
|||
|
|
@ -102,21 +102,21 @@ struct cxd56_emmc_state_s
|
|||
|
||||
/* Block driver interfaces **************************************************/
|
||||
|
||||
static int cxd56_emmc_open(FAR struct inode *inode);
|
||||
static int cxd56_emmc_close(FAR struct inode *inode);
|
||||
static ssize_t cxd56_emmc_read(FAR struct inode *inode,
|
||||
static int cxd56_emmc_open(struct inode *inode);
|
||||
static int cxd56_emmc_close(struct inode *inode);
|
||||
static ssize_t cxd56_emmc_read(struct inode *inode,
|
||||
unsigned char *buffer,
|
||||
blkcnt_t start_sector,
|
||||
unsigned int nsectors);
|
||||
#if !defined(CONFIG_MMCSD_READONLY)
|
||||
static ssize_t cxd56_emmc_write(FAR struct inode *inode,
|
||||
static ssize_t cxd56_emmc_write(struct inode *inode,
|
||||
const unsigned char *buffer,
|
||||
blkcnt_t start_sector,
|
||||
unsigned int nsectors);
|
||||
#endif
|
||||
static int cxd56_emmc_geometry(FAR struct inode *inode,
|
||||
static int cxd56_emmc_geometry(struct inode *inode,
|
||||
struct geometry *geometry);
|
||||
static int emmc_interrupt(int irq, FAR void *context, FAR void *arg);
|
||||
static int emmc_interrupt(int irq, void *context, void *arg);
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
|
|
@ -143,12 +143,12 @@ struct cxd56_emmc_state_s g_emmcdev;
|
|||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
static int emmc_takesem(FAR sem_t *sem)
|
||||
static int emmc_takesem(sem_t *sem)
|
||||
{
|
||||
return nxsem_wait_uninterruptible(sem);
|
||||
}
|
||||
|
||||
static void emmc_givesem(FAR sem_t *sem)
|
||||
static void emmc_givesem(sem_t *sem)
|
||||
{
|
||||
nxsem_post(sem);
|
||||
}
|
||||
|
|
@ -508,7 +508,7 @@ static int emmc_switchcmd(uint8_t index, uint8_t val)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int emmc_interrupt(int irq, FAR void *context, FAR void *arg)
|
||||
static int emmc_interrupt(int irq, void *context, void *arg)
|
||||
{
|
||||
uint32_t intr;
|
||||
|
||||
|
|
@ -689,7 +689,7 @@ errout:
|
|||
return ret;
|
||||
}
|
||||
|
||||
static int cxd56_emmc_readsectors(FAR struct cxd56_emmc_state_s *priv,
|
||||
static int cxd56_emmc_readsectors(struct cxd56_emmc_state_s *priv,
|
||||
void *buf,
|
||||
size_t start_sector,
|
||||
unsigned int nsectors)
|
||||
|
|
@ -753,7 +753,7 @@ finish:
|
|||
}
|
||||
|
||||
#if !defined(CONFIG_MMCSD_READONLY)
|
||||
static int cxd56_emmc_writesectors(FAR struct cxd56_emmc_state_s *priv,
|
||||
static int cxd56_emmc_writesectors(struct cxd56_emmc_state_s *priv,
|
||||
const void *buf, blkcnt_t start_sector,
|
||||
unsigned int nsectors)
|
||||
{
|
||||
|
|
@ -829,13 +829,13 @@ finish:
|
|||
}
|
||||
#endif
|
||||
|
||||
static int cxd56_emmc_open(FAR struct inode *inode)
|
||||
static int cxd56_emmc_open(struct inode *inode)
|
||||
{
|
||||
FAR struct cxd56_emmc_state_s *priv;
|
||||
struct cxd56_emmc_state_s *priv;
|
||||
int ret;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
priv = (FAR struct cxd56_emmc_state_s *)inode->i_private;
|
||||
priv = (struct cxd56_emmc_state_s *)inode->i_private;
|
||||
|
||||
/* Just increment the reference count on the driver */
|
||||
|
||||
|
|
@ -850,13 +850,13 @@ static int cxd56_emmc_open(FAR struct inode *inode)
|
|||
return OK;
|
||||
}
|
||||
|
||||
static int cxd56_emmc_close(FAR struct inode *inode)
|
||||
static int cxd56_emmc_close(struct inode *inode)
|
||||
{
|
||||
FAR struct cxd56_emmc_state_s *priv;
|
||||
struct cxd56_emmc_state_s *priv;
|
||||
int ret;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
priv = (FAR struct cxd56_emmc_state_s *)inode->i_private;
|
||||
priv = (struct cxd56_emmc_state_s *)inode->i_private;
|
||||
|
||||
/* Decrement the reference count on the block driver */
|
||||
|
||||
|
|
@ -872,15 +872,15 @@ static int cxd56_emmc_close(FAR struct inode *inode)
|
|||
return OK;
|
||||
}
|
||||
|
||||
static ssize_t cxd56_emmc_read(FAR struct inode *inode,
|
||||
static ssize_t cxd56_emmc_read(struct inode *inode,
|
||||
unsigned char *buffer, blkcnt_t start_sector,
|
||||
unsigned int nsectors)
|
||||
{
|
||||
FAR struct cxd56_emmc_state_s *priv;
|
||||
struct cxd56_emmc_state_s *priv;
|
||||
int ret;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
priv = (FAR struct cxd56_emmc_state_s *)inode->i_private;
|
||||
priv = (struct cxd56_emmc_state_s *)inode->i_private;
|
||||
|
||||
finfo("Read sector %" PRIu32 " (%u sectors) to %p\n",
|
||||
start_sector, nsectors, buffer);
|
||||
|
|
@ -896,16 +896,16 @@ static ssize_t cxd56_emmc_read(FAR struct inode *inode,
|
|||
}
|
||||
|
||||
#if !defined(CONFIG_MMCSD_READONLY)
|
||||
static ssize_t cxd56_emmc_write(FAR struct inode *inode,
|
||||
static ssize_t cxd56_emmc_write(struct inode *inode,
|
||||
const unsigned char *buffer,
|
||||
blkcnt_t start_sector,
|
||||
unsigned int nsectors)
|
||||
{
|
||||
FAR struct cxd56_emmc_state_s *priv;
|
||||
struct cxd56_emmc_state_s *priv;
|
||||
int ret;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
priv = (FAR struct cxd56_emmc_state_s *)inode->i_private;
|
||||
priv = (struct cxd56_emmc_state_s *)inode->i_private;
|
||||
|
||||
finfo("Write %p to sector %" PRIu32 " (%u sectors)\n", buffer,
|
||||
start_sector, nsectors);
|
||||
|
|
@ -921,13 +921,13 @@ static ssize_t cxd56_emmc_write(FAR struct inode *inode,
|
|||
}
|
||||
#endif
|
||||
|
||||
static int cxd56_emmc_geometry(FAR struct inode *inode,
|
||||
static int cxd56_emmc_geometry(struct inode *inode,
|
||||
struct geometry *geometry)
|
||||
{
|
||||
FAR struct cxd56_emmc_state_s *priv;
|
||||
struct cxd56_emmc_state_s *priv;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
priv = (FAR struct cxd56_emmc_state_s *)inode->i_private;
|
||||
priv = (struct cxd56_emmc_state_s *)inode->i_private;
|
||||
|
||||
geometry->geo_available = true;
|
||||
geometry->geo_mediachanged = false;
|
||||
|
|
@ -944,9 +944,9 @@ static int cxd56_emmc_geometry(FAR struct inode *inode,
|
|||
|
||||
int cxd56_emmcinitialize(void)
|
||||
{
|
||||
FAR struct cxd56_emmc_state_s *priv;
|
||||
FAR uint8_t *buf;
|
||||
FAR struct emmc_dma_desc_s *descs;
|
||||
struct cxd56_emmc_state_s *priv;
|
||||
uint8_t *buf;
|
||||
struct emmc_dma_desc_s *descs;
|
||||
int ret;
|
||||
|
||||
priv = &g_emmcdev;
|
||||
|
|
@ -962,7 +962,7 @@ int cxd56_emmcinitialize(void)
|
|||
return -EIO;
|
||||
}
|
||||
|
||||
buf = (FAR uint8_t *)kmm_malloc(SECTOR_SIZE);
|
||||
buf = (uint8_t *)kmm_malloc(SECTOR_SIZE);
|
||||
if (buf)
|
||||
{
|
||||
putreg32(SECTOR_SIZE, EMMC_BYTCNT);
|
||||
|
|
@ -976,7 +976,7 @@ int cxd56_emmcinitialize(void)
|
|||
return -EIO;
|
||||
}
|
||||
|
||||
priv->total_sectors = *(FAR uint32_t *)&buf[EXTCSD_SEC_COUNT];
|
||||
priv->total_sectors = *(uint32_t *)&buf[EXTCSD_SEC_COUNT];
|
||||
kmm_free(descs);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -160,7 +160,7 @@ static int cxd56_sendmsg(int cpuid, int protoid, int msgtype, uint16_t pdata,
|
|||
|
||||
static int cxd56_farapidonehandler(int cpuid, int protoid,
|
||||
uint32_t pdata, uint32_t data,
|
||||
FAR void *userdata)
|
||||
void *userdata)
|
||||
{
|
||||
/* Receive event flag message as Far API done.
|
||||
* We need only far API done event.
|
||||
|
|
|
|||
|
|
@ -62,11 +62,11 @@ struct bat_gauge_dev_s
|
|||
* Private Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
static ssize_t gauge_read(FAR struct file *filep, FAR char *buffer,
|
||||
static ssize_t gauge_read(struct file *filep, char *buffer,
|
||||
size_t buflen);
|
||||
static ssize_t gauge_write(FAR struct file *filep,
|
||||
FAR const char *buffer, size_t buflen);
|
||||
static int gauge_ioctl(FAR struct file *filep, int cmd,
|
||||
static ssize_t gauge_write(struct file *filep,
|
||||
const char *buffer, size_t buflen);
|
||||
static int gauge_ioctl(struct file *filep, int cmd,
|
||||
unsigned long arg);
|
||||
|
||||
/****************************************************************************
|
||||
|
|
@ -97,7 +97,7 @@ static struct bat_gauge_dev_s g_gaugedev;
|
|||
* Name: gauge_get_status
|
||||
****************************************************************************/
|
||||
|
||||
static int gauge_get_status(FAR enum battery_status_e *status)
|
||||
static int gauge_get_status(enum battery_status_e *status)
|
||||
{
|
||||
uint8_t state;
|
||||
int ret;
|
||||
|
|
@ -150,7 +150,7 @@ static int gauge_get_status(FAR enum battery_status_e *status)
|
|||
* Name: gauge_get_vol
|
||||
****************************************************************************/
|
||||
|
||||
static int gauge_get_vol(FAR b16_t *voltage)
|
||||
static int gauge_get_vol(b16_t *voltage)
|
||||
{
|
||||
struct pmic_gauge_s gauge;
|
||||
int ret;
|
||||
|
|
@ -176,7 +176,7 @@ static int gauge_get_vol(FAR b16_t *voltage)
|
|||
* Name: gauge_get_capacity
|
||||
****************************************************************************/
|
||||
|
||||
static int gauge_get_capacity(FAR b16_t *capacity)
|
||||
static int gauge_get_capacity(b16_t *capacity)
|
||||
{
|
||||
b16_t vol;
|
||||
int lower;
|
||||
|
|
@ -234,7 +234,7 @@ static int gauge_get_capacity(FAR b16_t *capacity)
|
|||
* Name: gauge_online
|
||||
****************************************************************************/
|
||||
|
||||
static int gauge_online(FAR bool *online)
|
||||
static int gauge_online(bool *online)
|
||||
{
|
||||
if (online == NULL)
|
||||
{
|
||||
|
|
@ -249,7 +249,7 @@ static int gauge_online(FAR bool *online)
|
|||
* Name: gauge_read
|
||||
****************************************************************************/
|
||||
|
||||
static ssize_t gauge_read(FAR struct file *filep, FAR char *buffer,
|
||||
static ssize_t gauge_read(struct file *filep, char *buffer,
|
||||
size_t buflen)
|
||||
{
|
||||
/* Return nothing read */
|
||||
|
|
@ -261,8 +261,8 @@ static ssize_t gauge_read(FAR struct file *filep, FAR char *buffer,
|
|||
* Name: gauge_write
|
||||
****************************************************************************/
|
||||
|
||||
static ssize_t gauge_write(FAR struct file *filep,
|
||||
FAR const char *buffer, size_t buflen)
|
||||
static ssize_t gauge_write(struct file *filep,
|
||||
const char *buffer, size_t buflen)
|
||||
{
|
||||
/* Return nothing written */
|
||||
|
||||
|
|
@ -273,10 +273,10 @@ static ssize_t gauge_write(FAR struct file *filep,
|
|||
* Name: gauge_ioctl
|
||||
****************************************************************************/
|
||||
|
||||
static int gauge_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
|
||||
static int gauge_ioctl(struct file *filep, int cmd, unsigned long arg)
|
||||
{
|
||||
FAR struct inode *inode = filep->f_inode;
|
||||
FAR struct bat_gauge_dev_s *priv = inode->i_private;
|
||||
struct inode *inode = filep->f_inode;
|
||||
struct bat_gauge_dev_s *priv = inode->i_private;
|
||||
int ret = -ENOTTY;
|
||||
|
||||
nxsem_wait_uninterruptible(&priv->batsem);
|
||||
|
|
@ -285,29 +285,29 @@ static int gauge_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
|
|||
{
|
||||
case BATIOC_STATE:
|
||||
{
|
||||
FAR enum battery_status_e *status =
|
||||
(FAR enum battery_status_e *)(uintptr_t)arg;
|
||||
enum battery_status_e *status =
|
||||
(enum battery_status_e *)(uintptr_t)arg;
|
||||
ret = gauge_get_status(status);
|
||||
}
|
||||
break;
|
||||
|
||||
case BATIOC_VOLTAGE:
|
||||
{
|
||||
FAR b16_t *voltage = (FAR b16_t *)(uintptr_t)arg;
|
||||
b16_t *voltage = (b16_t *)(uintptr_t)arg;
|
||||
ret = gauge_get_vol(voltage);
|
||||
}
|
||||
break;
|
||||
|
||||
case BATIOC_CAPACITY:
|
||||
{
|
||||
FAR b16_t *capacity = (FAR b16_t *)(uintptr_t)arg;
|
||||
b16_t *capacity = (b16_t *)(uintptr_t)arg;
|
||||
ret = gauge_get_capacity(capacity);
|
||||
}
|
||||
break;
|
||||
|
||||
case BATIOC_ONLINE:
|
||||
{
|
||||
FAR bool *online = (FAR bool *)(uintptr_t)arg;
|
||||
bool *online = (bool *)(uintptr_t)arg;
|
||||
ret = gauge_online(online);
|
||||
}
|
||||
break;
|
||||
|
|
@ -340,9 +340,9 @@ static int gauge_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
int cxd56_gauge_initialize(FAR const char *devpath)
|
||||
int cxd56_gauge_initialize(const char *devpath)
|
||||
{
|
||||
FAR struct bat_gauge_dev_s *priv = &g_gaugedev;
|
||||
struct bat_gauge_dev_s *priv = &g_gaugedev;
|
||||
int ret;
|
||||
|
||||
/* Initialize the CXD5247 device structure */
|
||||
|
|
@ -375,7 +375,7 @@ int cxd56_gauge_initialize(FAR const char *devpath)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
int cxd56_gauge_uninitialize(FAR const char *devpath)
|
||||
int cxd56_gauge_uninitialize(const char *devpath)
|
||||
{
|
||||
unregister_driver(devpath);
|
||||
return OK;
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
|
||||
/* initialize function */
|
||||
|
||||
int cxd56_gauge_initialize(FAR const char *devpath);
|
||||
int cxd56_gauge_uninitialize(FAR const char *devpath);
|
||||
int cxd56_gauge_initialize(const char *devpath);
|
||||
int cxd56_gauge_uninitialize(const char *devpath);
|
||||
|
||||
#endif /* __ARCH_ARM_SRC_CXD56XX_CXD56_GAUGE_H */
|
||||
|
|
|
|||
|
|
@ -46,14 +46,14 @@
|
|||
* Private Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
static ssize_t ge2d_read(FAR struct file *filep, FAR char *buffer,
|
||||
static ssize_t ge2d_read(struct file *filep, char *buffer,
|
||||
size_t len);
|
||||
static ssize_t ge2d_write(FAR struct file *filep, FAR const char *buffer,
|
||||
static ssize_t ge2d_write(struct file *filep, const char *buffer,
|
||||
size_t len);
|
||||
static int ge2d_ioctl(FAR struct file *filep, int cmd, unsigned long arg);
|
||||
static int ge2d_ioctl(struct file *filep, int cmd, unsigned long arg);
|
||||
static int ge2d_semtake(sem_t *id);
|
||||
static void ge2d_semgive(sem_t *id);
|
||||
static int ge2d_irqhandler(int irq, FAR void *context, FAR void *arg);
|
||||
static int ge2d_irqhandler(int irq, void *context, void *arg);
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
|
|
@ -95,8 +95,8 @@ static void ge2d_semgive(sem_t *id)
|
|||
* Name: ge2d_read
|
||||
****************************************************************************/
|
||||
|
||||
static ssize_t ge2d_read(FAR struct file *filep,
|
||||
FAR char *buffer,
|
||||
static ssize_t ge2d_read(struct file *filep,
|
||||
char *buffer,
|
||||
size_t len)
|
||||
{
|
||||
return 0;
|
||||
|
|
@ -106,7 +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(struct file *filep, const char *buffer,
|
||||
size_t len)
|
||||
{
|
||||
uint32_t bits;
|
||||
|
|
@ -157,7 +157,7 @@ static ssize_t ge2d_write(FAR struct file *filep, FAR const char *buffer,
|
|||
* Name: ge2d_ioctl
|
||||
****************************************************************************/
|
||||
|
||||
static int ge2d_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
|
||||
static int ge2d_ioctl(struct file *filep, int cmd, unsigned long arg)
|
||||
{
|
||||
int ret = -ENOTTY;
|
||||
|
||||
|
|
@ -180,7 +180,7 @@ static int ge2d_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
|
|||
* Name: ge2d_irqhandler
|
||||
****************************************************************************/
|
||||
|
||||
static int ge2d_irqhandler(int irq, FAR void *context, FAR void *arg)
|
||||
static int ge2d_irqhandler(int irq, void *context, void *arg)
|
||||
{
|
||||
uint32_t stat;
|
||||
|
||||
|
|
@ -202,7 +202,7 @@ static int ge2d_irqhandler(int irq, FAR void *context, FAR void *arg)
|
|||
* Name: cxd56_ge2dinitialize
|
||||
****************************************************************************/
|
||||
|
||||
int cxd56_ge2dinitialize(FAR const char *devname)
|
||||
int cxd56_ge2dinitialize(const char *devname)
|
||||
{
|
||||
int ret;
|
||||
|
||||
|
|
@ -232,7 +232,7 @@ int cxd56_ge2dinitialize(FAR const char *devname)
|
|||
* Name: cxd56_ge2duninitialize
|
||||
****************************************************************************/
|
||||
|
||||
void cxd56_ge2duninitialize(FAR const char *devname)
|
||||
void cxd56_ge2duninitialize(const char *devname)
|
||||
{
|
||||
up_disable_irq(CXD56_IRQ_GE2D);
|
||||
irq_detach(CXD56_IRQ_GE2D);
|
||||
|
|
|
|||
|
|
@ -58,8 +58,8 @@
|
|||
|
||||
struct cxd56_geofence_dev_s
|
||||
{
|
||||
sem_t devsem;
|
||||
FAR struct pollfd *fds[CONFIG_GEOFENCE_NPOLLWAITERS];
|
||||
sem_t devsem;
|
||||
struct pollfd *fds[CONFIG_GEOFENCE_NPOLLWAITERS];
|
||||
};
|
||||
|
||||
/****************************************************************************
|
||||
|
|
@ -68,14 +68,14 @@ struct cxd56_geofence_dev_s
|
|||
|
||||
/* file operation functions */
|
||||
|
||||
static ssize_t cxd56_geofence_read(FAR struct file *filep,
|
||||
FAR char *buffer,
|
||||
static ssize_t cxd56_geofence_read(struct file *filep,
|
||||
char *buffer,
|
||||
size_t len);
|
||||
static int cxd56_geofence_ioctl(FAR struct file *filep,
|
||||
static int cxd56_geofence_ioctl(struct file *filep,
|
||||
int cmd,
|
||||
unsigned long arg);
|
||||
static int cxd56_geofence_poll(FAR struct file *filep,
|
||||
FAR struct pollfd *fds,
|
||||
static int cxd56_geofence_poll(struct file *filep,
|
||||
struct pollfd *fds,
|
||||
bool setup);
|
||||
|
||||
/* ioctl command functions */
|
||||
|
|
@ -113,7 +113,7 @@ static const struct file_operations g_geofencefops =
|
|||
|
||||
/* ioctl command list */
|
||||
|
||||
FAR static int (*g_cmdlist[CXD56_GEOFENCE_IOCTL_MAX])(unsigned long) =
|
||||
static int (*g_cmdlist[CXD56_GEOFENCE_IOCTL_MAX])(unsigned long) =
|
||||
{
|
||||
NULL, /* CXD56_GEOFENCE_IOCTL_INVAL = 0 */
|
||||
cxd56_geofence_start,
|
||||
|
|
@ -191,15 +191,15 @@ static int cxd56_geofence_stop(unsigned long arg)
|
|||
|
||||
static int cxd56_geofence_add_region(unsigned long arg)
|
||||
{
|
||||
int ret;
|
||||
FAR struct cxd56_geofence_region_s *reg_data;
|
||||
int ret;
|
||||
struct cxd56_geofence_region_s *reg_data;
|
||||
|
||||
if (!arg)
|
||||
{
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
reg_data = (FAR struct cxd56_geofence_region_s *)arg;
|
||||
reg_data = (struct cxd56_geofence_region_s *)arg;
|
||||
|
||||
ret = fw_gd_geoaddregion(reg_data->id,
|
||||
reg_data->latitude,
|
||||
|
|
@ -226,15 +226,15 @@ static int cxd56_geofence_add_region(unsigned long arg)
|
|||
|
||||
static int cxd56_geofence_modify_region(unsigned long arg)
|
||||
{
|
||||
int ret;
|
||||
FAR struct cxd56_geofence_region_s *reg_data;
|
||||
int ret;
|
||||
struct cxd56_geofence_region_s *reg_data;
|
||||
|
||||
if (!arg)
|
||||
{
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
reg_data = (FAR struct cxd56_geofence_region_s *)arg;
|
||||
reg_data = (struct cxd56_geofence_region_s *)arg;
|
||||
|
||||
ret = fw_gd_geomodifyregion(reg_data->id, reg_data->latitude,
|
||||
reg_data->longitude, reg_data->radius);
|
||||
|
|
@ -259,8 +259,8 @@ static int cxd56_geofence_modify_region(unsigned long arg)
|
|||
|
||||
static int cxd56_geofence_delete_region(unsigned long arg)
|
||||
{
|
||||
int ret;
|
||||
FAR uint8_t id;
|
||||
int ret;
|
||||
uint8_t id;
|
||||
|
||||
if (UINT8_MAX < arg)
|
||||
{
|
||||
|
|
@ -314,15 +314,15 @@ static int cxd56_geofence_delete_all_region(unsigned long arg)
|
|||
|
||||
static int cxd56_geofence_get_region_data(unsigned long arg)
|
||||
{
|
||||
int ret;
|
||||
FAR struct cxd56_geofence_region_s *reg_data;
|
||||
int ret;
|
||||
struct cxd56_geofence_region_s *reg_data;
|
||||
|
||||
if (!arg)
|
||||
{
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
reg_data = (FAR struct cxd56_geofence_region_s *)arg;
|
||||
reg_data = (struct cxd56_geofence_region_s *)arg;
|
||||
|
||||
ret = fw_gd_geogetregiondata(reg_data->id, ®_data->latitude,
|
||||
®_data->longitude, ®_data->radius);
|
||||
|
|
@ -399,14 +399,14 @@ static int cxd56_geofence_get_all_status(unsigned long arg)
|
|||
static int cxd56_geofence_set_mode(unsigned long arg)
|
||||
{
|
||||
int ret;
|
||||
FAR struct cxd56_geofence_mode_s *mode;
|
||||
struct cxd56_geofence_mode_s *mode;
|
||||
|
||||
if (!arg)
|
||||
{
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
mode = (FAR struct cxd56_geofence_mode_s *)arg;
|
||||
mode = (struct cxd56_geofence_mode_s *)arg;
|
||||
|
||||
ret = fw_gd_geosetopmode(mode->deadzone, mode->dwell_detecttime);
|
||||
|
||||
|
|
@ -429,10 +429,10 @@ static int cxd56_geofence_set_mode(unsigned long arg)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static void cxd56_geofence_sighandler(uint32_t data, FAR void *userdata)
|
||||
static void cxd56_geofence_sighandler(uint32_t data, void *userdata)
|
||||
{
|
||||
FAR struct cxd56_geofence_dev_s *priv =
|
||||
(FAR struct cxd56_geofence_dev_s *)userdata;
|
||||
struct cxd56_geofence_dev_s *priv =
|
||||
(struct cxd56_geofence_dev_s *)userdata;
|
||||
int i;
|
||||
int ret;
|
||||
|
||||
|
|
@ -469,7 +469,7 @@ static void cxd56_geofence_sighandler(uint32_t data, FAR void *userdata)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int cxd56_geofence_initialize(FAR struct cxd56_geofence_dev_s *dev)
|
||||
static int cxd56_geofence_initialize(struct cxd56_geofence_dev_s *dev)
|
||||
{
|
||||
int32_t ret = 0;
|
||||
|
||||
|
|
@ -492,7 +492,7 @@ static int cxd56_geofence_initialize(FAR struct cxd56_geofence_dev_s *dev)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static ssize_t cxd56_geofence_read(FAR struct file *filep, FAR char *buffer,
|
||||
static ssize_t cxd56_geofence_read(struct file *filep, char *buffer,
|
||||
size_t len)
|
||||
{
|
||||
int32_t ret = 0;
|
||||
|
|
@ -535,7 +535,7 @@ static ssize_t cxd56_geofence_read(FAR struct file *filep, FAR char *buffer,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int cxd56_geofence_ioctl(FAR struct file *filep, int cmd,
|
||||
static int cxd56_geofence_ioctl(struct file *filep, int cmd,
|
||||
unsigned long arg)
|
||||
{
|
||||
if (cmd <= CXD56_GEOFENCE_IOCTL_INVAL || cmd >= CXD56_GEOFENCE_IOCTL_MAX)
|
||||
|
|
@ -562,17 +562,17 @@ static int cxd56_geofence_ioctl(FAR struct file *filep, int cmd,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int cxd56_geofence_poll(FAR struct file *filep,
|
||||
FAR struct pollfd *fds,
|
||||
static int cxd56_geofence_poll(struct file *filep,
|
||||
struct pollfd *fds,
|
||||
bool setup)
|
||||
{
|
||||
FAR struct inode * inode;
|
||||
FAR struct cxd56_geofence_dev_s *priv;
|
||||
int ret = OK;
|
||||
int i;
|
||||
struct inode * inode;
|
||||
struct cxd56_geofence_dev_s *priv;
|
||||
int ret = OK;
|
||||
int i;
|
||||
|
||||
inode = filep->f_inode;
|
||||
priv = (FAR struct cxd56_geofence_dev_s *)inode->i_private;
|
||||
priv = (struct cxd56_geofence_dev_s *)inode->i_private;
|
||||
|
||||
ret = nxsem_wait(&priv->devsem);
|
||||
if (ret < 0)
|
||||
|
|
@ -643,12 +643,12 @@ errout:
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int cxd56_geofence_register(FAR const char *devpath)
|
||||
static int cxd56_geofence_register(const char *devpath)
|
||||
{
|
||||
FAR struct cxd56_geofence_dev_s *priv;
|
||||
int ret;
|
||||
struct cxd56_geofence_dev_s *priv;
|
||||
int ret;
|
||||
|
||||
priv = (FAR struct cxd56_geofence_dev_s *)kmm_malloc(
|
||||
priv = (struct cxd56_geofence_dev_s *)kmm_malloc(
|
||||
sizeof(struct cxd56_geofence_dev_s));
|
||||
if (!priv)
|
||||
{
|
||||
|
|
@ -708,7 +708,7 @@ static int cxd56_geofence_register(FAR const char *devpath)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
int cxd56_geofenceinitialize(FAR const char *devpath)
|
||||
int cxd56_geofenceinitialize(const char *devpath)
|
||||
{
|
||||
int ret;
|
||||
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ extern "C"
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
int cxd56_geofenceinitialize(FAR const char *devpath);
|
||||
int cxd56_geofenceinitialize(const char *devpath);
|
||||
|
||||
#undef EXTERN
|
||||
#if defined(__cplusplus)
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -82,7 +82,7 @@ extern "C"
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
int cxd56_gnssinitialize(FAR const char *devpath);
|
||||
int cxd56_gnssinitialize(const char *devpath);
|
||||
|
||||
#undef EXTERN
|
||||
#if defined(__cplusplus)
|
||||
|
|
|
|||
|
|
@ -78,12 +78,12 @@ int fw_gd_selectsatellitesystem(uint32_t system);
|
|||
* by CXD56_GNSS_B_SAT_XXX.
|
||||
*/
|
||||
|
||||
int fw_gd_getsatellitesystem(FAR uint32_t *system);
|
||||
int fw_gd_getsatellitesystem(uint32_t *system);
|
||||
|
||||
/* Set the rough receiver position */
|
||||
|
||||
int fw_gd_setreceiverpositionellipsoidal(FAR double *dlat, FAR double *dlon,
|
||||
FAR double *dheight);
|
||||
int fw_gd_setreceiverpositionellipsoidal(double *dlat, double *dlon,
|
||||
double *dheight);
|
||||
|
||||
/* Set the rough receiver position as orgothonal */
|
||||
|
||||
|
|
@ -95,7 +95,7 @@ int fw_gd_set1ppsoutput(uint32_t enable);
|
|||
|
||||
/* Get the current 1PPS output setting. */
|
||||
|
||||
int fw_gd_get1ppsoutput(FAR uint32_t *enable);
|
||||
int fw_gd_get1ppsoutput(uint32_t *enable);
|
||||
|
||||
/* Set the receiver operation mode
|
||||
* 1st argument 'mode' is a operation mode defined by CXD56_GNSS_OPMOD_XXX.
|
||||
|
|
@ -106,7 +106,7 @@ int fw_gd_setoperationmode(uint32_t mode, uint32_t cycle);
|
|||
|
||||
/* Get the receiver operation mode */
|
||||
|
||||
int fw_gd_getoperationmode(FAR uint32_t *mode, FAR uint32_t *cycle);
|
||||
int fw_gd_getoperationmode(uint32_t *mode, uint32_t *cycle);
|
||||
|
||||
/* Set the TCXO offset */
|
||||
|
||||
|
|
@ -114,14 +114,14 @@ int fw_gd_settcxooffset(int32_t offset);
|
|||
|
||||
/* Get the TCXO offset */
|
||||
|
||||
int fw_gd_gettcxooffset(FAR int32_t *offset);
|
||||
int fw_gd_gettcxooffset(int32_t *offset);
|
||||
|
||||
/* Set the estimated current time of the receiver.
|
||||
* 1st argument date & time are in UTC.
|
||||
*/
|
||||
|
||||
int fw_gd_settime(FAR struct cxd56_gnss_date_s *date,
|
||||
FAR struct cxd56_gnss_time_s *time);
|
||||
int fw_gd_settime(struct cxd56_gnss_date_s *date,
|
||||
struct cxd56_gnss_time_s *time);
|
||||
|
||||
/* Set the network time */
|
||||
|
||||
|
|
@ -129,21 +129,21 @@ int fw_gd_setframetime(uint16_t sec, uint32_t fracsec);
|
|||
|
||||
/* Get the almanac data */
|
||||
|
||||
int fw_gd_getalmanac(uint32_t satellite, FAR uint32_t *almanac,
|
||||
FAR uint32_t *almanacsize);
|
||||
int fw_gd_getalmanac(uint32_t satellite, uint32_t *almanac,
|
||||
uint32_t *almanacsize);
|
||||
|
||||
/* Set the almanac data */
|
||||
|
||||
int fw_gd_setalmanac(uint32_t satellite, FAR uint32_t *almanac);
|
||||
int fw_gd_setalmanac(uint32_t satellite, uint32_t *almanac);
|
||||
|
||||
/* Get the Ephemeris data */
|
||||
|
||||
int fw_gd_getephemeris(uint32_t satellite, FAR uint32_t *ephemeris,
|
||||
FAR uint32_t *ephemerissize);
|
||||
int fw_gd_getephemeris(uint32_t satellite, uint32_t *ephemeris,
|
||||
uint32_t *ephemerissize);
|
||||
|
||||
/* Set the Ephemeris data */
|
||||
|
||||
int fw_gd_setephemeris(uint32_t satellite, FAR uint32_t *ephemeris);
|
||||
int fw_gd_setephemeris(uint32_t satellite, uint32_t *ephemeris);
|
||||
|
||||
/* Select to use or not use the initial position calculation supporting
|
||||
* information of the QZSS L1-SAIF.
|
||||
|
|
@ -155,7 +155,7 @@ int fw_gd_setqzssposassist(uint32_t enable);
|
|||
* information of the QZSS L1-SAIF.
|
||||
*/
|
||||
|
||||
int fw_gd_getqzssposassist(FAR uint32_t *enable);
|
||||
int fw_gd_getqzssposassist(uint32_t *enable);
|
||||
|
||||
/* Set IMES bitrates. */
|
||||
|
||||
|
|
@ -163,7 +163,7 @@ int fw_gd_setimesbitrate(uint32_t bitrate);
|
|||
|
||||
/* Get IMES bitrates. */
|
||||
|
||||
int fw_gd_getimesbitrate(FAR uint32_t *bitrate);
|
||||
int fw_gd_getimesbitrate(uint32_t *bitrate);
|
||||
|
||||
/* Set IMES center frequency offset. */
|
||||
|
||||
|
|
@ -176,7 +176,7 @@ int fw_gd_setimespreamble(uint32_t preamble);
|
|||
/* Start GPS test */
|
||||
|
||||
void fw_gd_startgpstest(uint32_t satellite, uint32_t reserve1,
|
||||
uint32_t reserve2, uint32_t reserve3);
|
||||
uint32_t reserve2, uint32_t reserve3);
|
||||
|
||||
/* Stop GPS test */
|
||||
|
||||
|
|
@ -184,13 +184,13 @@ int fw_gd_stopgpstest(void);
|
|||
|
||||
/* Get GPS test result */
|
||||
|
||||
int fw_gd_getgpstestresult(FAR float *cn, FAR float *doppler);
|
||||
int fw_gd_getgpstestresult(float *cn, float *doppler);
|
||||
|
||||
/* Control Spectrum output */
|
||||
|
||||
int fw_gd_spectrumcontrol(unsigned long time, unsigned int enable,
|
||||
unsigned char monipoint1, unsigned char step1,
|
||||
unsigned char monipoint2, unsigned char step2);
|
||||
unsigned char monipoint1, unsigned char step1,
|
||||
unsigned char monipoint2, unsigned char step2);
|
||||
|
||||
/* Save the backup data to a Flash memory. */
|
||||
|
||||
|
|
@ -202,7 +202,7 @@ int fw_gd_cepcheckassistdata(void);
|
|||
|
||||
/* CEP Get Age Data */
|
||||
|
||||
int fw_gd_cepgetagedata(FAR float *age, FAR float *cepi);
|
||||
int fw_gd_cepgetagedata(float *age, float *cepi);
|
||||
|
||||
/* CEP Reset Assist Data init flag & valid flag */
|
||||
|
||||
|
|
@ -210,18 +210,18 @@ int fw_gd_cepinitassistdata(void);
|
|||
|
||||
/* AGPS Set tau */
|
||||
|
||||
int fw_gd_settaugps(FAR double *tau);
|
||||
int fw_gd_settaugps(double *tau);
|
||||
|
||||
/* AGPS Set Acquist */
|
||||
|
||||
int fw_gd_setacquist(FAR uint8_t *pacquistdata, uint16_t acquistsize);
|
||||
int fw_gd_setacquist(uint8_t *pacquistdata, uint16_t acquistsize);
|
||||
|
||||
/* Set the estimated current time of the receiver.
|
||||
* 1st argument date & time are in GPS time.
|
||||
*/
|
||||
|
||||
int fw_gd_settimegps(FAR struct cxd56_gnss_date_s *date,
|
||||
FAR struct cxd56_gnss_time_s *time);
|
||||
int fw_gd_settimegps(struct cxd56_gnss_date_s *date,
|
||||
struct cxd56_gnss_time_s *time);
|
||||
|
||||
/* Clear Receiver Information */
|
||||
|
||||
|
|
@ -229,21 +229,21 @@ int fw_gd_clearreceiverinfo(uint32_t type);
|
|||
|
||||
/* AGPS Set Tow Assist */
|
||||
|
||||
int fw_gd_settowassist(FAR uint8_t *passistdata, uint16_t datasize);
|
||||
int fw_gd_settowassist(uint8_t *passistdata, uint16_t datasize);
|
||||
|
||||
/* AGPS Set UTC Model */
|
||||
|
||||
int fw_gd_setutcmodel(FAR uint8_t *pmodeldata, uint16_t datasize);
|
||||
int fw_gd_setutcmodel(uint8_t *pmodeldata, uint16_t datasize);
|
||||
|
||||
/* Read GNSS data to specified buffer */
|
||||
|
||||
int fw_gd_readbuffer(uint8_t type, int32_t offset, FAR void *buf,
|
||||
uint32_t length);
|
||||
int fw_gd_readbuffer(uint8_t type, int32_t offset, void *buf,
|
||||
uint32_t length);
|
||||
|
||||
/* Write GNSS data from specified buffer */
|
||||
|
||||
int fw_gd_writebuffer(uint8_t type, int32_t offset, FAR void *buf,
|
||||
uint32_t length);
|
||||
int fw_gd_writebuffer(uint8_t type, int32_t offset, void *buf,
|
||||
uint32_t length);
|
||||
|
||||
/* Set notify mask, this mask flag is cleared when notified(poll/signal) */
|
||||
|
||||
|
|
@ -267,8 +267,8 @@ int fw_gd_geodeleteallregion(void);
|
|||
|
||||
/* Geofence Region check */
|
||||
|
||||
int fw_gd_geogetregiondata(uint8_t id, FAR long *lat, FAR long *lon,
|
||||
FAR uint16_t *rad);
|
||||
int fw_gd_geogetregiondata(uint8_t id, long *lat, long *lon,
|
||||
uint16_t *rad);
|
||||
|
||||
/* Geofence Get Used Region ID */
|
||||
|
||||
|
|
@ -304,11 +304,11 @@ int fw_gd_pvtlogdeletelog(void);
|
|||
|
||||
/* Pvtlog Get Log status */
|
||||
|
||||
int fw_gd_pvtloggetlogstatus(FAR struct cxd56_gnss_status_s *plogstatus);
|
||||
int fw_gd_pvtloggetlogstatus(struct cxd56_gnss_status_s *plogstatus);
|
||||
|
||||
/* Start outputting carrier phase info. */
|
||||
|
||||
int fw_gd_rtkstart(FAR struct cxd56_rtk_setting_s *pparam);
|
||||
int fw_gd_rtkstart(struct cxd56_rtk_setting_s *pparam);
|
||||
|
||||
/* Stop outputting carrier phase info. */
|
||||
|
||||
|
|
@ -323,7 +323,7 @@ int fw_gd_rtksetoutputinterval(int interval);
|
|||
|
||||
/* Get output interval of carrier phase info. [ms] */
|
||||
|
||||
int fw_gd_rtkgetoutputinterval(FAR int *interval);
|
||||
int fw_gd_rtkgetoutputinterval(int *interval);
|
||||
|
||||
/* Set GNSS of outputting carrier phase info. */
|
||||
|
||||
|
|
@ -331,7 +331,7 @@ int fw_gd_rtksetgnss(uint32_t gnss);
|
|||
|
||||
/* Get GNSS of outputting carrier phase info. */
|
||||
|
||||
int fw_gd_rtkgetgnss(FAR uint32_t *pgnss);
|
||||
int fw_gd_rtkgetgnss(uint32_t *pgnss);
|
||||
|
||||
/* Set enable/disable GD to notify updating ephemeris */
|
||||
|
||||
|
|
@ -339,7 +339,7 @@ int fw_gd_rtksetephnotify(int enable);
|
|||
|
||||
/* Get enable/disable GD to notify updating ephemeris */
|
||||
|
||||
int fw_gd_rtkgetephnotify(FAR int *enable);
|
||||
int fw_gd_rtkgetephnotify(int *enable);
|
||||
|
||||
/* Set the Ephemeris data Ephemeris data size is variable. */
|
||||
|
||||
|
|
@ -348,7 +348,7 @@ int fw_gd_setvarephemeris(uint32_t *ephemeris, uint32_t ephemerissize);
|
|||
/* Get the Ephemeris data Ephemeris data size is variable. */
|
||||
|
||||
int fw_gd_getvarephemeris(uint32_t satellite, uint32_t *ephemeris,
|
||||
uint32_t ephemerissize);
|
||||
uint32_t ephemerissize);
|
||||
|
||||
/* Set usecase mode */
|
||||
|
||||
|
|
|
|||
|
|
@ -332,7 +332,7 @@ static bool enabled_irq(int irq)
|
|||
return ((val & (1 << (irq - CXD56_IRQ_EXTINT))) != 0);
|
||||
}
|
||||
|
||||
static int gpioint_handler(int irq, FAR void *context, FAR void *arg)
|
||||
static int gpioint_handler(int irq, void *context, void *arg)
|
||||
{
|
||||
uint32_t val;
|
||||
uint32_t shift;
|
||||
|
|
@ -404,7 +404,7 @@ static int gpioint_handler(int irq, FAR void *context, FAR void *arg)
|
|||
****************************************************************************/
|
||||
|
||||
int cxd56_gpioint_config(uint32_t pin, uint32_t gpiocfg, xcpt_t isr,
|
||||
FAR void *arg)
|
||||
void *arg)
|
||||
{
|
||||
int slot;
|
||||
int irq;
|
||||
|
|
|
|||
|
|
@ -129,7 +129,7 @@ extern "C"
|
|||
****************************************************************************/
|
||||
|
||||
int cxd56_gpioint_config(uint32_t pin, uint32_t gpiocfg, xcpt_t isr,
|
||||
FAR void *arg);
|
||||
void *arg);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: cxd56_gpioint_irq
|
||||
|
|
|
|||
|
|
@ -109,19 +109,19 @@ struct cxd56_hifdrv_s
|
|||
|
||||
/* Character driver methods */
|
||||
|
||||
static int hif_open(FAR struct file *filep);
|
||||
static int hif_close(FAR struct file *filep);
|
||||
static off_t hif_seek(FAR struct file *filep, off_t offset,
|
||||
static int hif_open(struct file *filep);
|
||||
static int hif_close(struct file *filep);
|
||||
static off_t hif_seek(struct file *filep, off_t offset,
|
||||
int whence);
|
||||
static ssize_t hif_read(FAR struct file *filep, FAR char *buffer,
|
||||
static ssize_t hif_read(struct file *filep, char *buffer,
|
||||
size_t len);
|
||||
static ssize_t hif_write(FAR struct file *filep,
|
||||
FAR const char *buffer, size_t len);
|
||||
static int hif_ioctl(FAR struct file *filep, int cmd,
|
||||
static ssize_t hif_write(struct file *filep,
|
||||
const char *buffer, size_t len);
|
||||
static int hif_ioctl(struct file *filep, int cmd,
|
||||
unsigned long arg);
|
||||
static int hif_poll(FAR struct file *filep, FAR struct pollfd *fds,
|
||||
static int hif_poll(struct file *filep, struct pollfd *fds,
|
||||
bool setup);
|
||||
static int hif_unlink(FAR struct inode *inode);
|
||||
static int hif_unlink(struct inode *inode);
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
|
|
@ -187,15 +187,15 @@ static int hif_sendmsg(uint8_t id, void *arg)
|
|||
return ret;
|
||||
}
|
||||
|
||||
static int hif_open(FAR struct file *filep)
|
||||
static int hif_open(struct file *filep)
|
||||
{
|
||||
FAR struct inode *inode;
|
||||
FAR struct cxd56_hifdev_s *priv;
|
||||
struct inode *inode;
|
||||
struct cxd56_hifdev_s *priv;
|
||||
|
||||
DEBUGASSERT(filep && filep->f_inode);
|
||||
inode = filep->f_inode;
|
||||
|
||||
priv = (FAR struct cxd56_hifdev_s *)inode->i_private;
|
||||
priv = (struct cxd56_hifdev_s *)inode->i_private;
|
||||
DEBUGASSERT(priv);
|
||||
|
||||
/* Check parameters */
|
||||
|
|
@ -243,15 +243,15 @@ static int hif_open(FAR struct file *filep)
|
|||
return OK;
|
||||
}
|
||||
|
||||
static int hif_close(FAR struct file *filep)
|
||||
static int hif_close(struct file *filep)
|
||||
{
|
||||
FAR struct inode *inode;
|
||||
FAR struct cxd56_hifdev_s *priv;
|
||||
struct inode *inode;
|
||||
struct cxd56_hifdev_s *priv;
|
||||
|
||||
DEBUGASSERT(filep && filep->f_inode);
|
||||
inode = filep->f_inode;
|
||||
|
||||
priv = (FAR struct cxd56_hifdev_s *)inode->i_private;
|
||||
priv = (struct cxd56_hifdev_s *)inode->i_private;
|
||||
DEBUGASSERT(priv);
|
||||
|
||||
/* Decrement reference counter */
|
||||
|
|
@ -266,21 +266,21 @@ static int hif_close(FAR struct file *filep)
|
|||
return OK;
|
||||
}
|
||||
|
||||
static off_t hif_seek(FAR struct file *filep, off_t offset, int whence)
|
||||
static off_t hif_seek(struct file *filep, off_t offset, int whence)
|
||||
{
|
||||
return OK;
|
||||
}
|
||||
|
||||
static ssize_t hif_read(FAR struct file *filep, FAR char *buffer, size_t len)
|
||||
static ssize_t hif_read(struct file *filep, char *buffer, size_t len)
|
||||
{
|
||||
FAR struct inode *inode;
|
||||
FAR struct cxd56_hifdev_s *priv;
|
||||
struct inode *inode;
|
||||
struct cxd56_hifdev_s *priv;
|
||||
int ret;
|
||||
|
||||
DEBUGASSERT(filep && filep->f_inode);
|
||||
inode = filep->f_inode;
|
||||
|
||||
priv = (FAR struct cxd56_hifdev_s *)inode->i_private;
|
||||
priv = (struct cxd56_hifdev_s *)inode->i_private;
|
||||
DEBUGASSERT(priv);
|
||||
|
||||
/* Check parameters */
|
||||
|
|
@ -302,17 +302,17 @@ static ssize_t hif_read(FAR struct file *filep, FAR char *buffer, size_t len)
|
|||
return ret;
|
||||
}
|
||||
|
||||
static ssize_t hif_write(FAR struct file *filep,
|
||||
FAR const char *buffer, size_t len)
|
||||
static ssize_t hif_write(struct file *filep,
|
||||
const char *buffer, size_t len)
|
||||
{
|
||||
FAR struct inode *inode;
|
||||
FAR struct cxd56_hifdev_s *priv;
|
||||
struct inode *inode;
|
||||
struct cxd56_hifdev_s *priv;
|
||||
int ret;
|
||||
|
||||
DEBUGASSERT(filep && filep->f_inode);
|
||||
inode = filep->f_inode;
|
||||
|
||||
priv = (FAR struct cxd56_hifdev_s *)inode->i_private;
|
||||
priv = (struct cxd56_hifdev_s *)inode->i_private;
|
||||
DEBUGASSERT(priv);
|
||||
|
||||
/* Check parameters */
|
||||
|
|
@ -334,19 +334,19 @@ static ssize_t hif_write(FAR struct file *filep,
|
|||
return ret;
|
||||
}
|
||||
|
||||
static int hif_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
|
||||
static int hif_ioctl(struct file *filep, int cmd, unsigned long arg)
|
||||
{
|
||||
return OK;
|
||||
}
|
||||
|
||||
static int hif_poll(FAR struct file *filep,
|
||||
FAR struct pollfd *fds, bool setup)
|
||||
static int hif_poll(struct file *filep,
|
||||
struct pollfd *fds, bool setup)
|
||||
{
|
||||
return OK;
|
||||
}
|
||||
|
||||
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
|
||||
static int hif_unlink(FAR struct inode *inode)
|
||||
static int hif_unlink(struct inode *inode)
|
||||
{
|
||||
return OK;
|
||||
}
|
||||
|
|
@ -354,7 +354,7 @@ static int hif_unlink(FAR struct inode *inode)
|
|||
|
||||
static int hif_rxhandler(int cpuid, int protoid,
|
||||
uint32_t pdata, uint32_t data,
|
||||
FAR void *userdata)
|
||||
void *userdata)
|
||||
{
|
||||
struct cxd56_hifdrv_s *drv = &g_hifdrv;
|
||||
|
||||
|
|
|
|||
|
|
@ -129,8 +129,8 @@ static struct cxd56_i2cdev_s g_i2c2dev =
|
|||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
static inline int i2c_takesem(FAR sem_t *sem);
|
||||
static inline int i2c_givesem(FAR sem_t *sem);
|
||||
static inline int i2c_takesem(sem_t *sem);
|
||||
static inline int i2c_givesem(sem_t *sem);
|
||||
|
||||
static inline uint32_t i2c_reg_read(struct cxd56_i2cdev_s *priv,
|
||||
uint32_t offset);
|
||||
|
|
@ -144,25 +144,25 @@ static inline void i2c_reg_rmw(struct cxd56_i2cdev_s *dev,
|
|||
static int cxd56_i2c_disable(struct cxd56_i2cdev_s *priv);
|
||||
static void cxd56_i2c_enable(struct cxd56_i2cdev_s *priv);
|
||||
|
||||
static int cxd56_i2c_interrupt(int irq, FAR void *context, FAR void *arg);
|
||||
static int cxd56_i2c_interrupt(int irq, void *context, void *arg);
|
||||
static void cxd56_i2c_timeout(wdparm_t arg);
|
||||
static void cxd56_i2c_setfrequency(struct cxd56_i2cdev_s *priv,
|
||||
uint32_t frequency);
|
||||
static int cxd56_i2c_transfer(FAR struct i2c_master_s *dev,
|
||||
FAR struct i2c_msg_s *msgs, int count);
|
||||
static int cxd56_i2c_transfer(struct i2c_master_s *dev,
|
||||
struct i2c_msg_s *msgs, int count);
|
||||
#ifdef CONFIG_I2C_RESET
|
||||
static int cxd56_i2c_reset(FAR struct i2c_master_s *dev);
|
||||
static int cxd56_i2c_reset(struct i2c_master_s *dev);
|
||||
#endif
|
||||
#if defined(CONFIG_CXD56_I2C0_SCUSEQ) || defined(CONFIG_CXD56_I2C1_SCUSEQ)
|
||||
static int cxd56_i2c_transfer_scu(FAR struct i2c_master_s *dev,
|
||||
FAR struct i2c_msg_s *msgs, int count);
|
||||
static int cxd56_i2c_transfer_scu(struct i2c_master_s *dev,
|
||||
struct i2c_msg_s *msgs, int count);
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Name: i2c_takesem
|
||||
****************************************************************************/
|
||||
|
||||
static inline int i2c_takesem(FAR sem_t *sem)
|
||||
static inline int i2c_takesem(sem_t *sem)
|
||||
{
|
||||
return nxsem_wait_uninterruptible(sem);
|
||||
}
|
||||
|
|
@ -171,7 +171,7 @@ static inline int i2c_takesem(FAR sem_t *sem)
|
|||
* Name: i2c_givesem
|
||||
****************************************************************************/
|
||||
|
||||
static inline int i2c_givesem(FAR sem_t *sem)
|
||||
static inline int i2c_givesem(sem_t *sem)
|
||||
{
|
||||
return nxsem_post(sem);
|
||||
}
|
||||
|
|
@ -413,9 +413,9 @@ static void cxd56_i2c_drainrxfifo(struct cxd56_i2cdev_s *priv)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int cxd56_i2c_interrupt(int irq, FAR void *context, FAR void *arg)
|
||||
static int cxd56_i2c_interrupt(int irq, void *context, void *arg)
|
||||
{
|
||||
FAR struct cxd56_i2cdev_s *priv = (FAR struct cxd56_i2cdev_s *)arg;
|
||||
struct cxd56_i2cdev_s *priv = (struct cxd56_i2cdev_s *)arg;
|
||||
uint32_t state;
|
||||
int ret;
|
||||
|
||||
|
|
@ -604,8 +604,8 @@ static int cxd56_i2c_send(struct cxd56_i2cdev_s *priv, int last)
|
|||
* currently guaranteed.
|
||||
****************************************************************************/
|
||||
|
||||
static int cxd56_i2c_transfer(FAR struct i2c_master_s *dev,
|
||||
FAR struct i2c_msg_s *msgs, int count)
|
||||
static int cxd56_i2c_transfer(struct i2c_master_s *dev,
|
||||
struct i2c_msg_s *msgs, int count)
|
||||
{
|
||||
struct cxd56_i2cdev_s *priv = (struct cxd56_i2cdev_s *)dev;
|
||||
int i;
|
||||
|
|
@ -716,7 +716,7 @@ static int cxd56_i2c_transfer(FAR struct i2c_master_s *dev,
|
|||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_I2C_RESET
|
||||
static int cxd56_i2c_reset(FAR struct i2c_master_s *dev)
|
||||
static int cxd56_i2c_reset(struct i2c_master_s *dev)
|
||||
{
|
||||
return OK;
|
||||
}
|
||||
|
|
@ -821,10 +821,10 @@ static int cxd56_i2c_scusend(int port, int addr,
|
|||
return ret;
|
||||
}
|
||||
|
||||
static int cxd56_i2c_transfer_scu(FAR struct i2c_master_s *dev,
|
||||
FAR struct i2c_msg_s *msgs, int count)
|
||||
static int cxd56_i2c_transfer_scu(struct i2c_master_s *dev,
|
||||
struct i2c_msg_s *msgs, int count)
|
||||
{
|
||||
FAR struct cxd56_i2cdev_s *priv = (FAR struct cxd56_i2cdev_s *)dev;
|
||||
struct cxd56_i2cdev_s *priv = (struct cxd56_i2cdev_s *)dev;
|
||||
ssize_t len = 0;
|
||||
uint8_t *buf = NULL;
|
||||
uint8_t addr = msgs->addr;
|
||||
|
|
@ -1069,7 +1069,7 @@ struct i2c_master_s *cxd56_i2cbus_initialize(int port)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
int cxd56_i2cbus_uninitialize(FAR struct i2c_master_s *dev)
|
||||
int cxd56_i2cbus_uninitialize(struct i2c_master_s *dev)
|
||||
{
|
||||
struct cxd56_i2cdev_s *priv = (struct cxd56_i2cdev_s *)dev;
|
||||
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ extern "C"
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
FAR struct i2c_master_s *cxd56_i2cbus_initialize(int port);
|
||||
struct i2c_master_s *cxd56_i2cbus_initialize(int port);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: cxd56_i2cbus_uninitialize
|
||||
|
|
@ -76,7 +76,7 @@ FAR struct i2c_master_s *cxd56_i2cbus_initialize(int port);
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
int cxd56_i2cbus_uninitialize(FAR struct i2c_master_s *dev);
|
||||
int cxd56_i2cbus_uninitialize(struct i2c_master_s *dev);
|
||||
|
||||
#undef EXTERN
|
||||
#if defined(__cplusplus)
|
||||
|
|
|
|||
|
|
@ -47,15 +47,15 @@ struct cxd56_i2c_bitbang_dev_s
|
|||
* Private Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
static void i2c_bb_initialize(FAR struct i2c_bitbang_lower_dev_s *lower);
|
||||
static void i2c_bb_initialize(struct i2c_bitbang_lower_dev_s *lower);
|
||||
|
||||
static void i2c_bb_set_scl(FAR struct i2c_bitbang_lower_dev_s *lower,
|
||||
static void i2c_bb_set_scl(struct i2c_bitbang_lower_dev_s *lower,
|
||||
bool high);
|
||||
static void i2c_bb_set_sda(FAR struct i2c_bitbang_lower_dev_s *lower,
|
||||
static void i2c_bb_set_sda(struct i2c_bitbang_lower_dev_s *lower,
|
||||
bool high);
|
||||
|
||||
static bool i2c_bb_get_scl(FAR struct i2c_bitbang_lower_dev_s *lower);
|
||||
static bool i2c_bb_get_sda(FAR struct i2c_bitbang_lower_dev_s *lower);
|
||||
static bool i2c_bb_get_scl(struct i2c_bitbang_lower_dev_s *lower);
|
||||
static bool i2c_bb_get_sda(struct i2c_bitbang_lower_dev_s *lower);
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
|
|
@ -74,7 +74,7 @@ const static struct i2c_bitbang_lower_ops_s g_ops =
|
|||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
static void i2c_bb_initialize(FAR struct i2c_bitbang_lower_dev_s *lower)
|
||||
static void i2c_bb_initialize(struct i2c_bitbang_lower_dev_s *lower)
|
||||
{
|
||||
struct cxd56_i2c_bitbang_dev_s *dev = lower->priv;
|
||||
|
||||
|
|
@ -84,7 +84,7 @@ static void i2c_bb_initialize(FAR struct i2c_bitbang_lower_dev_s *lower)
|
|||
board_gpio_config(dev->sda_pin, 0, true, true, PIN_PULLUP);
|
||||
}
|
||||
|
||||
static void i2c_bb_set_scl(FAR struct i2c_bitbang_lower_dev_s *lower,
|
||||
static void i2c_bb_set_scl(struct i2c_bitbang_lower_dev_s *lower,
|
||||
bool high)
|
||||
{
|
||||
struct cxd56_i2c_bitbang_dev_s *dev = lower->priv;
|
||||
|
|
@ -96,7 +96,7 @@ static void i2c_bb_set_scl(FAR struct i2c_bitbang_lower_dev_s *lower,
|
|||
board_gpio_write(dev->scl_pin, value);
|
||||
}
|
||||
|
||||
static void i2c_bb_set_sda(FAR struct i2c_bitbang_lower_dev_s *lower,
|
||||
static void i2c_bb_set_sda(struct i2c_bitbang_lower_dev_s *lower,
|
||||
bool high)
|
||||
{
|
||||
struct cxd56_i2c_bitbang_dev_s *dev = lower->priv;
|
||||
|
|
@ -108,14 +108,14 @@ static void i2c_bb_set_sda(FAR struct i2c_bitbang_lower_dev_s *lower,
|
|||
board_gpio_write(dev->sda_pin, value);
|
||||
}
|
||||
|
||||
static bool i2c_bb_get_scl(FAR struct i2c_bitbang_lower_dev_s *lower)
|
||||
static bool i2c_bb_get_scl(struct i2c_bitbang_lower_dev_s *lower)
|
||||
{
|
||||
struct cxd56_i2c_bitbang_dev_s *dev = lower->priv;
|
||||
|
||||
return board_gpio_read(dev->scl_pin);
|
||||
}
|
||||
|
||||
static bool i2c_bb_get_sda(FAR struct i2c_bitbang_lower_dev_s *lower)
|
||||
static bool i2c_bb_get_sda(struct i2c_bitbang_lower_dev_s *lower)
|
||||
{
|
||||
struct cxd56_i2c_bitbang_dev_s *dev = lower->priv;
|
||||
|
||||
|
|
|
|||
|
|
@ -107,7 +107,7 @@ struct iccdev_s
|
|||
cxd56_iccsighandler_t sighandler;
|
||||
} u;
|
||||
|
||||
FAR void *userdata;
|
||||
void *userdata;
|
||||
sem_t rxwait;
|
||||
struct wdog_s rxtimeout;
|
||||
|
||||
|
|
@ -117,7 +117,7 @@ struct iccdev_s
|
|||
|
||||
int signo;
|
||||
pid_t pid;
|
||||
FAR void *sigdata;
|
||||
void *sigdata;
|
||||
|
||||
struct sq_queue_s recvq;
|
||||
struct sq_queue_s freelist;
|
||||
|
|
@ -129,9 +129,9 @@ struct iccdev_s
|
|||
****************************************************************************/
|
||||
|
||||
static int icc_sighandler(int cpuid, int protoid, uint32_t pdata,
|
||||
uint32_t data, FAR void *userdata);
|
||||
uint32_t data, void *userdata);
|
||||
static int icc_msghandler(int cpuid, int protoid, uint32_t pdata,
|
||||
uint32_t data, FAR void *userdata);
|
||||
uint32_t data, void *userdata);
|
||||
static int icc_irqhandler(int cpuid, uint32_t word[2]);
|
||||
|
||||
/****************************************************************************
|
||||
|
|
@ -160,7 +160,7 @@ static void icc_semgive(sem_t *semid)
|
|||
nxsem_post(semid);
|
||||
}
|
||||
|
||||
static FAR struct iccdev_s *icc_getprotocol(int protoid)
|
||||
static struct iccdev_s *icc_getprotocol(int protoid)
|
||||
{
|
||||
if (protoid < 0 || protoid >= NPROTOCOLS)
|
||||
{
|
||||
|
|
@ -170,7 +170,7 @@ static FAR struct iccdev_s *icc_getprotocol(int protoid)
|
|||
return g_protocol[protoid];
|
||||
}
|
||||
|
||||
static FAR struct iccdev_s *icc_getcpu(int cpuid)
|
||||
static struct iccdev_s *icc_getcpu(int cpuid)
|
||||
{
|
||||
if (cpuid < 0 || cpuid >= NCPUS)
|
||||
{
|
||||
|
|
@ -182,8 +182,8 @@ static FAR struct iccdev_s *icc_getcpu(int cpuid)
|
|||
|
||||
static int icc_irqhandler(int cpuid, uint32_t word[2])
|
||||
{
|
||||
FAR struct iccdev_s *priv;
|
||||
FAR struct iccreq_s *req;
|
||||
struct iccdev_s *priv;
|
||||
struct iccreq_s *req;
|
||||
int protoid;
|
||||
|
||||
protoid = GET_PROTOCOLID(word);
|
||||
|
|
@ -222,7 +222,7 @@ static int icc_irqhandler(int cpuid, uint32_t word[2])
|
|||
}
|
||||
}
|
||||
|
||||
req = (FAR struct iccreq_s *)sq_remfirst(&priv->freelist);
|
||||
req = (struct iccreq_s *)sq_remfirst(&priv->freelist);
|
||||
if (!req)
|
||||
{
|
||||
iccerr("Receive buffer is full.\n");
|
||||
|
|
@ -232,7 +232,7 @@ static int icc_irqhandler(int cpuid, uint32_t word[2])
|
|||
req->word[0] = word[0];
|
||||
req->word[1] = word[1];
|
||||
|
||||
sq_addlast((FAR sq_entry_t *)req, &priv->recvq);
|
||||
sq_addlast((sq_entry_t *)req, &priv->recvq);
|
||||
|
||||
icc_semgive(&priv->rxwait);
|
||||
|
||||
|
|
@ -252,9 +252,9 @@ static int icc_irqhandler(int cpuid, uint32_t word[2])
|
|||
}
|
||||
|
||||
static int icc_sighandler(int cpuid, int protoid, uint32_t pdata,
|
||||
uint32_t data, FAR void *userdata)
|
||||
uint32_t data, void *userdata)
|
||||
{
|
||||
FAR struct iccdev_s *priv = icc_getcpu(cpuid);
|
||||
struct iccdev_s *priv = icc_getcpu(cpuid);
|
||||
|
||||
if (!priv)
|
||||
{
|
||||
|
|
@ -282,7 +282,7 @@ static int icc_sighandler(int cpuid, int protoid, uint32_t pdata,
|
|||
}
|
||||
|
||||
static int icc_msghandler(int cpuid, int protoid, uint32_t pdata,
|
||||
uint32_t data, FAR void *userdata)
|
||||
uint32_t data, void *userdata)
|
||||
{
|
||||
/* Do nothing. This handler used for reserve MSG protocol handler.
|
||||
* This handler returns -1 to indicate not consumed the passed
|
||||
|
|
@ -294,13 +294,13 @@ static int icc_msghandler(int cpuid, int protoid, uint32_t pdata,
|
|||
|
||||
static void icc_rxtimeout(wdparm_t arg)
|
||||
{
|
||||
FAR struct iccdev_s *priv = (FAR struct iccdev_s *)arg;
|
||||
struct iccdev_s *priv = (struct iccdev_s *)arg;
|
||||
icc_semgive(&priv->rxwait);
|
||||
}
|
||||
|
||||
static int icc_recv(FAR struct iccdev_s *priv, FAR iccmsg_t *msg, int32_t ms)
|
||||
static int icc_recv(struct iccdev_s *priv, iccmsg_t *msg, int32_t ms)
|
||||
{
|
||||
FAR struct iccreq_s *req;
|
||||
struct iccreq_s *req;
|
||||
irqstate_t flags;
|
||||
int ret = OK;
|
||||
|
||||
|
|
@ -330,7 +330,7 @@ static int icc_recv(FAR struct iccdev_s *priv, FAR iccmsg_t *msg, int32_t ms)
|
|||
}
|
||||
|
||||
flags = enter_critical_section();
|
||||
req = (FAR struct iccreq_s *)sq_remfirst(&priv->recvq);
|
||||
req = (struct iccreq_s *)sq_remfirst(&priv->recvq);
|
||||
|
||||
if (req)
|
||||
{
|
||||
|
|
@ -338,7 +338,7 @@ static int icc_recv(FAR struct iccdev_s *priv, FAR iccmsg_t *msg, int32_t ms)
|
|||
msg->data = req->msg.data;
|
||||
msg->cpuid = req->msg.cpuid;
|
||||
msg->protodata = req->msg.pdata;
|
||||
sq_addlast((FAR sq_entry_t *)req, &priv->freelist);
|
||||
sq_addlast((sq_entry_t *)req, &priv->freelist);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -350,9 +350,9 @@ static int icc_recv(FAR struct iccdev_s *priv, FAR iccmsg_t *msg, int32_t ms)
|
|||
return ret;
|
||||
}
|
||||
|
||||
static FAR struct iccdev_s *icc_devnew(void)
|
||||
static struct iccdev_s *icc_devnew(void)
|
||||
{
|
||||
FAR struct iccdev_s *priv;
|
||||
struct iccdev_s *priv;
|
||||
int i;
|
||||
|
||||
priv = (struct iccdev_s *)kmm_malloc(sizeof(struct iccdev_s));
|
||||
|
|
@ -373,7 +373,7 @@ static FAR struct iccdev_s *icc_devnew(void)
|
|||
|
||||
for (i = 0; i < NBUFFERS; i++)
|
||||
{
|
||||
sq_addlast((FAR sq_entry_t *)&priv->pool[i], &priv->freelist);
|
||||
sq_addlast((sq_entry_t *)&priv->pool[i], &priv->freelist);
|
||||
}
|
||||
|
||||
priv->pid = INVALID_PROCESS_ID;
|
||||
|
|
@ -381,7 +381,7 @@ static FAR struct iccdev_s *icc_devnew(void)
|
|||
return priv;
|
||||
}
|
||||
|
||||
static void icc_devfree(FAR struct iccdev_s *priv)
|
||||
static void icc_devfree(struct iccdev_s *priv)
|
||||
{
|
||||
wd_cancel(&priv->rxtimeout);
|
||||
kmm_free(priv);
|
||||
|
|
@ -392,9 +392,9 @@ static void icc_devfree(FAR struct iccdev_s *priv)
|
|||
****************************************************************************/
|
||||
|
||||
int cxd56_iccregisterhandler(int protoid, cxd56_icchandler_t handler,
|
||||
FAR void *data)
|
||||
void *data)
|
||||
{
|
||||
FAR struct iccdev_s *priv;
|
||||
struct iccdev_s *priv;
|
||||
irqstate_t flags;
|
||||
int ret = OK;
|
||||
|
||||
|
|
@ -416,9 +416,9 @@ int cxd56_iccregisterhandler(int protoid, cxd56_icchandler_t handler,
|
|||
}
|
||||
|
||||
int cxd56_iccregistersighandler(int cpuid, cxd56_iccsighandler_t handler,
|
||||
FAR void *data)
|
||||
void *data)
|
||||
{
|
||||
FAR struct iccdev_s *priv;
|
||||
struct iccdev_s *priv;
|
||||
irqstate_t flags;
|
||||
int ret = OK;
|
||||
|
||||
|
|
@ -439,9 +439,9 @@ int cxd56_iccregistersighandler(int cpuid, cxd56_iccsighandler_t handler,
|
|||
return ret;
|
||||
}
|
||||
|
||||
int cxd56_iccsend(int protoid, FAR iccmsg_t *msg, int32_t ms)
|
||||
int cxd56_iccsend(int protoid, iccmsg_t *msg, int32_t ms)
|
||||
{
|
||||
FAR struct iccdev_s *priv;
|
||||
struct iccdev_s *priv;
|
||||
struct iccreq_s req;
|
||||
|
||||
if (!msg)
|
||||
|
|
@ -466,14 +466,14 @@ int cxd56_iccsend(int protoid, FAR iccmsg_t *msg, int32_t ms)
|
|||
return cxd56_cfpush(req.word);
|
||||
}
|
||||
|
||||
int cxd56_iccsendmsg(FAR iccmsg_t *msg, int32_t ms)
|
||||
int cxd56_iccsendmsg(iccmsg_t *msg, int32_t ms)
|
||||
{
|
||||
return cxd56_iccsend(CXD56_PROTO_MSG, msg, ms);
|
||||
}
|
||||
|
||||
int cxd56_iccrecv(int protoid, FAR iccmsg_t *msg, int32_t ms)
|
||||
int cxd56_iccrecv(int protoid, iccmsg_t *msg, int32_t ms)
|
||||
{
|
||||
FAR struct iccdev_s *priv;
|
||||
struct iccdev_s *priv;
|
||||
|
||||
if (!msg)
|
||||
{
|
||||
|
|
@ -489,9 +489,9 @@ int cxd56_iccrecv(int protoid, FAR iccmsg_t *msg, int32_t ms)
|
|||
return icc_recv(priv, msg, ms);
|
||||
}
|
||||
|
||||
int cxd56_iccrecvmsg(FAR iccmsg_t *msg, int32_t ms)
|
||||
int cxd56_iccrecvmsg(iccmsg_t *msg, int32_t ms)
|
||||
{
|
||||
FAR struct iccdev_s *priv;
|
||||
struct iccdev_s *priv;
|
||||
|
||||
if (!msg)
|
||||
{
|
||||
|
|
@ -526,9 +526,9 @@ int cxd56_iccsignal(int8_t cpuid, int8_t signo, int16_t sigdata,
|
|||
return cxd56_cfpush(req.word);
|
||||
}
|
||||
|
||||
int cxd56_iccnotify(int cpuid, int signo, FAR void *sigdata)
|
||||
int cxd56_iccnotify(int cpuid, int signo, void *sigdata)
|
||||
{
|
||||
FAR struct iccdev_s *priv;
|
||||
struct iccdev_s *priv;
|
||||
|
||||
priv = icc_getcpu(cpuid);
|
||||
if (!priv)
|
||||
|
|
@ -545,7 +545,7 @@ int cxd56_iccnotify(int cpuid, int signo, FAR void *sigdata)
|
|||
|
||||
int cxd56_iccinit(int protoid)
|
||||
{
|
||||
FAR struct iccdev_s *priv;
|
||||
struct iccdev_s *priv;
|
||||
|
||||
if (protoid < 0 || protoid >= NPROTOCOLS)
|
||||
{
|
||||
|
|
@ -570,7 +570,7 @@ int cxd56_iccinit(int protoid)
|
|||
|
||||
int cxd56_iccinitmsg(int cpuid)
|
||||
{
|
||||
FAR struct iccdev_s *priv;
|
||||
struct iccdev_s *priv;
|
||||
|
||||
if (cpuid < 0 || cpuid >= NCPUS)
|
||||
{
|
||||
|
|
@ -595,7 +595,7 @@ int cxd56_iccinitmsg(int cpuid)
|
|||
|
||||
void cxd56_iccuninit(int protoid)
|
||||
{
|
||||
FAR struct iccdev_s *priv;
|
||||
struct iccdev_s *priv;
|
||||
irqstate_t flags;
|
||||
|
||||
if (protoid < 0 || protoid >= NPROTOCOLS)
|
||||
|
|
@ -616,7 +616,7 @@ void cxd56_iccuninit(int protoid)
|
|||
|
||||
void cxd56_iccuninitmsg(int cpuid)
|
||||
{
|
||||
FAR struct iccdev_s *priv;
|
||||
struct iccdev_s *priv;
|
||||
irqstate_t flags;
|
||||
|
||||
if (cpuid < 0 || cpuid >= NCPUS)
|
||||
|
|
|
|||
|
|
@ -38,9 +38,9 @@
|
|||
#define CXD56_PROTO_SIG 15 /* Inter-CPU Comm signal */
|
||||
|
||||
typedef int (*cxd56_icchandler_t)(int cpuid, int protoid, uint32_t pdata,
|
||||
uint32_t data, FAR void *userdata);
|
||||
uint32_t data, void *userdata);
|
||||
typedef int (*cxd56_iccsighandler_t)(int8_t signo, uint16_t sigdata,
|
||||
uint32_t data, FAR void *userdata);
|
||||
uint32_t data, void *userdata);
|
||||
|
||||
struct cxd56_iccmsg_s
|
||||
{
|
||||
|
|
@ -65,16 +65,16 @@ int cxd56_iccinitmsg(int cpuid);
|
|||
void cxd56_iccuninit(int protoid);
|
||||
void cxd56_iccuninitmsg(int cpuid);
|
||||
int cxd56_iccregisterhandler(int protoid, cxd56_icchandler_t handler,
|
||||
FAR void *data);
|
||||
void *data);
|
||||
int cxd56_iccregistersighandler(int cpuid, cxd56_iccsighandler_t handler,
|
||||
FAR void *data);
|
||||
int cxd56_iccsend(int protoid, FAR iccmsg_t *msg, int32_t ms);
|
||||
int cxd56_iccrecv(int protoid, FAR iccmsg_t *msg, int32_t ms);
|
||||
int cxd56_iccsendmsg(FAR iccmsg_t *msg, int32_t ms);
|
||||
int cxd56_iccrecvmsg(FAR iccmsg_t *msg, int32_t ms);
|
||||
void *data);
|
||||
int cxd56_iccsend(int protoid, iccmsg_t *msg, int32_t ms);
|
||||
int cxd56_iccrecv(int protoid, iccmsg_t *msg, int32_t ms);
|
||||
int cxd56_iccsendmsg(iccmsg_t *msg, int32_t ms);
|
||||
int cxd56_iccrecvmsg(iccmsg_t *msg, int32_t ms);
|
||||
int cxd56_iccsignal(int8_t cpuid, int8_t signo, int16_t sigdata,
|
||||
uint32_t data);
|
||||
int cxd56_iccnotify(int cpuid, int signo, FAR void *sigdata);
|
||||
int cxd56_iccnotify(int cpuid, int signo, void *sigdata);
|
||||
|
||||
void cxd56_iccinitialize(void);
|
||||
|
||||
|
|
|
|||
|
|
@ -184,7 +184,7 @@ static void cxd56_dumpnvic(const char *msg, int irq)
|
|||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_DEBUG_FEATURES
|
||||
static int cxd56_nmi(int irq, FAR void *context, FAR void *arg)
|
||||
static int cxd56_nmi(int irq, void *context, void *arg)
|
||||
{
|
||||
up_irq_save();
|
||||
_err("PANIC!!! NMI received\n");
|
||||
|
|
@ -192,7 +192,7 @@ static int cxd56_nmi(int irq, FAR void *context, FAR void *arg)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int cxd56_busfault(int irq, FAR void *context, FAR void *arg)
|
||||
static int cxd56_busfault(int irq, void *context, void *arg)
|
||||
{
|
||||
up_irq_save();
|
||||
_err("PANIC!!! Bus fault received\n");
|
||||
|
|
@ -200,7 +200,7 @@ static int cxd56_busfault(int irq, FAR void *context, FAR void *arg)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int cxd56_usagefault(int irq, FAR void *context, FAR void *arg)
|
||||
static int cxd56_usagefault(int irq, void *context, void *arg)
|
||||
{
|
||||
up_irq_save();
|
||||
_err("PANIC!!! Usage fault received\n");
|
||||
|
|
@ -208,7 +208,7 @@ static int cxd56_usagefault(int irq, FAR void *context, FAR void *arg)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int cxd56_pendsv(int irq, FAR void *context, FAR void *arg)
|
||||
static int cxd56_pendsv(int irq, void *context, void *arg)
|
||||
{
|
||||
up_irq_save();
|
||||
_err("PANIC!!! PendSV received\n");
|
||||
|
|
@ -216,7 +216,7 @@ static int cxd56_pendsv(int irq, FAR void *context, FAR void *arg)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int cxd56_dbgmonitor(int irq, FAR void *context, FAR void *arg)
|
||||
static int cxd56_dbgmonitor(int irq, void *context, void *arg)
|
||||
{
|
||||
up_irq_save();
|
||||
_err("PANIC!!! Debug Monitor received\n");
|
||||
|
|
@ -224,7 +224,7 @@ static int cxd56_dbgmonitor(int irq, FAR void *context, FAR void *arg)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int cxd56_reserved(int irq, FAR void *context, FAR void *arg)
|
||||
static int cxd56_reserved(int irq, void *context, void *arg)
|
||||
{
|
||||
up_irq_save();
|
||||
_err("PANIC!!! Reserved interrupt\n");
|
||||
|
|
|
|||
|
|
@ -768,7 +768,7 @@ error:
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
int cxd56_pmic_get_gauge(FAR struct pmic_gauge_s *gauge)
|
||||
int cxd56_pmic_get_gauge(struct pmic_gauge_s *gauge)
|
||||
{
|
||||
return fw_pm_pmiccontrol(PMIC_CMD_AFE, gauge);
|
||||
}
|
||||
|
|
@ -787,7 +787,7 @@ int cxd56_pmic_get_gauge(FAR struct pmic_gauge_s *gauge)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
int cxd56_pmic_getlowervol(FAR int *voltage)
|
||||
int cxd56_pmic_getlowervol(int *voltage)
|
||||
{
|
||||
return fw_pm_pmiccontrol(PMIC_CMD_GETVSYS, voltage);
|
||||
}
|
||||
|
|
@ -825,7 +825,7 @@ int cxd56_pmic_setlowervol(int voltage)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
int cxd56_pmic_getnotifyvol(FAR int *voltage)
|
||||
int cxd56_pmic_getnotifyvol(int *voltage)
|
||||
{
|
||||
return fw_pm_pmiccontrol(PMIC_CMD_GETPREVSYS, voltage);
|
||||
}
|
||||
|
|
@ -863,7 +863,7 @@ int cxd56_pmic_setnotifyvol(int voltage)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
int cxd56_pmic_getchargevol(FAR int *voltage)
|
||||
int cxd56_pmic_getchargevol(int *voltage)
|
||||
{
|
||||
int val;
|
||||
int ret;
|
||||
|
|
@ -942,7 +942,7 @@ int cxd56_pmic_setchargevol(int voltage)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
int cxd56_pmic_getchargecurrent(FAR int *current)
|
||||
int cxd56_pmic_getchargecurrent(int *current)
|
||||
{
|
||||
int val;
|
||||
int ret;
|
||||
|
|
@ -1032,7 +1032,7 @@ int cxd56_pmic_setchargecurrent(int current)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
int cxd56_pmic_getporttype(FAR int *porttype)
|
||||
int cxd56_pmic_getporttype(int *porttype)
|
||||
{
|
||||
return fw_pm_pmiccontrol(PMIC_CMD_GET_USB_PORT_TYPE, porttype);
|
||||
}
|
||||
|
|
@ -1134,7 +1134,7 @@ int cxd56_pmic_setrechargevol(int mv)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
int cxd56_pmic_getrechargevol(FAR int *mv)
|
||||
int cxd56_pmic_getrechargevol(int *mv)
|
||||
{
|
||||
int val;
|
||||
int ret;
|
||||
|
|
@ -1236,7 +1236,7 @@ int cxd56_pmic_setchargecompcurrent(int current)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
int cxd56_pmic_getchargecompcurrent(FAR int *current)
|
||||
int cxd56_pmic_getchargecompcurrent(int *current)
|
||||
{
|
||||
int val;
|
||||
int ret;
|
||||
|
|
@ -1295,7 +1295,7 @@ int cxd56_pmic_getchargecompcurrent(FAR int *current)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
int cxd56_pmic_gettemptable(FAR struct pmic_temp_table_s *table)
|
||||
int cxd56_pmic_gettemptable(struct pmic_temp_table_s *table)
|
||||
{
|
||||
/* SET_T60 (70h) - SET_T0_2 (78h) */
|
||||
|
||||
|
|
@ -1317,7 +1317,7 @@ int cxd56_pmic_gettemptable(FAR struct pmic_temp_table_s *table)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
int cxd56_pmic_settemptable(FAR struct pmic_temp_table_s *table)
|
||||
int cxd56_pmic_settemptable(struct pmic_temp_table_s *table)
|
||||
{
|
||||
return fw_pm_pmiccontrol(PMIC_CMD_SET_CHG_TEMPERATURE_TABLE, table);
|
||||
}
|
||||
|
|
@ -1394,7 +1394,7 @@ int cxd56_pmic_setchargemode(int low, int high)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
int cxd56_pmic_getchargemode(FAR int *low, FAR int *high)
|
||||
int cxd56_pmic_getchargemode(int *low, int *high)
|
||||
{
|
||||
struct pmic_temp_mode_s arg;
|
||||
int ret;
|
||||
|
|
@ -1416,22 +1416,22 @@ int cxd56_pmic_getchargemode(FAR int *low, FAR int *high)
|
|||
* Battery monitor for debug
|
||||
****************************************************************************/
|
||||
|
||||
int cxd56_pmic_monitor_enable(FAR struct pmic_mon_s *ptr)
|
||||
int cxd56_pmic_monitor_enable(struct pmic_mon_s *ptr)
|
||||
{
|
||||
return fw_pm_pmiccontrol(PMIC_CMD_POWER_MONITOR_ENABLE, ptr);
|
||||
}
|
||||
|
||||
int cxd56_pmic_monitor_status(FAR struct pmic_mon_status_s *ptr)
|
||||
int cxd56_pmic_monitor_status(struct pmic_mon_status_s *ptr)
|
||||
{
|
||||
return fw_pm_pmiccontrol(PMIC_CMD_POWER_MONITOR_STATUS, ptr);
|
||||
}
|
||||
|
||||
int cxd56_pmic_monitor_set(FAR struct pmic_mon_set_s *ptr)
|
||||
int cxd56_pmic_monitor_set(struct pmic_mon_set_s *ptr)
|
||||
{
|
||||
return fw_pm_pmiccontrol(PMIC_CMD_POWER_MONITOR_SET, ptr);
|
||||
}
|
||||
|
||||
int cxd56_pmic_monitor_get(FAR struct pmic_mon_log_s *ptr)
|
||||
int cxd56_pmic_monitor_get(struct pmic_mon_log_s *ptr)
|
||||
{
|
||||
return fw_pm_pmiccontrol(PMIC_CMD_POWER_MONITOR_GET, ptr);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -171,7 +171,7 @@ struct pmic_mon_rec_s
|
|||
|
||||
struct pmic_mon_log_s
|
||||
{
|
||||
FAR struct pmic_monitor_rec_s *rec;
|
||||
struct pmic_monitor_rec_s *rec;
|
||||
int index;
|
||||
int size;
|
||||
};
|
||||
|
|
@ -214,7 +214,7 @@ extern "C"
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
int cxd56_pmic_get_interrupt_status(FAR uint8_t *status);
|
||||
int cxd56_pmic_get_interrupt_status(uint8_t *status);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: cxd56_pmic_set_gpo_reg
|
||||
|
|
@ -242,8 +242,8 @@ int cxd56_pmic_get_interrupt_status(FAR uint8_t *status);
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
int cxd56_pmic_set_gpo_reg(FAR uint8_t *setbit0, FAR uint8_t *clrbit0,
|
||||
FAR uint8_t *setbit1, FAR uint8_t *clrbit1);
|
||||
int cxd56_pmic_set_gpo_reg(uint8_t *setbit0, uint8_t *clrbit0,
|
||||
uint8_t *setbit1, uint8_t *clrbit1);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: cxd56_pmic_set_gpo
|
||||
|
|
@ -333,7 +333,7 @@ int cxd56_pmic_get_gpo_hiz(uint8_t chset);
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
int cxd56_pmic_set_loadswitch_reg(FAR uint8_t *setbit, FAR uint8_t *clrbit);
|
||||
int cxd56_pmic_set_loadswitch_reg(uint8_t *setbit, uint8_t *clrbit);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: cxd56_pmic_set_loadswitch
|
||||
|
|
@ -393,7 +393,7 @@ bool cxd56_pmic_get_loadswitch(uint8_t chset);
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
int cxd56_pmic_set_ddc_ldo_reg(FAR uint8_t *setbit, FAR uint8_t *clrbit);
|
||||
int cxd56_pmic_set_ddc_ldo_reg(uint8_t *setbit, uint8_t *clrbit);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: cxd56_pmic_set_ddc_ldo
|
||||
|
|
@ -444,7 +444,7 @@ bool cxd56_pmic_get_ddc_ldo(uint8_t chset);
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
int cxd56_pmic_get_gauge(FAR struct pmic_gauge_s *gauge);
|
||||
int cxd56_pmic_get_gauge(struct pmic_gauge_s *gauge);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: cxd56_pmic_getlowervol
|
||||
|
|
@ -460,7 +460,7 @@ int cxd56_pmic_get_gauge(FAR struct pmic_gauge_s *gauge);
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
int cxd56_pmic_getlowervol(FAR int *voltage);
|
||||
int cxd56_pmic_getlowervol(int *voltage);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: cxd56_pmic_setlowervol
|
||||
|
|
@ -492,7 +492,7 @@ int cxd56_pmic_setlowervol(int voltage);
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
int cxd56_pmic_getnotifyvol(FAR int *voltage);
|
||||
int cxd56_pmic_getnotifyvol(int *voltage);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: cxd56_pmic_setnotifyvol
|
||||
|
|
@ -524,7 +524,7 @@ int cxd56_pmic_setnotifyvol(int voltage);
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
int cxd56_pmic_getchargevol(FAR int *voltage);
|
||||
int cxd56_pmic_getchargevol(int *voltage);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: cxd56_pmic_setchargevol
|
||||
|
|
@ -557,7 +557,7 @@ int cxd56_pmic_setchargevol(int voltage);
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
int cxd56_pmic_getchargecurrent(FAR int *current);
|
||||
int cxd56_pmic_getchargecurrent(int *current);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: cxd56_pmic_setchargecurrent
|
||||
|
|
@ -590,7 +590,7 @@ int cxd56_pmic_setchargecurrent(int current);
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
int cxd56_pmic_getporttype(FAR int *porttype);
|
||||
int cxd56_pmic_getporttype(int *porttype);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: cxd56_pmic_getchargestate
|
||||
|
|
@ -606,7 +606,7 @@ int cxd56_pmic_getporttype(FAR int *porttype);
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
int cxd56_pmic_getchargestate(FAR uint8_t *state);
|
||||
int cxd56_pmic_getchargestate(uint8_t *state);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: cxd56_pmic_setrechargevol
|
||||
|
|
@ -640,7 +640,7 @@ int cxd56_pmic_setrechargevol(int mv);
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
int cxd56_pmic_getrechargevol(FAR int *mv);
|
||||
int cxd56_pmic_getrechargevol(int *mv);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: cxd56_pmic_setchargecompcurrent
|
||||
|
|
@ -672,7 +672,7 @@ int cxd56_pmic_setchargecompcurrent(int current);
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
int cxd56_pmic_getchargecompcurrent(FAR int *current);
|
||||
int cxd56_pmic_getchargecompcurrent(int *current);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: cxd56_pmic_gettemptable
|
||||
|
|
@ -689,7 +689,7 @@ int cxd56_pmic_getchargecompcurrent(FAR int *current);
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
int cxd56_pmic_gettemptable(FAR struct pmic_temp_table_s *table);
|
||||
int cxd56_pmic_gettemptable(struct pmic_temp_table_s *table);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: cxd56_pmic_settemptable
|
||||
|
|
@ -706,7 +706,7 @@ int cxd56_pmic_gettemptable(FAR struct pmic_temp_table_s *table);
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
int cxd56_pmic_settemptable(FAR struct pmic_temp_table_s *table);
|
||||
int cxd56_pmic_settemptable(struct pmic_temp_table_s *table);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: cxd56_pmic_setchargemode
|
||||
|
|
@ -748,7 +748,7 @@ int cxd56_pmic_setchargemode(int low, int high);
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
int cxd56_pmic_getchargemode(FAR int *low, FAR int *high);
|
||||
int cxd56_pmic_getchargemode(int *low, int *high);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: cxd56_pmic_read
|
||||
|
|
@ -766,7 +766,7 @@ int cxd56_pmic_getchargemode(FAR int *low, FAR int *high);
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
int cxd56_pmic_read(uint8_t addr, FAR void *buf, uint32_t size);
|
||||
int cxd56_pmic_read(uint8_t addr, void *buf, uint32_t size);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: cxd56_pmic_write
|
||||
|
|
@ -784,17 +784,17 @@ int cxd56_pmic_read(uint8_t addr, FAR void *buf, uint32_t size);
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
int cxd56_pmic_write(uint8_t addr, FAR void *buf, uint32_t size);
|
||||
int cxd56_pmic_write(uint8_t addr, void *buf, uint32_t size);
|
||||
|
||||
/****************************************************************************
|
||||
* Battery monitor for debug
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_CXD56_PMIC_BATMONITOR
|
||||
int cxd56_pmic_monitor_enable(FAR struct pmic_mon_s *ptr);
|
||||
int cxd56_pmic_monitor_status(FAR struct pmic_mon_status_s *ptr);
|
||||
int cxd56_pmic_monitor_set(FAR struct pmic_mon_set_s *ptr);
|
||||
int cxd56_pmic_monitor_get(FAR struct pmic_mon_log_s *ptr);
|
||||
int cxd56_pmic_monitor_enable(struct pmic_mon_s *ptr);
|
||||
int cxd56_pmic_monitor_status(struct pmic_mon_status_s *ptr);
|
||||
int cxd56_pmic_monitor_set(struct pmic_mon_set_s *ptr);
|
||||
int cxd56_pmic_monitor_get(struct pmic_mon_log_s *ptr);
|
||||
#else
|
||||
#define cxd56_pmic_monitor_enable(ptr)
|
||||
#define cxd56_pmic_monitor_status(ptr)
|
||||
|
|
|
|||
|
|
@ -145,20 +145,20 @@ struct pm_cbentry_s
|
|||
****************************************************************************/
|
||||
|
||||
static int cxd56_pm_do_callback(uint8_t id,
|
||||
FAR struct cxd56_pm_target_id_s *table);
|
||||
struct cxd56_pm_target_id_s *table);
|
||||
static int cxd56_pm_needcallback(uint32_t target,
|
||||
FAR struct cxd56_pm_target_id_s *table);
|
||||
struct cxd56_pm_target_id_s *table);
|
||||
static void cxd56_pm_clkchange(struct cxd56_pm_message_s *message);
|
||||
static int cxd56_pm_semtake(FAR sem_t *id);
|
||||
static int cxd56_pm_semtake(sem_t *id);
|
||||
static void cxd56_pm_checkfreqlock(void);
|
||||
static int cxd56_pm_maintask(int argc, FAR char *argv[]);
|
||||
static int cxd56_pm_maintask(int argc, char *argv[]);
|
||||
#if defined(CONFIG_CXD56_HOT_SLEEP)
|
||||
static void cxd56_pm_do_hotsleep(uint32_t idletime);
|
||||
static void cxd56_pm_intc_suspend(void);
|
||||
static void cxd56_pm_intc_resume(void);
|
||||
#endif
|
||||
static int cxd56_pmmsghandler(int cpuid, int protoid, uint32_t pdata,
|
||||
uint32_t data, FAR void *userdata);
|
||||
uint32_t data, void *userdata);
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
|
|
@ -179,7 +179,7 @@ static int g_freqlock_flag;
|
|||
static struct pm_cpu_wakelock_s g_wlock =
|
||||
PM_CPUWAKELOCK_INIT(PM_CPUWAKELOCK_TAG('P', 'M', 0));
|
||||
|
||||
static int cxd56_pm_semtake(FAR sem_t *id)
|
||||
static int cxd56_pm_semtake(sem_t *id)
|
||||
{
|
||||
return nxsem_wait_uninterruptible(id);
|
||||
}
|
||||
|
|
@ -189,7 +189,7 @@ static int cxd56_pm_semtake(FAR sem_t *id)
|
|||
****************************************************************************/
|
||||
|
||||
static int cxd56_pm_needcallback(uint32_t target,
|
||||
FAR struct cxd56_pm_target_id_s *table)
|
||||
struct cxd56_pm_target_id_s *table)
|
||||
{
|
||||
uint32_t mask;
|
||||
|
||||
|
|
@ -234,14 +234,14 @@ static int cxd56_pmsendmsg(int mid, uint32_t data)
|
|||
static int cxd56_pm_do_callback(uint8_t id,
|
||||
struct cxd56_pm_target_id_s *targets)
|
||||
{
|
||||
FAR struct pm_cbentry_s *entry;
|
||||
FAR dq_entry_t *cur;
|
||||
FAR dq_entry_t *last;
|
||||
struct pm_cbentry_s *entry;
|
||||
dq_entry_t *cur;
|
||||
dq_entry_t *last;
|
||||
int ret = 0;
|
||||
|
||||
for (cur = dq_peek(&g_cbqueue); cur; cur = dq_next(cur))
|
||||
{
|
||||
entry = (FAR struct pm_cbentry_s *)cur;
|
||||
entry = (struct pm_cbentry_s *)cur;
|
||||
last = cur;
|
||||
if (cxd56_pm_needcallback(entry->target, targets))
|
||||
{
|
||||
|
|
@ -273,7 +273,7 @@ static int cxd56_pm_do_callback(uint8_t id,
|
|||
|
||||
for (cur = dq_peek(&g_cbqueue); cur != last; cur = dq_next(cur))
|
||||
{
|
||||
entry = (FAR struct pm_cbentry_s *)cur;
|
||||
entry = (struct pm_cbentry_s *)cur;
|
||||
if (cxd56_pm_needcallback(entry->target, targets))
|
||||
{
|
||||
entry->callback(id);
|
||||
|
|
@ -322,13 +322,13 @@ static void cxd56_pm_clkchange(struct cxd56_pm_message_s *message)
|
|||
|
||||
static void cxd56_pm_checkfreqlock(void)
|
||||
{
|
||||
FAR sq_entry_t *entry;
|
||||
FAR struct pm_cpu_freqlock_s *lock;
|
||||
sq_entry_t *entry;
|
||||
struct pm_cpu_freqlock_s *lock;
|
||||
int flag = PM_CPUFREQLOCK_FLAG_INITIALIZED;
|
||||
|
||||
for (entry = sq_peek(&g_freqlockqueue); entry; entry = sq_next(entry))
|
||||
{
|
||||
lock = (FAR struct pm_cpu_freqlock_s *)entry;
|
||||
lock = (struct pm_cpu_freqlock_s *)entry;
|
||||
flag |= lock->flag & PM_CPUFREQLOCK_FLAG_LV;
|
||||
flag |= lock->flag & PM_CPUFREQLOCK_FLAG_HV;
|
||||
}
|
||||
|
|
@ -424,7 +424,7 @@ static void cxd56_pm_do_hotsleep(uint32_t idletime)
|
|||
}
|
||||
#endif
|
||||
|
||||
static int cxd56_pm_maintask(int argc, FAR char *argv[])
|
||||
static int cxd56_pm_maintask(int argc, char *argv[])
|
||||
{
|
||||
struct cxd56_pm_message_s message;
|
||||
struct mq_attr attr;
|
||||
|
|
@ -457,7 +457,7 @@ static int cxd56_pm_maintask(int argc, FAR char *argv[])
|
|||
|
||||
while (1)
|
||||
{
|
||||
size = file_mq_receive(&g_queuedesc, (FAR char *)&message,
|
||||
size = file_mq_receive(&g_queuedesc, (char *)&message,
|
||||
sizeof(message), NULL);
|
||||
if (size == sizeof(message))
|
||||
{
|
||||
|
|
@ -481,7 +481,7 @@ static int cxd56_pm_maintask(int argc, FAR char *argv[])
|
|||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
FAR void *cxd56_pm_register_callback(uint32_t target,
|
||||
void *cxd56_pm_register_callback(uint32_t target,
|
||||
cxd56_pm_callback callback)
|
||||
{
|
||||
struct pm_cbentry_s *entry = NULL;
|
||||
|
|
@ -498,24 +498,24 @@ FAR void *cxd56_pm_register_callback(uint32_t target,
|
|||
entry->target = target;
|
||||
entry->callback = callback;
|
||||
|
||||
dq_addlast((FAR dq_entry_t *)entry, &g_cbqueue);
|
||||
dq_addlast((dq_entry_t *)entry, &g_cbqueue);
|
||||
nxsem_post(&g_regcblock);
|
||||
|
||||
return (void *)entry;
|
||||
}
|
||||
|
||||
void cxd56_pm_unregister_callback(FAR void *handle)
|
||||
void cxd56_pm_unregister_callback(void *handle)
|
||||
{
|
||||
cxd56_pm_semtake(&g_regcblock);
|
||||
|
||||
dq_rem((FAR dq_entry_t *)handle, &g_cbqueue);
|
||||
dq_rem((dq_entry_t *)handle, &g_cbqueue);
|
||||
kmm_free(handle);
|
||||
|
||||
nxsem_post(&g_regcblock);
|
||||
}
|
||||
|
||||
static int cxd56_pmmsghandler(int cpuid, int protoid, uint32_t pdata,
|
||||
uint32_t data, FAR void *userdata)
|
||||
uint32_t data, void *userdata)
|
||||
{
|
||||
uint32_t msgid;
|
||||
struct cxd56_pm_message_s message;
|
||||
|
|
@ -526,7 +526,7 @@ static int cxd56_pmmsghandler(int cpuid, int protoid, uint32_t pdata,
|
|||
if (msgid == MSGID_CLK_CHG_START)
|
||||
{
|
||||
message.mid = MQMSG_CLK_CHG_START;
|
||||
ret = file_mq_send(&g_queuedesc, (FAR const char *)&message,
|
||||
ret = file_mq_send(&g_queuedesc, (const char *)&message,
|
||||
sizeof(message), CXD56_PM_MESSAGE_PRIO);
|
||||
if (ret < 0)
|
||||
{
|
||||
|
|
@ -536,7 +536,7 @@ static int cxd56_pmmsghandler(int cpuid, int protoid, uint32_t pdata,
|
|||
else if (msgid == MSGID_CLK_CHG_END)
|
||||
{
|
||||
message.mid = MQMSG_CLK_CHG_END;
|
||||
ret = file_mq_send(&g_queuedesc, (FAR const char *)&message,
|
||||
ret = file_mq_send(&g_queuedesc, (const char *)&message,
|
||||
sizeof(message), CXD56_PM_MESSAGE_PRIO);
|
||||
if (ret < 0)
|
||||
{
|
||||
|
|
@ -577,7 +577,7 @@ int cxd56_pm_bootup(void)
|
|||
|
||||
void up_pm_acquire_freqlock(struct pm_cpu_freqlock_s *lock)
|
||||
{
|
||||
FAR sq_entry_t *entry;
|
||||
sq_entry_t *entry;
|
||||
|
||||
DEBUGASSERT(lock);
|
||||
|
||||
|
|
@ -602,7 +602,7 @@ void up_pm_acquire_freqlock(struct pm_cpu_freqlock_s *lock)
|
|||
|
||||
if (!entry)
|
||||
{
|
||||
sq_addlast((FAR sq_entry_t *)lock, &g_freqlockqueue);
|
||||
sq_addlast((sq_entry_t *)lock, &g_freqlockqueue);
|
||||
cxd56_pm_checkfreqlock();
|
||||
}
|
||||
|
||||
|
|
@ -627,7 +627,7 @@ void up_pm_acquire_freqlock(struct pm_cpu_freqlock_s *lock)
|
|||
|
||||
void up_pm_release_freqlock(struct pm_cpu_freqlock_s *lock)
|
||||
{
|
||||
FAR sq_entry_t *entry;
|
||||
sq_entry_t *entry;
|
||||
|
||||
DEBUGASSERT(lock);
|
||||
|
||||
|
|
@ -678,7 +678,7 @@ exit:
|
|||
|
||||
int up_pm_get_freqlock_count(struct pm_cpu_freqlock_s *lock)
|
||||
{
|
||||
FAR sq_entry_t *entry;
|
||||
sq_entry_t *entry;
|
||||
int count = 0;
|
||||
|
||||
DEBUGASSERT(lock);
|
||||
|
|
@ -713,7 +713,7 @@ int up_pm_get_freqlock_count(struct pm_cpu_freqlock_s *lock)
|
|||
void up_pm_acquire_wakelock(struct pm_cpu_wakelock_s *lock)
|
||||
{
|
||||
irqstate_t flags;
|
||||
FAR sq_entry_t *entry;
|
||||
sq_entry_t *entry;
|
||||
|
||||
DEBUGASSERT(lock);
|
||||
|
||||
|
|
@ -729,7 +729,7 @@ void up_pm_acquire_wakelock(struct pm_cpu_wakelock_s *lock)
|
|||
|
||||
if (!entry)
|
||||
{
|
||||
sq_addlast((FAR sq_entry_t *)lock, &g_wakelockqueue);
|
||||
sq_addlast((sq_entry_t *)lock, &g_wakelockqueue);
|
||||
}
|
||||
|
||||
lock->count++;
|
||||
|
|
@ -752,7 +752,7 @@ void up_pm_acquire_wakelock(struct pm_cpu_wakelock_s *lock)
|
|||
void up_pm_release_wakelock(struct pm_cpu_wakelock_s *lock)
|
||||
{
|
||||
irqstate_t flags;
|
||||
FAR sq_entry_t *entry;
|
||||
sq_entry_t *entry;
|
||||
|
||||
DEBUGASSERT(lock);
|
||||
|
||||
|
|
@ -811,7 +811,7 @@ int cxd56_pm_hotsleep(int idletime)
|
|||
|
||||
message.mid = MQMSG_HOT_SLEEP;
|
||||
message.data = (uint32_t)idletime;
|
||||
ret = file_mq_send(&g_queuedesc, (FAR const char *)&message,
|
||||
ret = file_mq_send(&g_queuedesc, (const char *)&message,
|
||||
sizeof(message), CXD56_PM_MESSAGE_PRIO);
|
||||
if (ret < 0)
|
||||
{
|
||||
|
|
@ -859,7 +859,7 @@ int cxd56_pm_initialize(void)
|
|||
|
||||
taskid = task_create("cxd56_pm_task", CXD56_PM_TASK_PRIO,
|
||||
CXD56_PM_TASK_STACKSIZE, cxd56_pm_maintask,
|
||||
(FAR char * const *)NULL);
|
||||
NULL);
|
||||
if (taskid < 0)
|
||||
{
|
||||
return -EPERM;
|
||||
|
|
|
|||
|
|
@ -323,7 +323,7 @@ void *cxd56_pm_register_callback(uint32_t target,
|
|||
cxd56_pm_callback callback);
|
||||
void cxd56_pm_unregister_callback(void *handle);
|
||||
int cxd56_pm_fifo_handlear(int cpuid, uint32_t data[2]);
|
||||
int cxd56_pm_main_task(int argc, FAR char *argv[]);
|
||||
int cxd56_pm_main_task(int argc, char *argv[]);
|
||||
int cxd56_pm_initialize(void);
|
||||
int cxd56_pm_bootup(void);
|
||||
uint32_t cxd56_pm_getclock(uint32_t target);
|
||||
|
|
|
|||
|
|
@ -88,21 +88,21 @@ struct cxd56_powermgr_procfs_dir_s
|
|||
* Private Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
static int cxd56_powermgr_procfs_open(FAR struct file *filep,
|
||||
FAR const char *relpath,
|
||||
static int cxd56_powermgr_procfs_open(struct file *filep,
|
||||
const char *relpath,
|
||||
int oflags, mode_t mode);
|
||||
static int cxd56_powermgr_procfs_close(FAR struct file *filep);
|
||||
static ssize_t cxd56_powermgr_procfs_read(FAR struct file *filep,
|
||||
FAR char *buffer, size_t buflen);
|
||||
static int cxd56_powermgr_procfs_dup(FAR const struct file *oldp,
|
||||
FAR struct file *newp);
|
||||
static int cxd56_powermgr_procfs_opendir(FAR const char *relpath,
|
||||
FAR struct fs_dirent_s *dir);
|
||||
static int cxd56_powermgr_procfs_closedir(FAR struct fs_dirent_s *dir);
|
||||
static int cxd56_powermgr_procfs_close(struct file *filep);
|
||||
static ssize_t cxd56_powermgr_procfs_read(struct file *filep,
|
||||
char *buffer, size_t buflen);
|
||||
static int cxd56_powermgr_procfs_dup(const struct file *oldp,
|
||||
struct file *newp);
|
||||
static int cxd56_powermgr_procfs_opendir(const char *relpath,
|
||||
struct fs_dirent_s *dir);
|
||||
static int cxd56_powermgr_procfs_closedir(struct fs_dirent_s *dir);
|
||||
static int cxd56_powermgr_procfs_readdir(struct fs_dirent_s *dir);
|
||||
static int cxd56_powermgr_procfs_rewinddir(struct fs_dirent_s *dir);
|
||||
static int cxd56_powermgr_procfs_stat(FAR const char *relpath,
|
||||
FAR struct stat *buf);
|
||||
static int cxd56_powermgr_procfs_stat(const char *relpath,
|
||||
struct stat *buf);
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
|
|
@ -132,7 +132,7 @@ static const struct procfs_entry_s g_powermgr_procfs2 =
|
|||
"pm/" , &cxd56_powermgr_procfs_operations
|
||||
};
|
||||
|
||||
static FAR char *g_powermg_procfs_buffer;
|
||||
static char *g_powermg_procfs_buffer;
|
||||
static size_t g_powermg_procfs_size;
|
||||
static size_t g_powermg_procfs_len;
|
||||
|
||||
|
|
@ -465,12 +465,12 @@ static int cxd56_powermgr_procfs_check_dir(char *relpath,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int cxd56_powermgr_procfs_open(FAR struct file *filep,
|
||||
FAR const char *relpath,
|
||||
static int cxd56_powermgr_procfs_open(struct file *filep,
|
||||
const char *relpath,
|
||||
int oflags,
|
||||
mode_t mode)
|
||||
{
|
||||
FAR struct cxd56_powermgr_procfs_file_s *priv;
|
||||
struct cxd56_powermgr_procfs_file_s *priv;
|
||||
int ret;
|
||||
mode_t getmode;
|
||||
int level;
|
||||
|
|
@ -502,7 +502,7 @@ static int cxd56_powermgr_procfs_open(FAR struct file *filep,
|
|||
|
||||
/* Allocate the open file structure */
|
||||
|
||||
priv = (FAR struct cxd56_powermgr_procfs_file_s *)
|
||||
priv = (struct cxd56_powermgr_procfs_file_s *)
|
||||
kmm_zalloc(sizeof(struct cxd56_powermgr_procfs_file_s));
|
||||
if (!priv)
|
||||
{
|
||||
|
|
@ -525,7 +525,7 @@ static int cxd56_powermgr_procfs_open(FAR struct file *filep,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int cxd56_powermgr_procfs_close(FAR struct file *filep)
|
||||
static int cxd56_powermgr_procfs_close(struct file *filep)
|
||||
{
|
||||
pminfo("Close\n");
|
||||
|
||||
|
|
@ -544,18 +544,18 @@ static int cxd56_powermgr_procfs_close(FAR struct file *filep)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static ssize_t cxd56_powermgr_procfs_read(FAR struct file *filep,
|
||||
FAR char *buffer, size_t buflen)
|
||||
static ssize_t cxd56_powermgr_procfs_read(struct file *filep,
|
||||
char *buffer, size_t buflen)
|
||||
{
|
||||
size_t len;
|
||||
FAR struct cxd56_powermgr_procfs_file_s *priv;
|
||||
struct cxd56_powermgr_procfs_file_s *priv;
|
||||
|
||||
pminfo("READ buffer=%p buflen=%lu len=%lu\n", buffer,
|
||||
(unsigned long)buflen, g_powermg_procfs_len);
|
||||
|
||||
DEBUGASSERT(filep && filep->f_priv);
|
||||
|
||||
priv = (FAR struct cxd56_powermgr_procfs_file_s *)filep->f_priv;
|
||||
priv = (struct cxd56_powermgr_procfs_file_s *)filep->f_priv;
|
||||
|
||||
if (priv->fileno == 0)
|
||||
{
|
||||
|
|
@ -604,8 +604,8 @@ static ssize_t cxd56_powermgr_procfs_read(FAR struct file *filep,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int cxd56_powermgr_procfs_dup(FAR const struct file *oldp,
|
||||
FAR struct file *newp)
|
||||
static int cxd56_powermgr_procfs_dup(const struct file *oldp,
|
||||
struct file *newp)
|
||||
{
|
||||
void *oldpriv;
|
||||
void *newpriv;
|
||||
|
|
@ -645,8 +645,8 @@ static int cxd56_powermgr_procfs_dup(FAR const struct file *oldp,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int cxd56_powermgr_procfs_stat(FAR const char *relpath,
|
||||
FAR struct stat *buf)
|
||||
static int cxd56_powermgr_procfs_stat(const char *relpath,
|
||||
struct stat *buf)
|
||||
{
|
||||
int ret;
|
||||
mode_t mode;
|
||||
|
|
@ -676,10 +676,10 @@ static int cxd56_powermgr_procfs_stat(FAR const char *relpath,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int cxd56_powermgr_procfs_opendir(FAR const char *relpath,
|
||||
FAR struct fs_dirent_s *dir)
|
||||
static int cxd56_powermgr_procfs_opendir(const char *relpath,
|
||||
struct fs_dirent_s *dir)
|
||||
{
|
||||
FAR struct cxd56_powermgr_procfs_dir_s *procfs;
|
||||
struct cxd56_powermgr_procfs_dir_s *procfs;
|
||||
int ret;
|
||||
mode_t mode;
|
||||
int level;
|
||||
|
|
@ -701,7 +701,7 @@ static int cxd56_powermgr_procfs_opendir(FAR const char *relpath,
|
|||
return -ENOENT;
|
||||
}
|
||||
|
||||
procfs = (FAR struct cxd56_powermgr_procfs_dir_s *)
|
||||
procfs = (struct cxd56_powermgr_procfs_dir_s *)
|
||||
kmm_malloc(sizeof(struct cxd56_powermgr_procfs_dir_s));
|
||||
if (!procfs)
|
||||
{
|
||||
|
|
@ -710,7 +710,7 @@ static int cxd56_powermgr_procfs_opendir(FAR const char *relpath,
|
|||
}
|
||||
|
||||
procfs->index = 0;
|
||||
dir->u.procfs = (FAR void *)procfs;
|
||||
dir->u.procfs = (void *)procfs;
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
|
@ -723,9 +723,9 @@ static int cxd56_powermgr_procfs_opendir(FAR const char *relpath,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int cxd56_powermgr_procfs_closedir(FAR struct fs_dirent_s *dir)
|
||||
static int cxd56_powermgr_procfs_closedir(struct fs_dirent_s *dir)
|
||||
{
|
||||
FAR struct smartfs_level1_s *priv;
|
||||
struct smartfs_level1_s *priv;
|
||||
|
||||
pminfo("Closedir\n");
|
||||
|
||||
|
|
@ -751,11 +751,11 @@ static int cxd56_powermgr_procfs_closedir(FAR struct fs_dirent_s *dir)
|
|||
|
||||
static int cxd56_powermgr_procfs_readdir(struct fs_dirent_s *dir)
|
||||
{
|
||||
FAR struct cxd56_powermgr_procfs_dir_s *procfs;
|
||||
struct cxd56_powermgr_procfs_dir_s *procfs;
|
||||
|
||||
DEBUGASSERT(dir && dir->u.procfs);
|
||||
|
||||
procfs = (FAR struct cxd56_powermgr_procfs_dir_s *)dir->u.procfs;
|
||||
procfs = (struct cxd56_powermgr_procfs_dir_s *)dir->u.procfs;
|
||||
|
||||
pminfo("Readdir %d\n", procfs->index);
|
||||
|
||||
|
|
@ -783,11 +783,11 @@ static int cxd56_powermgr_procfs_readdir(struct fs_dirent_s *dir)
|
|||
|
||||
static int cxd56_powermgr_procfs_rewinddir(struct fs_dirent_s *dir)
|
||||
{
|
||||
FAR struct cxd56_powermgr_procfs_dir_s *procfs;
|
||||
struct cxd56_powermgr_procfs_dir_s *procfs;
|
||||
|
||||
DEBUGASSERT(dir && dir->u.procfs);
|
||||
|
||||
procfs = (FAR struct cxd56_powermgr_procfs_dir_s *)dir->u.procfs;
|
||||
procfs = (struct cxd56_powermgr_procfs_dir_s *)dir->u.procfs;
|
||||
pminfo("Rewind %d\n", procfs->index);
|
||||
procfs->index = 0;
|
||||
|
||||
|
|
|
|||
|
|
@ -95,12 +95,12 @@ typedef struct
|
|||
|
||||
/* PWM driver methods */
|
||||
|
||||
static int pwm_setup(FAR struct pwm_lowerhalf_s *dev);
|
||||
static int pwm_shutdown(FAR struct pwm_lowerhalf_s *dev);
|
||||
static int pwm_start(FAR struct pwm_lowerhalf_s *dev,
|
||||
FAR const struct pwm_info_s *info);
|
||||
static int pwm_stop(FAR struct pwm_lowerhalf_s *dev);
|
||||
static int pwm_ioctl(FAR struct pwm_lowerhalf_s *dev,
|
||||
static int pwm_setup(struct pwm_lowerhalf_s *dev);
|
||||
static int pwm_shutdown(struct pwm_lowerhalf_s *dev);
|
||||
static int pwm_start(struct pwm_lowerhalf_s *dev,
|
||||
const struct pwm_info_s *info);
|
||||
static int pwm_stop(struct pwm_lowerhalf_s *dev);
|
||||
static int pwm_ioctl(struct pwm_lowerhalf_s *dev,
|
||||
int cmd, unsigned long arg);
|
||||
|
||||
/****************************************************************************
|
||||
|
|
@ -330,9 +330,9 @@ static int convert_freq2period(uint32_t freq, ub16_t duty, uint32_t *param,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int pwm_setup(FAR struct pwm_lowerhalf_s *dev)
|
||||
static int pwm_setup(struct pwm_lowerhalf_s *dev)
|
||||
{
|
||||
FAR struct cxd56_pwm_chan_s *priv = (FAR struct cxd56_pwm_chan_s *)dev;
|
||||
struct cxd56_pwm_chan_s *priv = (struct cxd56_pwm_chan_s *)dev;
|
||||
int ret;
|
||||
|
||||
ret = pwm_pin_config(priv->ch);
|
||||
|
|
@ -361,7 +361,7 @@ static int pwm_setup(FAR struct pwm_lowerhalf_s *dev)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int pwm_shutdown(FAR struct pwm_lowerhalf_s *dev)
|
||||
static int pwm_shutdown(struct pwm_lowerhalf_s *dev)
|
||||
{
|
||||
return OK;
|
||||
}
|
||||
|
|
@ -381,10 +381,10 @@ static int pwm_shutdown(FAR struct pwm_lowerhalf_s *dev)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int pwm_start(FAR struct pwm_lowerhalf_s *dev,
|
||||
FAR const struct pwm_info_s *info)
|
||||
static int pwm_start(struct pwm_lowerhalf_s *dev,
|
||||
const struct pwm_info_s *info)
|
||||
{
|
||||
FAR struct cxd56_pwm_chan_s *priv = (FAR struct cxd56_pwm_chan_s *)dev;
|
||||
struct cxd56_pwm_chan_s *priv = (struct cxd56_pwm_chan_s *)dev;
|
||||
uint32_t param;
|
||||
uint32_t phase;
|
||||
int ret;
|
||||
|
|
@ -442,9 +442,9 @@ static int pwm_start(FAR struct pwm_lowerhalf_s *dev,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int pwm_stop(FAR struct pwm_lowerhalf_s *dev)
|
||||
static int pwm_stop(struct pwm_lowerhalf_s *dev)
|
||||
{
|
||||
FAR struct cxd56_pwm_chan_s *priv = (FAR struct cxd56_pwm_chan_s *)dev;
|
||||
struct cxd56_pwm_chan_s *priv = (struct cxd56_pwm_chan_s *)dev;
|
||||
|
||||
PWM_REG(priv->ch)->EN = 0x0;
|
||||
|
||||
|
|
@ -467,7 +467,7 @@ static int pwm_stop(FAR struct pwm_lowerhalf_s *dev)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int pwm_ioctl(FAR struct pwm_lowerhalf_s *dev, int cmd,
|
||||
static int pwm_ioctl(struct pwm_lowerhalf_s *dev, int cmd,
|
||||
unsigned long arg)
|
||||
{
|
||||
return -ENOTTY;
|
||||
|
|
@ -492,9 +492,9 @@ static int pwm_ioctl(FAR struct pwm_lowerhalf_s *dev, int cmd,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
FAR struct pwm_lowerhalf_s *cxd56_pwminitialize(uint32_t channel)
|
||||
struct pwm_lowerhalf_s *cxd56_pwminitialize(uint32_t channel)
|
||||
{
|
||||
FAR struct cxd56_pwm_chan_s *pwmch;
|
||||
struct cxd56_pwm_chan_s *pwmch;
|
||||
|
||||
switch (channel)
|
||||
{
|
||||
|
|
@ -523,5 +523,5 @@ FAR struct pwm_lowerhalf_s *cxd56_pwminitialize(uint32_t channel)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
return (FAR struct pwm_lowerhalf_s *)pwmch;
|
||||
return (struct pwm_lowerhalf_s *)pwmch;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@ extern "C"
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
FAR struct pwm_lowerhalf_s *cxd56_pwminitialize(uint32_t channel);
|
||||
struct pwm_lowerhalf_s *cxd56_pwminitialize(uint32_t channel);
|
||||
|
||||
#undef EXTERN
|
||||
#if defined(__cplusplus)
|
||||
|
|
|
|||
|
|
@ -95,7 +95,7 @@
|
|||
struct alm_cbinfo_s
|
||||
{
|
||||
volatile alm_callback_t ac_cb; /* Client callback function */
|
||||
volatile FAR void *ac_arg; /* Argument to pass with the callback function */
|
||||
volatile void *ac_arg; /* Argument to pass with the callback function */
|
||||
};
|
||||
#endif
|
||||
|
||||
|
|
@ -146,9 +146,9 @@ volatile bool g_rtc_enabled = false;
|
|||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_DEBUG_RTC
|
||||
static void rtc_dumptime(FAR const struct timespec *tp, FAR const char *msg)
|
||||
static void rtc_dumptime(const struct timespec *tp, const char *msg)
|
||||
{
|
||||
FAR struct tm tm;
|
||||
struct tm tm;
|
||||
|
||||
gmtime_r(&tp->tv_sec, &tm);
|
||||
|
||||
|
|
@ -178,11 +178,11 @@ static void rtc_dumptime(FAR const struct timespec *tp, FAR const char *msg)
|
|||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_RTC_ALARM
|
||||
static int cxd56_rtc_interrupt(int irq, FAR void *context, FAR void *arg)
|
||||
static int cxd56_rtc_interrupt(int irq, void *context, void *arg)
|
||||
{
|
||||
FAR struct alm_cbinfo_s *cbinfo;
|
||||
struct alm_cbinfo_s *cbinfo;
|
||||
alm_callback_t cb;
|
||||
FAR void *cb_arg;
|
||||
void *cb_arg;
|
||||
uint32_t source;
|
||||
uint32_t clear;
|
||||
int id;
|
||||
|
|
@ -213,7 +213,7 @@ static int cxd56_rtc_interrupt(int irq, FAR void *context, FAR void *arg)
|
|||
/* Alarm callback */
|
||||
|
||||
cb = cbinfo->ac_cb;
|
||||
cb_arg = (FAR void *)cbinfo->ac_arg;
|
||||
cb_arg = (void *)cbinfo->ac_arg;
|
||||
|
||||
cbinfo->ac_cb = NULL;
|
||||
cbinfo->ac_arg = NULL;
|
||||
|
|
@ -395,7 +395,7 @@ time_t up_rtc_time(void)
|
|||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_RTC_HIRES
|
||||
int up_rtc_gettime(FAR struct timespec *tp)
|
||||
int up_rtc_gettime(struct timespec *tp)
|
||||
{
|
||||
uint64_t count;
|
||||
|
||||
|
|
@ -429,7 +429,7 @@ int up_rtc_gettime(FAR struct timespec *tp)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
int up_rtc_settime(FAR const struct timespec *tp)
|
||||
int up_rtc_settime(const struct timespec *tp)
|
||||
{
|
||||
irqstate_t flags;
|
||||
uint64_t count;
|
||||
|
|
@ -538,9 +538,9 @@ uint64_t cxd56_rtc_almcount(void)
|
|||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_RTC_ALARM
|
||||
int cxd56_rtc_setalarm(FAR struct alm_setalarm_s *alminfo)
|
||||
int cxd56_rtc_setalarm(struct alm_setalarm_s *alminfo)
|
||||
{
|
||||
FAR struct alm_cbinfo_s *cbinfo;
|
||||
struct alm_cbinfo_s *cbinfo;
|
||||
irqstate_t flags;
|
||||
int ret = -EBUSY;
|
||||
int id;
|
||||
|
|
@ -617,7 +617,7 @@ int cxd56_rtc_setalarm(FAR struct alm_setalarm_s *alminfo)
|
|||
#ifdef CONFIG_RTC_ALARM
|
||||
int cxd56_rtc_cancelalarm(enum alm_id_e alarmid)
|
||||
{
|
||||
FAR struct alm_cbinfo_s *cbinfo;
|
||||
struct alm_cbinfo_s *cbinfo;
|
||||
irqstate_t flags;
|
||||
int ret = -ENODATA;
|
||||
uint32_t mask;
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@
|
|||
|
||||
/* The form of an alarm callback */
|
||||
|
||||
typedef CODE void (*alm_callback_t)(FAR void *arg, unsigned int alarmid);
|
||||
typedef void (*alm_callback_t)(void *arg, unsigned int alarmid);
|
||||
|
||||
enum alm_id_e
|
||||
{
|
||||
|
|
@ -56,7 +56,7 @@ struct alm_setalarm_s
|
|||
int as_id; /* enum alm_id_e */
|
||||
struct timespec as_time; /* Alarm expiration time */
|
||||
alm_callback_t as_cb; /* Callback (if non-NULL) */
|
||||
FAR void *as_arg; /* Argument for callback */
|
||||
void *as_arg; /* Argument for callback */
|
||||
};
|
||||
|
||||
#endif /* CONFIG_RTC_ALARM */
|
||||
|
|
@ -121,7 +121,7 @@ uint64_t cxd56_rtc_almcount(void);
|
|||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_RTC_ALARM
|
||||
int cxd56_rtc_setalarm(FAR struct alm_setalarm_s *alminfo);
|
||||
int cxd56_rtc_setalarm(struct alm_setalarm_s *alminfo);
|
||||
#endif /* CONFIG_RTC_ALARM */
|
||||
|
||||
/****************************************************************************
|
||||
|
|
@ -165,7 +165,7 @@ int cxd56_rtc_cancelalarm(enum alm_id_e alarmid);
|
|||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_RTC_DRIVER
|
||||
FAR struct rtc_lowerhalf_s *cxd56_rtc_lowerhalf(void);
|
||||
struct rtc_lowerhalf_s *cxd56_rtc_lowerhalf(void);
|
||||
#endif /* CONFIG_RTC_DRIVER */
|
||||
|
||||
#undef EXTERN
|
||||
|
|
|
|||
|
|
@ -51,8 +51,8 @@
|
|||
#ifdef CONFIG_RTC_ALARM
|
||||
struct cxd56_cbinfo_s
|
||||
{
|
||||
volatile rtc_alarm_callback_t cb; /* Callback when the alarm expires */
|
||||
volatile FAR void *priv; /* Private argurment to accompany callback */
|
||||
volatile rtc_alarm_callback_t cb; /* Callback when the alarm expires */
|
||||
volatile void *priv; /* Private argurment to accompany callback */
|
||||
};
|
||||
#endif
|
||||
|
||||
|
|
@ -66,7 +66,7 @@ struct cxd56_lowerhalf_s
|
|||
* operations vtable (which may lie in FLASH or ROM)
|
||||
*/
|
||||
|
||||
FAR const struct rtc_ops_s *ops;
|
||||
const struct rtc_ops_s *ops;
|
||||
|
||||
/* Data following is private to this driver and not visible outside of
|
||||
* this file.
|
||||
|
|
@ -85,17 +85,17 @@ struct cxd56_lowerhalf_s
|
|||
|
||||
/* Prototypes for static methods in struct rtc_ops_s */
|
||||
|
||||
static int cxd56_rdtime(FAR struct rtc_lowerhalf_s *lower,
|
||||
FAR struct rtc_time *rtctime);
|
||||
static int cxd56_settime(FAR struct rtc_lowerhalf_s *lower,
|
||||
FAR const struct rtc_time *rtctime);
|
||||
static int cxd56_rdtime(struct rtc_lowerhalf_s *lower,
|
||||
struct rtc_time *rtctime);
|
||||
static int cxd56_settime(struct rtc_lowerhalf_s *lower,
|
||||
const struct rtc_time *rtctime);
|
||||
|
||||
#ifdef CONFIG_RTC_ALARM
|
||||
static int cxd56_setalarm(FAR struct rtc_lowerhalf_s *lower,
|
||||
FAR const struct lower_setalarm_s *alarminfo);
|
||||
static int cxd56_setrelative(FAR struct rtc_lowerhalf_s *lower,
|
||||
FAR const struct lower_setrelative_s *alarminfo);
|
||||
static int cxd56_cancelalarm(FAR struct rtc_lowerhalf_s *lower,
|
||||
static int cxd56_setalarm(struct rtc_lowerhalf_s *lower,
|
||||
const struct lower_setalarm_s *alarminfo);
|
||||
static int cxd56_setrelative(struct rtc_lowerhalf_s *lower,
|
||||
const struct lower_setrelative_s *alarminfo);
|
||||
static int cxd56_cancelalarm(struct rtc_lowerhalf_s *lower,
|
||||
int alarmid);
|
||||
#endif
|
||||
|
||||
|
|
@ -146,12 +146,12 @@ static struct cxd56_lowerhalf_s g_rtc_lowerhalf =
|
|||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_RTC_ALARM
|
||||
static void cxd56_alarm_callback(FAR void *arg, unsigned int alarmid)
|
||||
static void cxd56_alarm_callback(void *arg, unsigned int alarmid)
|
||||
{
|
||||
FAR struct cxd56_lowerhalf_s *lower;
|
||||
FAR struct cxd56_cbinfo_s *cbinfo;
|
||||
struct cxd56_lowerhalf_s *lower;
|
||||
struct cxd56_cbinfo_s *cbinfo;
|
||||
rtc_alarm_callback_t cb;
|
||||
FAR void *priv;
|
||||
void *priv;
|
||||
|
||||
DEBUGASSERT((RTC_ALARM0 <= alarmid) && (alarmid < RTC_ALARM_LAST));
|
||||
|
||||
|
|
@ -163,7 +163,7 @@ static void cxd56_alarm_callback(FAR void *arg, unsigned int alarmid)
|
|||
*/
|
||||
|
||||
cb = (rtc_alarm_callback_t)cbinfo->cb;
|
||||
priv = (FAR void *)cbinfo->priv;
|
||||
priv = (void *)cbinfo->priv;
|
||||
|
||||
cbinfo->cb = NULL;
|
||||
cbinfo->priv = NULL;
|
||||
|
|
@ -193,11 +193,11 @@ static void cxd56_alarm_callback(FAR void *arg, unsigned int alarmid)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int cxd56_rdtime(FAR struct rtc_lowerhalf_s *lower,
|
||||
FAR struct rtc_time *rtctime)
|
||||
static int cxd56_rdtime(struct rtc_lowerhalf_s *lower,
|
||||
struct rtc_time *rtctime)
|
||||
{
|
||||
#if defined(CONFIG_RTC_HIRES)
|
||||
FAR struct timespec ts;
|
||||
struct timespec ts;
|
||||
int ret;
|
||||
|
||||
/* Get the higher resolution time */
|
||||
|
|
@ -213,7 +213,7 @@ static int cxd56_rdtime(FAR struct rtc_lowerhalf_s *lower,
|
|||
* compatible.
|
||||
*/
|
||||
|
||||
if (!gmtime_r(&ts.tv_sec, (FAR struct tm *)rtctime))
|
||||
if (!gmtime_r(&ts.tv_sec, (struct tm *)rtctime))
|
||||
{
|
||||
ret = -get_errno();
|
||||
goto errout;
|
||||
|
|
@ -234,7 +234,7 @@ errout:
|
|||
|
||||
/* Convert the one second epoch time to a struct tm */
|
||||
|
||||
if (!gmtime_r(&timer, (FAR struct tm *)rtctime))
|
||||
if (!gmtime_r(&timer, (struct tm *)rtctime))
|
||||
{
|
||||
int errcode = get_errno();
|
||||
DEBUGASSERT(errcode > 0);
|
||||
|
|
@ -261,8 +261,8 @@ errout:
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int cxd56_settime(FAR struct rtc_lowerhalf_s *lower,
|
||||
FAR const struct rtc_time *rtctime)
|
||||
static int cxd56_settime(struct rtc_lowerhalf_s *lower,
|
||||
const struct rtc_time *rtctime)
|
||||
{
|
||||
struct timespec ts;
|
||||
|
||||
|
|
@ -270,7 +270,7 @@ static int cxd56_settime(FAR struct rtc_lowerhalf_s *lower,
|
|||
* rtc_time is cast compatible with struct tm.
|
||||
*/
|
||||
|
||||
ts.tv_sec = timegm((FAR struct tm *)rtctime);
|
||||
ts.tv_sec = timegm((struct tm *)rtctime);
|
||||
ts.tv_nsec = 0;
|
||||
|
||||
/* Now set the time (to one second accuracy) */
|
||||
|
|
@ -296,18 +296,18 @@ static int cxd56_settime(FAR struct rtc_lowerhalf_s *lower,
|
|||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_RTC_ALARM
|
||||
static int cxd56_setalarm(FAR struct rtc_lowerhalf_s *lower,
|
||||
FAR const struct lower_setalarm_s *alarminfo)
|
||||
static int cxd56_setalarm(struct rtc_lowerhalf_s *lower,
|
||||
const struct lower_setalarm_s *alarminfo)
|
||||
{
|
||||
FAR struct cxd56_lowerhalf_s *priv;
|
||||
FAR struct cxd56_cbinfo_s *cbinfo;
|
||||
struct cxd56_lowerhalf_s *priv;
|
||||
struct cxd56_cbinfo_s *cbinfo;
|
||||
struct alm_setalarm_s lowerinfo;
|
||||
int ret = -EINVAL;
|
||||
|
||||
DEBUGASSERT(lower != NULL && alarminfo != NULL);
|
||||
DEBUGASSERT(RTC_ALARM0 == alarminfo->id);
|
||||
|
||||
priv = (FAR struct cxd56_lowerhalf_s *)lower;
|
||||
priv = (struct cxd56_lowerhalf_s *)lower;
|
||||
|
||||
if (RTC_ALARM0 == alarminfo->id)
|
||||
{
|
||||
|
|
@ -325,7 +325,7 @@ static int cxd56_setalarm(FAR struct rtc_lowerhalf_s *lower,
|
|||
|
||||
/* Convert the RTC time to a timespec (1 second accuracy) */
|
||||
|
||||
lowerinfo.as_time.tv_sec = timegm((FAR struct tm *)&alarminfo->time);
|
||||
lowerinfo.as_time.tv_sec = timegm((struct tm *)&alarminfo->time);
|
||||
lowerinfo.as_time.tv_nsec = 0;
|
||||
|
||||
/* And set the alarm */
|
||||
|
|
@ -360,11 +360,11 @@ static int cxd56_setalarm(FAR struct rtc_lowerhalf_s *lower,
|
|||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_RTC_ALARM
|
||||
static int cxd56_setrelative(FAR struct rtc_lowerhalf_s *lower,
|
||||
FAR const struct lower_setrelative_s *alarminfo)
|
||||
static int cxd56_setrelative(struct rtc_lowerhalf_s *lower,
|
||||
const struct lower_setrelative_s *alarminfo)
|
||||
{
|
||||
struct lower_setalarm_s setalarm;
|
||||
FAR struct timespec ts;
|
||||
struct timespec ts;
|
||||
time_t seconds;
|
||||
int ret = -EINVAL;
|
||||
|
||||
|
|
@ -402,7 +402,7 @@ static int cxd56_setrelative(FAR struct rtc_lowerhalf_s *lower,
|
|||
|
||||
seconds = ts.tv_sec + (alarminfo->reltime + 1);
|
||||
|
||||
gmtime_r(&seconds, (FAR struct tm *)&setalarm.time);
|
||||
gmtime_r(&seconds, (struct tm *)&setalarm.time);
|
||||
|
||||
/* The set the alarm using this absolute time */
|
||||
|
||||
|
|
@ -437,16 +437,16 @@ static int cxd56_setrelative(FAR struct rtc_lowerhalf_s *lower,
|
|||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_RTC_ALARM
|
||||
static int cxd56_cancelalarm(FAR struct rtc_lowerhalf_s *lower, int alarmid)
|
||||
static int cxd56_cancelalarm(struct rtc_lowerhalf_s *lower, int alarmid)
|
||||
{
|
||||
FAR struct cxd56_lowerhalf_s *priv;
|
||||
FAR struct cxd56_cbinfo_s *cbinfo;
|
||||
struct cxd56_lowerhalf_s *priv;
|
||||
struct cxd56_cbinfo_s *cbinfo;
|
||||
int ret = -EINVAL;
|
||||
|
||||
DEBUGASSERT(lower != NULL);
|
||||
DEBUGASSERT((RTC_ALARM0 <= alarmid) && (alarmid < RTC_ALARM_LAST));
|
||||
|
||||
priv = (FAR struct cxd56_lowerhalf_s *)lower;
|
||||
priv = (struct cxd56_lowerhalf_s *)lower;
|
||||
|
||||
if ((RTC_ALARM0 <= alarmid) && (alarmid < RTC_ALARM_LAST))
|
||||
{
|
||||
|
|
@ -491,9 +491,9 @@ static int cxd56_cancelalarm(FAR struct rtc_lowerhalf_s *lower, int alarmid)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
FAR struct rtc_lowerhalf_s *cxd56_rtc_lowerhalf(void)
|
||||
struct rtc_lowerhalf_s *cxd56_rtc_lowerhalf(void)
|
||||
{
|
||||
return (FAR struct rtc_lowerhalf_s *)&g_rtc_lowerhalf;
|
||||
return (struct rtc_lowerhalf_s *)&g_rtc_lowerhalf;
|
||||
}
|
||||
|
||||
#endif /* CONFIG_RTC_DRIVER */
|
||||
|
|
|
|||
|
|
@ -220,8 +220,8 @@ struct coeff_addr_s
|
|||
|
||||
/* SCU hardware resource management *****************************************/
|
||||
|
||||
static int findzeroandset(FAR uint8_t *bitmap, int nbits);
|
||||
static void bitmapclear(FAR uint8_t *bitmap, int bit);
|
||||
static int findzeroandset(uint8_t *bitmap, int nbits);
|
||||
static void bitmapclear(uint8_t *bitmap, int bit);
|
||||
static inline int8_t deci_alloc(void);
|
||||
static inline void deci_free(int8_t sid);
|
||||
static inline int8_t mathf_alloc(void);
|
||||
|
|
@ -232,18 +232,18 @@ static inline int8_t oneshot_alloc(void);
|
|||
static inline void oneshot_free(int8_t tid);
|
||||
static int seq_semtake(sem_t *id);
|
||||
static void seq_semgive(sem_t *id);
|
||||
static void seq_fifosetactive(FAR struct seq_s *seq, int fifoid);
|
||||
static void seq_fifosetinactive(FAR struct seq_s *seq, int fifoid);
|
||||
static int seq_fifoisactive(FAR struct seq_s *seq, int fifoid);
|
||||
static int seq_isactive(FAR struct seq_s *seq);
|
||||
static void seq_fifosetactive(struct seq_s *seq, int fifoid);
|
||||
static void seq_fifosetinactive(struct seq_s *seq, int fifoid);
|
||||
static int seq_fifoisactive(struct seq_s *seq, int fifoid);
|
||||
static int seq_isactive(struct seq_s *seq);
|
||||
|
||||
/* Sequencer control ********************************************************/
|
||||
|
||||
static FAR struct seq_s *seq_new(void);
|
||||
static FAR struct seq_s *deci_new(void);
|
||||
static struct seq_s *seq_new(void);
|
||||
static struct seq_s *deci_new(void);
|
||||
|
||||
static void seq_inhibitrequest(int req, bool set);
|
||||
static void seq_sync(FAR struct seq_s *seq, int req);
|
||||
static void seq_sync(struct seq_s *seq, int req);
|
||||
static void seq_setproperty(int sid, int slave, int dest,
|
||||
int offset, int len);
|
||||
static void seq_setinst(int sid, int offset, int len);
|
||||
|
|
@ -257,24 +257,24 @@ static void seq_setstartinterval(int sid, int interval);
|
|||
static void seq_setstartphase(int sid, int phase);
|
||||
static void seq_startseq(int sid);
|
||||
static void seq_stopseq(int sid);
|
||||
static int seq_setadjustment(FAR struct seq_s *seq,
|
||||
static int seq_setadjustment(struct seq_s *seq,
|
||||
struct adjust_xyz_s *adj);
|
||||
static int seq_setfilter(FAR struct scufifo_s *fifo, int pos,
|
||||
static int seq_setfilter(struct scufifo_s *fifo, int pos,
|
||||
struct iir_filter_s iir[2]);
|
||||
static int seq_seteventnotifier(FAR struct scufifo_s *fifo,
|
||||
static int seq_seteventnotifier(struct scufifo_s *fifo,
|
||||
struct scuev_notify_s *ev);
|
||||
static void seq_offsetgainenable(int sid, bool enable);
|
||||
static int seq_start(FAR struct seq_s *seq, int fifoid);
|
||||
static int seq_stop(FAR struct seq_s *seq, int fifoid);
|
||||
static int seq_setsamplingrate(FAR struct seq_s *seq, uint8_t samplingrate);
|
||||
static int seq_fifoinit(FAR struct seq_s *seq, int fifoid, uint16_t fsize);
|
||||
static void seq_fifofree(FAR struct scufifo_s *fifo);
|
||||
static inline struct scufifo_s *seq_getfifo(FAR struct seq_s *seq,
|
||||
static int seq_start(struct seq_s *seq, int fifoid);
|
||||
static int seq_stop(struct seq_s *seq, int fifoid);
|
||||
static int seq_setsamplingrate(struct seq_s *seq, uint8_t samplingrate);
|
||||
static int seq_fifoinit(struct seq_s *seq, int fifoid, uint16_t fsize);
|
||||
static void seq_fifofree(struct scufifo_s *fifo);
|
||||
static inline struct scufifo_s *seq_getfifo(struct seq_s *seq,
|
||||
int fifoid);
|
||||
static void seq_setdecimation(int wid, uint8_t ratio, uint8_t leveladj,
|
||||
uint8_t forcethrough);
|
||||
static int seq_setwatermark(FAR struct seq_s *seq, int fifoid,
|
||||
FAR struct scufifo_wm_s *wm);
|
||||
static int seq_setwatermark(struct seq_s *seq, int fifoid,
|
||||
struct scufifo_wm_s *wm);
|
||||
static void convert_firsttimestamp(struct scutimestamp_s *tm,
|
||||
uint16_t interval, uint16_t sample,
|
||||
uint16_t adjust);
|
||||
|
|
@ -283,9 +283,9 @@ static void latest_timestamp(struct scufifo_s *fifo, uint32_t interval,
|
|||
static void seq_gettimestamp(struct scufifo_s *fifo,
|
||||
struct scutimestamp_s *tm);
|
||||
|
||||
static int seq_oneshot(int bustype, int slave, FAR uint16_t *inst,
|
||||
uint32_t nr_insts, FAR uint8_t *buffer, int len);
|
||||
static void seq_setfifomode(FAR struct seq_s *seq, int fifoid, int enable);
|
||||
static int seq_oneshot(int bustype, int slave, uint16_t *inst,
|
||||
uint32_t nr_insts, uint8_t *buffer, int len);
|
||||
static void seq_setfifomode(struct seq_s *seq, int fifoid, int enable);
|
||||
#ifdef CONFIG_CXD56_UDMAC
|
||||
static void seq_fifodmadone(DMA_HANDLE handle, uint8_t status, void *arg);
|
||||
#endif
|
||||
|
|
@ -296,20 +296,20 @@ static uint16_t seq_remakeinstruction(int bustype, uint16_t inst);
|
|||
static void mathf_enable(int8_t mid, uint8_t wid);
|
||||
static void mathf_disable(int8_t mid);
|
||||
static inline void mathf_set_coeff(uint32_t caddr,
|
||||
FAR struct iir_coeff_s *c);
|
||||
struct iir_coeff_s *c);
|
||||
static void mathf_setiirfilter(int mid, int n,
|
||||
FAR struct iir_filter_s *filter);
|
||||
struct iir_filter_s *filter);
|
||||
|
||||
/* Interrupt handlers *******************************************************/
|
||||
|
||||
static int seq_scuirqhandler(int irq, FAR void *context, FAR void *arg);
|
||||
static void seq_handlefifointr(FAR struct cxd56_scudev_s *priv,
|
||||
static int seq_scuirqhandler(int irq, void *context, void *arg);
|
||||
static void seq_handlefifointr(struct cxd56_scudev_s *priv,
|
||||
uint32_t intr);
|
||||
static void seq_handlemathfintr(FAR struct cxd56_scudev_s *priv,
|
||||
static void seq_handlemathfintr(struct cxd56_scudev_s *priv,
|
||||
uint32_t intr);
|
||||
static void seq_handleoneshot(FAR struct cxd56_scudev_s *priv,
|
||||
static void seq_handleoneshot(struct cxd56_scudev_s *priv,
|
||||
uint32_t intr);
|
||||
static void seq_handleisopdoneintr(FAR struct cxd56_scudev_s *priv,
|
||||
static void seq_handleisopdoneintr(struct cxd56_scudev_s *priv,
|
||||
uint32_t intr);
|
||||
|
||||
/****************************************************************************
|
||||
|
|
@ -381,7 +381,7 @@ static void seq_semgive(sem_t *id)
|
|||
* Name: seq_fifosetactive
|
||||
****************************************************************************/
|
||||
|
||||
static void seq_fifosetactive(FAR struct seq_s *seq, int fifoid)
|
||||
static void seq_fifosetactive(struct seq_s *seq, int fifoid)
|
||||
{
|
||||
irqstate_t flags = enter_critical_section();
|
||||
seq->active |= 1 << fifoid;
|
||||
|
|
@ -392,7 +392,7 @@ static void seq_fifosetactive(FAR struct seq_s *seq, int fifoid)
|
|||
* Name: seq_fifosetinactive
|
||||
****************************************************************************/
|
||||
|
||||
static void seq_fifosetinactive(FAR struct seq_s *seq, int fifoid)
|
||||
static void seq_fifosetinactive(struct seq_s *seq, int fifoid)
|
||||
{
|
||||
irqstate_t flags = enter_critical_section();
|
||||
seq->active &= ~(1 << fifoid);
|
||||
|
|
@ -403,7 +403,7 @@ static void seq_fifosetinactive(FAR struct seq_s *seq, int fifoid)
|
|||
* Name: seq_fifoisactive
|
||||
****************************************************************************/
|
||||
|
||||
static int seq_fifoisactive(FAR struct seq_s *seq, int fifoid)
|
||||
static int seq_fifoisactive(struct seq_s *seq, int fifoid)
|
||||
{
|
||||
irqstate_t flags = enter_critical_section();
|
||||
int8_t active = seq->active;
|
||||
|
|
@ -415,7 +415,7 @@ static int seq_fifoisactive(FAR struct seq_s *seq, int fifoid)
|
|||
* Name: seq_isactive
|
||||
****************************************************************************/
|
||||
|
||||
static int seq_isactive(FAR struct seq_s *seq)
|
||||
static int seq_isactive(struct seq_s *seq)
|
||||
{
|
||||
irqstate_t flags = enter_critical_section();
|
||||
int8_t active = seq->active;
|
||||
|
|
@ -438,7 +438,7 @@ static int seq_isactive(FAR struct seq_s *seq)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int findzeroandset(FAR uint8_t *bitmap, int nbits)
|
||||
static int findzeroandset(uint8_t *bitmap, int nbits)
|
||||
{
|
||||
int i;
|
||||
irqstate_t flags;
|
||||
|
|
@ -466,7 +466,7 @@ static int findzeroandset(FAR uint8_t *bitmap, int nbits)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static void bitmapclear(FAR uint8_t *bitmap, int bit)
|
||||
static void bitmapclear(uint8_t *bitmap, int bit)
|
||||
{
|
||||
irqstate_t flags = enter_critical_section();
|
||||
*bitmap &= ~(1 << bit);
|
||||
|
|
@ -991,8 +991,8 @@ static void seq_stopseq(int sid)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int seq_oneshot(int bustype, int slave, FAR uint16_t *inst,
|
||||
uint32_t nr_insts, FAR uint8_t *buffer, int len)
|
||||
static int seq_oneshot(int bustype, int slave, uint16_t *inst,
|
||||
uint32_t nr_insts, uint8_t *buffer, int len)
|
||||
{
|
||||
struct cxd56_scudev_s *priv = &g_scudev;
|
||||
irqstate_t flags;
|
||||
|
|
@ -1160,7 +1160,7 @@ static void seq_offsetgainenable(int sid, bool enable)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int seq_start(FAR struct seq_s *seq, int fifoid)
|
||||
static int seq_start(struct seq_s *seq, int fifoid)
|
||||
{
|
||||
struct scufifo_s *fifo;
|
||||
uint32_t interval;
|
||||
|
|
@ -1253,7 +1253,7 @@ static int seq_start(FAR struct seq_s *seq, int fifoid)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int seq_stop(FAR struct seq_s *seq, int fifoid)
|
||||
static int seq_stop(struct seq_s *seq, int fifoid)
|
||||
{
|
||||
struct scufifo_s *fifo;
|
||||
uint32_t val;
|
||||
|
|
@ -1368,7 +1368,7 @@ static void mathf_disable(int8_t mid)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static inline void mathf_set_coeff(uint32_t caddr, FAR struct iir_coeff_s *c)
|
||||
static inline void mathf_set_coeff(uint32_t caddr, struct iir_coeff_s *c)
|
||||
{
|
||||
putreg32(c->h, caddr);
|
||||
putreg32((c->l & 0x3) << 30, caddr + 4);
|
||||
|
|
@ -1388,7 +1388,7 @@ static inline void mathf_set_coeff(uint32_t caddr, FAR struct iir_coeff_s *c)
|
|||
****************************************************************************/
|
||||
|
||||
static void mathf_setiirfilter(int mid, int n,
|
||||
FAR struct iir_filter_s *filter)
|
||||
struct iir_filter_s *filter)
|
||||
{
|
||||
const struct coeff_addr_s *caddr;
|
||||
|
||||
|
|
@ -1421,7 +1421,7 @@ static void mathf_setiirfilter(int mid, int n,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int seq_setsamplingrate(FAR struct seq_s *seq, uint8_t samplingrate)
|
||||
static int seq_setsamplingrate(struct seq_s *seq, uint8_t samplingrate)
|
||||
{
|
||||
DEBUGASSERT(seq);
|
||||
|
||||
|
|
@ -1447,9 +1447,9 @@ static int seq_setsamplingrate(FAR struct seq_s *seq, uint8_t samplingrate)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static void seq_sync(FAR struct seq_s *seq, int req)
|
||||
static void seq_sync(struct seq_s *seq, int req)
|
||||
{
|
||||
FAR struct cxd56_scudev_s *priv = &g_scudev;
|
||||
struct cxd56_scudev_s *priv = &g_scudev;
|
||||
|
||||
seq_semtake(&priv->syncexc);
|
||||
|
||||
|
|
@ -1483,7 +1483,7 @@ static void seq_sync(FAR struct seq_s *seq, int req)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static void seq_handlefifointr(FAR struct cxd56_scudev_s *priv,
|
||||
static void seq_handlefifointr(struct cxd56_scudev_s *priv,
|
||||
uint32_t intr)
|
||||
{
|
||||
uint32_t bit;
|
||||
|
|
@ -1529,7 +1529,7 @@ static void seq_handlefifointr(FAR struct cxd56_scudev_s *priv,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static void seq_handlemathfintr(FAR struct cxd56_scudev_s *priv,
|
||||
static void seq_handlemathfintr(struct cxd56_scudev_s *priv,
|
||||
uint32_t intr)
|
||||
{
|
||||
int i;
|
||||
|
|
@ -1612,7 +1612,7 @@ static void seq_handlemathfintr(FAR struct cxd56_scudev_s *priv,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static void seq_handleoneshot(FAR struct cxd56_scudev_s *priv, uint32_t intr)
|
||||
static void seq_handleoneshot(struct cxd56_scudev_s *priv, uint32_t intr)
|
||||
{
|
||||
uint32_t bit;
|
||||
int i;
|
||||
|
|
@ -1641,7 +1641,7 @@ static void seq_handleoneshot(FAR struct cxd56_scudev_s *priv, uint32_t intr)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static void seq_handleisopdoneintr(FAR struct cxd56_scudev_s *priv,
|
||||
static void seq_handleisopdoneintr(struct cxd56_scudev_s *priv,
|
||||
uint32_t intr)
|
||||
{
|
||||
/* Detect ISOP3 as done or stop. */
|
||||
|
|
@ -1667,9 +1667,9 @@ static void seq_handleisopdoneintr(FAR struct cxd56_scudev_s *priv,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int seq_scuirqhandler(int irq, FAR void *context, FAR void *arg)
|
||||
static int seq_scuirqhandler(int irq, void *context, void *arg)
|
||||
{
|
||||
FAR struct cxd56_scudev_s *priv = arg;
|
||||
struct cxd56_scudev_s *priv = arg;
|
||||
uint32_t intr;
|
||||
uint32_t ierr0;
|
||||
uint32_t ierr1;
|
||||
|
|
@ -1776,9 +1776,9 @@ static int seq_scuirqhandler(int irq, FAR void *context, FAR void *arg)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static FAR struct seq_s *seq_new(void)
|
||||
static struct seq_s *seq_new(void)
|
||||
{
|
||||
FAR struct seq_s *seq;
|
||||
struct seq_s *seq;
|
||||
int sid;
|
||||
irqstate_t flags;
|
||||
|
||||
|
|
@ -1794,7 +1794,7 @@ static FAR struct seq_s *seq_new(void)
|
|||
|
||||
leave_critical_section(flags);
|
||||
|
||||
seq = (FAR struct seq_s *)kmm_malloc(sizeof(struct seq_s));
|
||||
seq = (struct seq_s *)kmm_malloc(sizeof(struct seq_s));
|
||||
if (!seq)
|
||||
{
|
||||
seq_free(sid);
|
||||
|
|
@ -1819,9 +1819,9 @@ static FAR struct seq_s *seq_new(void)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static FAR struct seq_s *deci_new(void)
|
||||
static struct seq_s *deci_new(void)
|
||||
{
|
||||
FAR struct decimator_s *deci;
|
||||
struct decimator_s *deci;
|
||||
int sid;
|
||||
irqstate_t flags;
|
||||
|
||||
|
|
@ -1837,7 +1837,7 @@ static FAR struct seq_s *deci_new(void)
|
|||
|
||||
leave_critical_section(flags);
|
||||
|
||||
deci = (FAR struct decimator_s *)kmm_malloc(sizeof(struct decimator_s));
|
||||
deci = (struct decimator_s *)kmm_malloc(sizeof(struct decimator_s));
|
||||
if (!deci)
|
||||
{
|
||||
deci_free(sid);
|
||||
|
|
@ -1864,10 +1864,10 @@ static FAR struct seq_s *deci_new(void)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int seq_fifoinit(FAR struct seq_s *seq, int fifoid, uint16_t fsize)
|
||||
static int seq_fifoinit(struct seq_s *seq, int fifoid, uint16_t fsize)
|
||||
{
|
||||
FAR struct scufifo_s *fifo;
|
||||
FAR struct decimator_s *deci = (FAR struct decimator_s *)seq;
|
||||
struct scufifo_s *fifo;
|
||||
struct decimator_s *deci = (struct decimator_s *)seq;
|
||||
int wid;
|
||||
int rid;
|
||||
uint32_t val;
|
||||
|
|
@ -1895,7 +1895,7 @@ static int seq_fifoinit(FAR struct seq_s *seq, int fifoid, uint16_t fsize)
|
|||
}
|
||||
}
|
||||
|
||||
fifo = (FAR struct scufifo_s *)kmm_malloc(sizeof(struct scufifo_s));
|
||||
fifo = (struct scufifo_s *)kmm_malloc(sizeof(struct scufifo_s));
|
||||
if (!fifo)
|
||||
{
|
||||
return -ENOMEM;
|
||||
|
|
@ -2016,7 +2016,7 @@ static int seq_fifoinit(FAR struct seq_s *seq, int fifoid, uint16_t fsize)
|
|||
|
||||
if (seq->type & SEQ_TYPE_DECI)
|
||||
{
|
||||
FAR struct decimation_fifo_s *dec = &deci->dfifo[fifoid];
|
||||
struct decimation_fifo_s *dec = &deci->dfifo[fifoid];
|
||||
dec->fifo = fifo;
|
||||
dec->ratio = 0;
|
||||
dec->leveladj = 0;
|
||||
|
|
@ -2051,7 +2051,7 @@ static int seq_fifoinit(FAR struct seq_s *seq, int fifoid, uint16_t fsize)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static void seq_fifofree(FAR struct scufifo_s *fifo)
|
||||
static void seq_fifofree(struct scufifo_s *fifo)
|
||||
{
|
||||
int wid;
|
||||
int rid;
|
||||
|
|
@ -2114,7 +2114,7 @@ static void seq_fifofree(FAR struct scufifo_s *fifo)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static inline struct scufifo_s *seq_getfifo(FAR struct seq_s *seq,
|
||||
static inline struct scufifo_s *seq_getfifo(struct seq_s *seq,
|
||||
int fifoid)
|
||||
{
|
||||
DEBUGASSERT(fifoid >= 0 && fifoid < 3);
|
||||
|
|
@ -2142,8 +2142,8 @@ static inline struct scufifo_s *seq_getfifo(FAR struct seq_s *seq,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int seq_setadjustment(FAR struct seq_s *seq,
|
||||
FAR struct adjust_xyz_s *adj)
|
||||
static int seq_setadjustment(struct seq_s *seq,
|
||||
struct adjust_xyz_s *adj)
|
||||
{
|
||||
int sid;
|
||||
uint32_t val;
|
||||
|
|
@ -2186,8 +2186,8 @@ static int seq_setadjustment(FAR struct seq_s *seq,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int seq_setfilter(FAR struct scufifo_s *fifo, int pos,
|
||||
FAR struct iir_filter_s iir[2])
|
||||
static int seq_setfilter(struct scufifo_s *fifo, int pos,
|
||||
struct iir_filter_s iir[2])
|
||||
{
|
||||
int mid;
|
||||
|
||||
|
|
@ -2233,8 +2233,8 @@ static int seq_setfilter(FAR struct scufifo_s *fifo, int pos,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int seq_seteventnotifier(FAR struct scufifo_s *fifo,
|
||||
FAR struct scuev_notify_s *ev)
|
||||
static int seq_seteventnotifier(struct scufifo_s *fifo,
|
||||
struct scuev_notify_s *ev)
|
||||
{
|
||||
struct cxd56_scudev_s *priv = &g_scudev;
|
||||
uint32_t val;
|
||||
|
|
@ -2323,10 +2323,10 @@ static int seq_seteventnotifier(FAR struct scufifo_s *fifo,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int seq_setwatermark(FAR struct seq_s *seq, int fifoid,
|
||||
FAR struct scufifo_wm_s *wm)
|
||||
static int seq_setwatermark(struct seq_s *seq, int fifoid,
|
||||
struct scufifo_wm_s *wm)
|
||||
{
|
||||
FAR struct cxd56_scudev_s *priv = &g_scudev;
|
||||
struct cxd56_scudev_s *priv = &g_scudev;
|
||||
struct scufifo_s *fifo = seq_getfifo(seq, fifoid);
|
||||
struct wm_notify_s *notify;
|
||||
int rid;
|
||||
|
|
@ -2497,13 +2497,13 @@ static void seq_gettimestamp(struct scufifo_s *fifo,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static void seq_setfifomode(FAR struct seq_s *seq, int fifoid, int enable)
|
||||
static void seq_setfifomode(struct seq_s *seq, int fifoid, int enable)
|
||||
{
|
||||
FAR struct scufifo_s *fifo = seq_getfifo(seq, fifoid);
|
||||
struct scufifo_s *fifo = seq_getfifo(seq, fifoid);
|
||||
uint32_t val;
|
||||
irqstate_t flags;
|
||||
FAR struct cxd56_scudev_s *priv = &g_scudev;
|
||||
FAR struct wm_notify_s *notify = &priv->wm[fifo->rid];
|
||||
struct cxd56_scudev_s *priv = &g_scudev;
|
||||
struct wm_notify_s *notify = &priv->wm[fifo->rid];
|
||||
bool iswtmk = false;
|
||||
|
||||
scuinfo("FIFO mode %d wid %d\n", enable, fifo->wid);
|
||||
|
|
@ -2683,8 +2683,8 @@ static void scu_hwinit(void)
|
|||
* Name: scu_spitransfer
|
||||
****************************************************************************/
|
||||
|
||||
int scu_spitransfer(int slavesel, FAR uint16_t *inst, uint32_t nr_insts,
|
||||
FAR uint8_t *buffer, int len)
|
||||
int scu_spitransfer(int slavesel, uint16_t *inst, uint32_t nr_insts,
|
||||
uint8_t *buffer, int len)
|
||||
{
|
||||
return seq_oneshot(SCU_BUS_SPI, slavesel, inst, nr_insts, buffer, len);
|
||||
}
|
||||
|
|
@ -2693,8 +2693,8 @@ int scu_spitransfer(int slavesel, FAR uint16_t *inst, uint32_t nr_insts,
|
|||
* Name: scu_i2ctransfer
|
||||
****************************************************************************/
|
||||
|
||||
int scu_i2ctransfer(int port, int slave, FAR uint16_t *inst,
|
||||
uint32_t nr_insts, FAR uint8_t *buffer, int len)
|
||||
int scu_i2ctransfer(int port, int slave, uint16_t *inst,
|
||||
uint32_t nr_insts, uint8_t *buffer, int len)
|
||||
{
|
||||
int bustype;
|
||||
|
||||
|
|
@ -2728,9 +2728,9 @@ int scu_i2ctransfer(int port, int slave, FAR uint16_t *inst,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
FAR struct seq_s *seq_open(int type, int bustype)
|
||||
struct seq_s *seq_open(int type, int bustype)
|
||||
{
|
||||
FAR struct seq_s *seq;
|
||||
struct seq_s *seq;
|
||||
|
||||
/* Check bustype is valid */
|
||||
|
||||
|
|
@ -2798,7 +2798,7 @@ FAR struct seq_s *seq_open(int type, int bustype)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
int seq_setinstruction(FAR struct seq_s *seq, const uint16_t *inst,
|
||||
int seq_setinstruction(struct seq_s *seq, const uint16_t *inst,
|
||||
uint16_t nr_insts)
|
||||
{
|
||||
int istart;
|
||||
|
|
@ -2846,7 +2846,7 @@ int seq_setinstruction(FAR struct seq_s *seq, const uint16_t *inst,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
void seq_setsample(FAR struct seq_s *seq, uint8_t sample, uint8_t offset,
|
||||
void seq_setsample(struct seq_s *seq, uint8_t sample, uint8_t offset,
|
||||
uint8_t elemsize, bool swapbyte)
|
||||
{
|
||||
DEBUGASSERT(seq);
|
||||
|
|
@ -2868,7 +2868,7 @@ void seq_setsample(FAR struct seq_s *seq, uint8_t sample, uint8_t offset,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
void seq_setaddress(FAR struct seq_s *seq, uint32_t slave_addr)
|
||||
void seq_setaddress(struct seq_s *seq, uint32_t slave_addr)
|
||||
{
|
||||
seq_setproperty(seq->id, slave_addr, 0, 0, 0);
|
||||
}
|
||||
|
|
@ -2893,7 +2893,7 @@ static void seq_fifodmadone(DMA_HANDLE handle, uint8_t status, void *arg)
|
|||
* Name: seq_read8
|
||||
****************************************************************************/
|
||||
|
||||
static inline void seq_read8(uint32_t addr, FAR uint8_t *buffer, int length)
|
||||
static inline void seq_read8(uint32_t addr, uint8_t *buffer, int length)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
|
@ -2908,7 +2908,7 @@ static inline void seq_read8(uint32_t addr, FAR uint8_t *buffer, int length)
|
|||
****************************************************************************/
|
||||
|
||||
static inline void seq_read16(uint32_t addr,
|
||||
FAR uint16_t *buffer,
|
||||
uint16_t *buffer,
|
||||
int length)
|
||||
{
|
||||
int i;
|
||||
|
|
@ -2924,7 +2924,7 @@ static inline void seq_read16(uint32_t addr,
|
|||
****************************************************************************/
|
||||
|
||||
static inline void seq_read32(uint32_t addr,
|
||||
FAR uint32_t *buffer,
|
||||
uint32_t *buffer,
|
||||
int length)
|
||||
{
|
||||
int i;
|
||||
|
|
@ -2953,7 +2953,7 @@ static inline void seq_read32(uint32_t addr,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
int seq_read(FAR struct seq_s *seq, int fifoid, FAR char *buffer, int length)
|
||||
int seq_read(struct seq_s *seq, int fifoid, char *buffer, int length)
|
||||
{
|
||||
struct scufifo_s *fifo;
|
||||
uint32_t outlet;
|
||||
|
|
@ -3069,7 +3069,7 @@ int seq_read(FAR struct seq_s *seq, int fifoid, FAR char *buffer, int length)
|
|||
{
|
||||
if (buffer != NULL)
|
||||
{
|
||||
seq_read8(outlet, (FAR uint8_t *)buffer, length);
|
||||
seq_read8(outlet, (uint8_t *)buffer, length);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -3083,7 +3083,7 @@ int seq_read(FAR struct seq_s *seq, int fifoid, FAR char *buffer, int length)
|
|||
{
|
||||
if (buffer != NULL)
|
||||
{
|
||||
seq_read16(outlet, (FAR uint16_t *)buffer, length);
|
||||
seq_read16(outlet, (uint16_t *)buffer, length);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -3097,7 +3097,7 @@ int seq_read(FAR struct seq_s *seq, int fifoid, FAR char *buffer, int length)
|
|||
{
|
||||
if (buffer != NULL)
|
||||
{
|
||||
seq_read32(outlet, (FAR uint32_t *)buffer, length);
|
||||
seq_read32(outlet, (uint32_t *)buffer, length);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -3131,7 +3131,7 @@ int seq_read(FAR struct seq_s *seq, int fifoid, FAR char *buffer, int length)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
int seq_ioctl(FAR struct seq_s *seq, int fifoid, int cmd, unsigned long arg)
|
||||
int seq_ioctl(struct seq_s *seq, int fifoid, int cmd, unsigned long arg)
|
||||
{
|
||||
int ret = OK;
|
||||
|
||||
|
|
@ -3157,7 +3157,7 @@ int seq_ioctl(FAR struct seq_s *seq, int fifoid, int cmd, unsigned long arg)
|
|||
case SCUIOC_FREEFIFO:
|
||||
{
|
||||
struct decimator_s *deci = (struct decimator_s *)seq;
|
||||
FAR struct scufifo_s *fifo;
|
||||
struct scufifo_s *fifo;
|
||||
|
||||
/* Check sequencer already stopped. */
|
||||
|
||||
|
|
@ -3211,8 +3211,8 @@ int seq_ioctl(FAR struct seq_s *seq, int fifoid, int cmd, unsigned long arg)
|
|||
{
|
||||
if (arg)
|
||||
{
|
||||
FAR struct adjust_xyz_s *p =
|
||||
(FAR struct adjust_xyz_s *)(uintptr_t)arg;
|
||||
struct adjust_xyz_s *p =
|
||||
(struct adjust_xyz_s *)(uintptr_t)arg;
|
||||
ret = seq_setadjustment(seq, p);
|
||||
if (!ret)
|
||||
{
|
||||
|
|
@ -3244,9 +3244,9 @@ int seq_ioctl(FAR struct seq_s *seq, int fifoid, int cmd, unsigned long arg)
|
|||
|
||||
case SCUIOC_SETFILTER:
|
||||
{
|
||||
FAR struct math_filter_s *f =
|
||||
(FAR struct math_filter_s *)(uintptr_t)arg;
|
||||
FAR struct scufifo_s *fifo = seq_getfifo(seq, fifoid);
|
||||
struct math_filter_s *f =
|
||||
(struct math_filter_s *)(uintptr_t)arg;
|
||||
struct scufifo_s *fifo = seq_getfifo(seq, fifoid);
|
||||
|
||||
if (seq_fifoisactive(seq, fifoid))
|
||||
{
|
||||
|
|
@ -3256,7 +3256,7 @@ int seq_ioctl(FAR struct seq_s *seq, int fifoid, int cmd, unsigned long arg)
|
|||
|
||||
if (seq->type & SEQ_TYPE_DECI)
|
||||
{
|
||||
FAR struct decimator_s *dec = (struct decimator_s *)seq;
|
||||
struct decimator_s *dec = (struct decimator_s *)seq;
|
||||
fifo = dec->dfifo[fifoid].fifo;
|
||||
}
|
||||
|
||||
|
|
@ -3271,9 +3271,9 @@ int seq_ioctl(FAR struct seq_s *seq, int fifoid, int cmd, unsigned long arg)
|
|||
|
||||
case SCUIOC_SETNOTIFY:
|
||||
{
|
||||
FAR struct scuev_notify_s *en =
|
||||
(FAR struct scuev_notify_s *)(uintptr_t)arg;
|
||||
FAR struct scufifo_s *fifo = seq_getfifo(seq, fifoid);
|
||||
struct scuev_notify_s *en =
|
||||
(struct scuev_notify_s *)(uintptr_t)arg;
|
||||
struct scufifo_s *fifo = seq_getfifo(seq, fifoid);
|
||||
|
||||
if (seq_fifoisactive(seq, fifoid))
|
||||
{
|
||||
|
|
@ -3283,7 +3283,7 @@ int seq_ioctl(FAR struct seq_s *seq, int fifoid, int cmd, unsigned long arg)
|
|||
|
||||
if (seq->type & SEQ_TYPE_DECI)
|
||||
{
|
||||
FAR struct decimator_s *dec = (struct decimator_s *)seq;
|
||||
struct decimator_s *dec = (struct decimator_s *)seq;
|
||||
fifo = dec->dfifo[fifoid].fifo;
|
||||
}
|
||||
|
||||
|
|
@ -3309,10 +3309,10 @@ int seq_ioctl(FAR struct seq_s *seq, int fifoid, int cmd, unsigned long arg)
|
|||
|
||||
case SCUIOC_SETDECIMATION:
|
||||
{
|
||||
FAR struct decimation_s *d =
|
||||
(FAR struct decimation_s *)(uintptr_t)arg;
|
||||
FAR struct decimator_s *deci = (FAR struct decimator_s *)seq;
|
||||
FAR struct decimation_fifo_s *dfifo = &deci->dfifo[fifoid];
|
||||
struct decimation_s *d =
|
||||
(struct decimation_s *)(uintptr_t)arg;
|
||||
struct decimator_s *deci = (struct decimator_s *)seq;
|
||||
struct decimation_fifo_s *dfifo = &deci->dfifo[fifoid];
|
||||
|
||||
if (!(seq->type & SEQ_TYPE_DECI))
|
||||
{
|
||||
|
|
@ -3338,8 +3338,8 @@ int seq_ioctl(FAR struct seq_s *seq, int fifoid, int cmd, unsigned long arg)
|
|||
|
||||
case SCUIOC_SETWATERMARK:
|
||||
{
|
||||
FAR struct scufifo_wm_s *wm =
|
||||
(FAR struct scufifo_wm_s *)(uintptr_t)arg;
|
||||
struct scufifo_wm_s *wm =
|
||||
(struct scufifo_wm_s *)(uintptr_t)arg;
|
||||
|
||||
ret = seq_setwatermark(seq, fifoid, wm);
|
||||
}
|
||||
|
|
@ -3397,7 +3397,7 @@ int seq_ioctl(FAR struct seq_s *seq, int fifoid, int cmd, unsigned long arg)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
void seq_close(FAR struct seq_s *seq)
|
||||
void seq_close(struct seq_s *seq)
|
||||
{
|
||||
irqstate_t flags;
|
||||
|
||||
|
|
@ -3405,7 +3405,7 @@ void seq_close(FAR struct seq_s *seq)
|
|||
|
||||
if (seq->type & SEQ_TYPE_DECI)
|
||||
{
|
||||
FAR struct decimator_s *deci = (FAR struct decimator_s *)seq;
|
||||
struct decimator_s *deci = (struct decimator_s *)seq;
|
||||
int i;
|
||||
|
||||
flags = enter_critical_section();
|
||||
|
|
|
|||
|
|
@ -351,68 +351,68 @@ static void cxd56_endtransfer(struct cxd56_sdiodev_s *priv,
|
|||
|
||||
/* Interrupt Handling *******************************************************/
|
||||
|
||||
static int cxd56_interrupt(int irq, FAR void *context, FAR void *arg);
|
||||
static int cxd56_interrupt(int irq, void *context, void *arg);
|
||||
|
||||
/* SDIO interface methods ***************************************************/
|
||||
|
||||
/* Mutual exclusion */
|
||||
|
||||
#ifdef CONFIG_SDIO_MUXBUS
|
||||
static int cxd56_sdio_lock(FAR struct sdio_dev_s *dev, bool lock);
|
||||
static int cxd56_sdio_lock(struct sdio_dev_s *dev, bool lock);
|
||||
#endif
|
||||
|
||||
/* Initialization/setup */
|
||||
|
||||
static void cxd56_sdio_sdhci_reset(FAR struct sdio_dev_s *dev);
|
||||
static sdio_capset_t cxd56_sdio_capabilities(FAR struct sdio_dev_s *dev);
|
||||
static sdio_statset_t cxd56_sdio_status(FAR struct sdio_dev_s *dev);
|
||||
static void cxd56_sdio_widebus(FAR struct sdio_dev_s *dev, bool enable);
|
||||
static void cxd56_sdio_sdhci_reset(struct sdio_dev_s *dev);
|
||||
static sdio_capset_t cxd56_sdio_capabilities(struct sdio_dev_s *dev);
|
||||
static sdio_statset_t cxd56_sdio_status(struct sdio_dev_s *dev);
|
||||
static void cxd56_sdio_widebus(struct sdio_dev_s *dev, bool enable);
|
||||
static void cxd56_sdio_frequency(uint32_t frequency);
|
||||
static void cxd56_sdio_clock(FAR struct sdio_dev_s *dev,
|
||||
static void cxd56_sdio_clock(struct sdio_dev_s *dev,
|
||||
enum sdio_clock_e rate);
|
||||
static int cxd56_sdio_attach(FAR struct sdio_dev_s *dev);
|
||||
static int cxd56_sdio_attach(struct sdio_dev_s *dev);
|
||||
|
||||
/* Command/Status/Data Transfer */
|
||||
|
||||
static int cxd56_sdio_sendcmd(FAR struct sdio_dev_s *dev,
|
||||
static int cxd56_sdio_sendcmd(struct sdio_dev_s *dev,
|
||||
uint32_t cmd, uint32_t arg);
|
||||
static void cxd56_blocksetup(FAR struct sdio_dev_s *dev,
|
||||
static void cxd56_blocksetup(struct sdio_dev_s *dev,
|
||||
unsigned int blocklen, unsigned int nblocks);
|
||||
#ifndef CONFIG_SDIO_DMA
|
||||
static int cxd56_sdio_recvsetup(FAR struct sdio_dev_s *dev,
|
||||
FAR uint8_t *buffer, size_t nbytes);
|
||||
static int cxd56_sdio_sendsetup(FAR struct sdio_dev_s *dev,
|
||||
FAR const uint8_t *buffer, uint32_t nbytes);
|
||||
static int cxd56_sdio_recvsetup(struct sdio_dev_s *dev,
|
||||
uint8_t *buffer, size_t nbytes);
|
||||
static int cxd56_sdio_sendsetup(struct sdio_dev_s *dev,
|
||||
const uint8_t *buffer, uint32_t nbytes);
|
||||
#endif
|
||||
static int cxd56_sdio_cancel(FAR struct sdio_dev_s *dev);
|
||||
static int cxd56_sdio_cancel(struct sdio_dev_s *dev);
|
||||
|
||||
static int cxd56_sdio_waitresponse(FAR struct sdio_dev_s *dev,
|
||||
static int cxd56_sdio_waitresponse(struct sdio_dev_s *dev,
|
||||
uint32_t cmd);
|
||||
static int cxd56_sdio_recvshortcrc(FAR struct sdio_dev_s *dev, uint32_t cmd,
|
||||
static int cxd56_sdio_recvshortcrc(struct sdio_dev_s *dev, uint32_t cmd,
|
||||
uint32_t *rshort);
|
||||
static int cxd56_sdio_recvlong(FAR struct sdio_dev_s *dev, uint32_t cmd,
|
||||
static int cxd56_sdio_recvlong(struct sdio_dev_s *dev, uint32_t cmd,
|
||||
uint32_t rlong[4]);
|
||||
static int cxd56_sdio_recvshort(FAR struct sdio_dev_s *dev, uint32_t cmd,
|
||||
static int cxd56_sdio_recvshort(struct sdio_dev_s *dev, uint32_t cmd,
|
||||
uint32_t *rshort);
|
||||
|
||||
/* EVENT handler */
|
||||
|
||||
static void cxd56_sdio_waitenable(FAR struct sdio_dev_s *dev,
|
||||
static void cxd56_sdio_waitenable(struct sdio_dev_s *dev,
|
||||
sdio_eventset_t eventset, uint32_t timeout);
|
||||
static sdio_eventset_t cxd56_sdio_eventwait(FAR struct sdio_dev_s *dev);
|
||||
static void cxd56_sdio_callbackenable(FAR struct sdio_dev_s *dev,
|
||||
static sdio_eventset_t cxd56_sdio_eventwait(struct sdio_dev_s *dev);
|
||||
static void cxd56_sdio_callbackenable(struct sdio_dev_s *dev,
|
||||
sdio_eventset_t eventset);
|
||||
static int cxd56_sdio_registercallback(FAR struct sdio_dev_s *dev,
|
||||
static int cxd56_sdio_registercallback(struct sdio_dev_s *dev,
|
||||
worker_t callback, void *arg);
|
||||
|
||||
/* DMA */
|
||||
|
||||
#ifdef CONFIG_SDIO_DMA
|
||||
static int cxd56_sdio_admasetup(FAR const uint8_t *buffer, size_t buflen);
|
||||
static int cxd56_sdio_dmarecvsetup(FAR struct sdio_dev_s *dev,
|
||||
FAR uint8_t *buffer, size_t buflen);
|
||||
static int cxd56_sdio_dmasendsetup(FAR struct sdio_dev_s *dev,
|
||||
FAR const uint8_t *buffer, size_t buflen);
|
||||
static int cxd56_sdio_admasetup(const uint8_t *buffer, size_t buflen);
|
||||
static int cxd56_sdio_dmarecvsetup(struct sdio_dev_s *dev,
|
||||
uint8_t *buffer, size_t buflen);
|
||||
static int cxd56_sdio_dmasendsetup(struct sdio_dev_s *dev,
|
||||
const uint8_t *buffer, size_t buflen);
|
||||
#endif
|
||||
|
||||
/* Initialization/uninitialization/reset ************************************/
|
||||
|
|
@ -477,7 +477,7 @@ static struct cxd56_sdhcregs_s g_sampleregs[DEBUG_NSAMPLES];
|
|||
/* DMA */
|
||||
|
||||
#ifdef CONFIG_SDIO_DMA
|
||||
static FAR uint32_t cxd56_sdhci_adma_dscr[CXD56_SDIO_MAX_LEN_ADMA_DSCR * 2];
|
||||
static uint32_t cxd56_sdhci_adma_dscr[CXD56_SDIO_MAX_LEN_ADMA_DSCR * 2];
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
|
|
@ -1105,7 +1105,7 @@ static void cxd56_endtransfer(struct cxd56_sdiodev_s *priv,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int cxd56_interrupt(int irq, FAR void *context, FAR void *arg)
|
||||
static int cxd56_interrupt(int irq, void *context, void *arg)
|
||||
{
|
||||
struct cxd56_sdiodev_s *priv = &g_sdhcdev;
|
||||
uint32_t enabled;
|
||||
|
|
@ -1257,7 +1257,7 @@ static int cxd56_interrupt(int irq, FAR void *context, FAR void *arg)
|
|||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_SDIO_MUXBUS
|
||||
static int cxd56_sdio_lock(FAR struct sdio_dev_s *dev, bool lock)
|
||||
static int cxd56_sdio_lock(struct sdio_dev_s *dev, bool lock)
|
||||
{
|
||||
/* Enable SD clock only while accessing to the SDIO. */
|
||||
|
||||
|
|
@ -1288,9 +1288,9 @@ static int cxd56_sdio_lock(FAR struct sdio_dev_s *dev, bool lock)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static void cxd56_sdio_sdhci_reset(FAR struct sdio_dev_s *dev)
|
||||
static void cxd56_sdio_sdhci_reset(struct sdio_dev_s *dev)
|
||||
{
|
||||
FAR struct cxd56_sdiodev_s *priv = (FAR struct cxd56_sdiodev_s *)dev;
|
||||
struct cxd56_sdiodev_s *priv = (struct cxd56_sdiodev_s *)dev;
|
||||
uint32_t regval;
|
||||
int32_t timeout = 100;
|
||||
|
||||
|
|
@ -1387,7 +1387,7 @@ static void cxd56_sdio_sdhci_reset(FAR struct sdio_dev_s *dev)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static sdio_capset_t cxd56_sdio_capabilities(FAR struct sdio_dev_s *dev)
|
||||
static sdio_capset_t cxd56_sdio_capabilities(struct sdio_dev_s *dev)
|
||||
{
|
||||
sdio_capset_t caps = 0;
|
||||
|
||||
|
|
@ -1422,7 +1422,7 @@ static sdio_capset_t cxd56_sdio_capabilities(FAR struct sdio_dev_s *dev)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static sdio_statset_t cxd56_sdio_status(FAR struct sdio_dev_s *dev)
|
||||
static sdio_statset_t cxd56_sdio_status(struct sdio_dev_s *dev)
|
||||
{
|
||||
struct cxd56_sdiodev_s *priv = (struct cxd56_sdiodev_s *)dev;
|
||||
return priv->cdstatus;
|
||||
|
|
@ -1445,7 +1445,7 @@ static sdio_statset_t cxd56_sdio_status(FAR struct sdio_dev_s *dev)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static void cxd56_sdio_widebus(FAR struct sdio_dev_s *dev, bool wide)
|
||||
static void cxd56_sdio_widebus(struct sdio_dev_s *dev, bool wide)
|
||||
{
|
||||
uint32_t regval;
|
||||
|
||||
|
|
@ -1515,7 +1515,7 @@ static void cxd56_sdio_frequency(uint32_t frequency)
|
|||
putreg32(regval, CXD56_SDHCI_SYSCTL);
|
||||
}
|
||||
|
||||
static void cxd56_sdio_clock(FAR struct sdio_dev_s *dev,
|
||||
static void cxd56_sdio_clock(struct sdio_dev_s *dev,
|
||||
enum sdio_clock_e rate)
|
||||
{
|
||||
uint32_t regval;
|
||||
|
|
@ -1637,7 +1637,7 @@ static void cxd56_sdio_clock(FAR struct sdio_dev_s *dev,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int cxd56_sdio_attach(FAR struct sdio_dev_s *dev)
|
||||
static int cxd56_sdio_attach(struct sdio_dev_s *dev)
|
||||
{
|
||||
int ret;
|
||||
|
||||
|
|
@ -1685,7 +1685,7 @@ static int cxd56_sdio_attach(FAR struct sdio_dev_s *dev)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int cxd56_sdio_sendcmd(FAR struct sdio_dev_s *dev, uint32_t cmd,
|
||||
static int cxd56_sdio_sendcmd(struct sdio_dev_s *dev, uint32_t cmd,
|
||||
uint32_t arg)
|
||||
{
|
||||
#ifdef CONFIG_SDIO_DMA
|
||||
|
|
@ -1884,7 +1884,7 @@ static int cxd56_sdio_sendcmd(FAR struct sdio_dev_s *dev, uint32_t cmd,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static void cxd56_blocksetup(FAR struct sdio_dev_s *dev,
|
||||
static void cxd56_blocksetup(struct sdio_dev_s *dev,
|
||||
unsigned int blocklen, unsigned int nblocks)
|
||||
{
|
||||
struct cxd56_sdiodev_s *priv = (struct cxd56_sdiodev_s *)dev;
|
||||
|
|
@ -1925,8 +1925,8 @@ static void cxd56_blocksetup(FAR struct sdio_dev_s *dev,
|
|||
****************************************************************************/
|
||||
|
||||
#ifndef CONFIG_SDIO_DMA
|
||||
static int cxd56_sdio_recvsetup(FAR struct sdio_dev_s *dev,
|
||||
FAR uint8_t *buffer, size_t nbytes)
|
||||
static int cxd56_sdio_recvsetup(struct sdio_dev_s *dev,
|
||||
uint8_t *buffer, size_t nbytes)
|
||||
{
|
||||
struct cxd56_sdiodev_s *priv = (struct cxd56_sdiodev_s *)dev;
|
||||
|
||||
|
|
@ -1983,8 +1983,8 @@ static int cxd56_sdio_recvsetup(FAR struct sdio_dev_s *dev,
|
|||
****************************************************************************/
|
||||
|
||||
#ifndef CONFIG_SDIO_DMA
|
||||
static int cxd56_sdio_sendsetup(FAR struct sdio_dev_s *dev,
|
||||
FAR const uint8_t *buffer, size_t nbytes)
|
||||
static int cxd56_sdio_sendsetup(struct sdio_dev_s *dev,
|
||||
const uint8_t *buffer, size_t nbytes)
|
||||
{
|
||||
struct cxd56_sdiodev_s *priv = (struct cxd56_sdiodev_s *)dev;
|
||||
|
||||
|
|
@ -2035,7 +2035,7 @@ static int cxd56_sdio_sendsetup(FAR struct sdio_dev_s *dev,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int cxd56_sdio_cancel(FAR struct sdio_dev_s *dev)
|
||||
static int cxd56_sdio_cancel(struct sdio_dev_s *dev)
|
||||
{
|
||||
struct cxd56_sdiodev_s *priv = (struct cxd56_sdiodev_s *)dev;
|
||||
uint32_t regval;
|
||||
|
|
@ -2120,7 +2120,7 @@ static int cxd56_sdio_cancel(FAR struct sdio_dev_s *dev)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int cxd56_sdio_waitresponse(FAR struct sdio_dev_s *dev, uint32_t cmd)
|
||||
static int cxd56_sdio_waitresponse(struct sdio_dev_s *dev, uint32_t cmd)
|
||||
{
|
||||
uint32_t errors;
|
||||
int32_t timeout = SDHCI_CMDTIMEOUT;
|
||||
|
|
@ -2227,7 +2227,7 @@ static int cxd56_sdio_waitresponse(FAR struct sdio_dev_s *dev, uint32_t cmd)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int cxd56_sdio_recvshortcrc(FAR struct sdio_dev_s *dev, uint32_t cmd,
|
||||
static int cxd56_sdio_recvshortcrc(struct sdio_dev_s *dev, uint32_t cmd,
|
||||
uint32_t *rshort)
|
||||
{
|
||||
uint32_t regval;
|
||||
|
|
@ -2314,7 +2314,7 @@ static int cxd56_sdio_recvshortcrc(FAR struct sdio_dev_s *dev, uint32_t cmd,
|
|||
return ret;
|
||||
}
|
||||
|
||||
static int cxd56_sdio_recvlong(FAR struct sdio_dev_s *dev, uint32_t cmd,
|
||||
static int cxd56_sdio_recvlong(struct sdio_dev_s *dev, uint32_t cmd,
|
||||
uint32_t rlong[4])
|
||||
{
|
||||
uint32_t regval;
|
||||
|
|
@ -2387,7 +2387,7 @@ static int cxd56_sdio_recvlong(FAR struct sdio_dev_s *dev, uint32_t cmd,
|
|||
return ret;
|
||||
}
|
||||
|
||||
static int cxd56_sdio_recvshort(FAR struct sdio_dev_s *dev, uint32_t cmd,
|
||||
static int cxd56_sdio_recvshort(struct sdio_dev_s *dev, uint32_t cmd,
|
||||
uint32_t *rshort)
|
||||
{
|
||||
uint32_t regval;
|
||||
|
|
@ -2492,7 +2492,7 @@ static int cxd56_sdio_recvshort(FAR struct sdio_dev_s *dev, uint32_t cmd,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static void cxd56_sdio_waitenable(FAR struct sdio_dev_s *dev,
|
||||
static void cxd56_sdio_waitenable(struct sdio_dev_s *dev,
|
||||
sdio_eventset_t eventset, uint32_t timeout)
|
||||
{
|
||||
struct cxd56_sdiodev_s *priv = (struct cxd56_sdiodev_s *)dev;
|
||||
|
|
@ -2571,7 +2571,7 @@ static void cxd56_sdio_waitenable(FAR struct sdio_dev_s *dev,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static sdio_eventset_t cxd56_sdio_eventwait(FAR struct sdio_dev_s *dev)
|
||||
static sdio_eventset_t cxd56_sdio_eventwait(struct sdio_dev_s *dev)
|
||||
{
|
||||
struct cxd56_sdiodev_s *priv = (struct cxd56_sdiodev_s *)dev;
|
||||
sdio_eventset_t wkupevent = 0;
|
||||
|
|
@ -2686,7 +2686,7 @@ static sdio_eventset_t cxd56_sdio_eventwait(FAR struct sdio_dev_s *dev)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static void cxd56_sdio_callbackenable(FAR struct sdio_dev_s *dev,
|
||||
static void cxd56_sdio_callbackenable(struct sdio_dev_s *dev,
|
||||
sdio_eventset_t eventset)
|
||||
{
|
||||
struct cxd56_sdiodev_s *priv = (struct cxd56_sdiodev_s *)dev;
|
||||
|
|
@ -2720,7 +2720,7 @@ static void cxd56_sdio_callbackenable(FAR struct sdio_dev_s *dev,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int cxd56_sdio_registercallback(FAR struct sdio_dev_s *dev,
|
||||
static int cxd56_sdio_registercallback(struct sdio_dev_s *dev,
|
||||
worker_t callback, void *arg)
|
||||
{
|
||||
struct cxd56_sdiodev_s *priv = (struct cxd56_sdiodev_s *)dev;
|
||||
|
|
@ -2754,7 +2754,7 @@ static int cxd56_sdio_registercallback(FAR struct sdio_dev_s *dev,
|
|||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_SDIO_DMA
|
||||
static int cxd56_sdio_admasetup(FAR const uint8_t *buffer, size_t buflen)
|
||||
static int cxd56_sdio_admasetup(const uint8_t *buffer, size_t buflen)
|
||||
{
|
||||
uint32_t dscr_top = CXD56_PHYSADDR(cxd56_sdhci_adma_dscr);
|
||||
uint32_t dscr_l;
|
||||
|
|
@ -2823,12 +2823,12 @@ static int cxd56_sdio_admasetup(FAR const uint8_t *buffer, size_t buflen)
|
|||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_SDIO_DMA
|
||||
static int cxd56_sdio_dmarecvsetup(FAR struct sdio_dev_s *dev,
|
||||
FAR uint8_t *buffer, size_t buflen)
|
||||
static int cxd56_sdio_dmarecvsetup(struct sdio_dev_s *dev,
|
||||
uint8_t *buffer, size_t buflen)
|
||||
{
|
||||
struct cxd56_sdiodev_s *priv = (struct cxd56_sdiodev_s *)dev;
|
||||
unsigned int blocksize;
|
||||
int ret = OK;
|
||||
int ret = OK;
|
||||
|
||||
DEBUGASSERT(priv != NULL && buffer != NULL && buflen > 0);
|
||||
DEBUGASSERT(((uint32_t)buffer & 3) == 0);
|
||||
|
|
@ -2940,8 +2940,8 @@ error:
|
|||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_SDIO_DMA
|
||||
static int cxd56_sdio_dmasendsetup(FAR struct sdio_dev_s *dev,
|
||||
FAR const uint8_t *buffer, size_t buflen)
|
||||
static int cxd56_sdio_dmasendsetup(struct sdio_dev_s *dev,
|
||||
const uint8_t *buffer, size_t buflen)
|
||||
{
|
||||
uint32_t r1;
|
||||
int ret = OK;
|
||||
|
|
@ -3198,7 +3198,7 @@ static void cxd56_sdio_callback(void *arg)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
FAR struct sdio_dev_s *cxd56_sdhci_initialize(int slotno)
|
||||
struct sdio_dev_s *cxd56_sdhci_initialize(int slotno)
|
||||
{
|
||||
uint32_t regval;
|
||||
#ifdef CONFIG_SDIO_DMA
|
||||
|
|
@ -3293,7 +3293,7 @@ FAR struct sdio_dev_s *cxd56_sdhci_initialize(int slotno)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
FAR struct sdio_dev_s *cxd56_sdhci_finalize(int slotno)
|
||||
struct sdio_dev_s *cxd56_sdhci_finalize(int slotno)
|
||||
{
|
||||
uint32_t regval;
|
||||
|
||||
|
|
@ -3349,7 +3349,7 @@ FAR struct sdio_dev_s *cxd56_sdhci_finalize(int slotno)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
void cxd56_sdhci_mediachange(FAR struct sdio_dev_s *dev)
|
||||
void cxd56_sdhci_mediachange(struct sdio_dev_s *dev)
|
||||
{
|
||||
struct cxd56_sdiodev_s *priv = (struct cxd56_sdiodev_s *)dev;
|
||||
sdio_statset_t cdstatus;
|
||||
|
|
@ -3422,7 +3422,7 @@ void cxd56_sdhci_mediachange(FAR struct sdio_dev_s *dev)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
void cxd56_sdhci_wrprotect(FAR struct sdio_dev_s *dev, bool wrprotect)
|
||||
void cxd56_sdhci_wrprotect(struct sdio_dev_s *dev, bool wrprotect)
|
||||
{
|
||||
struct cxd56_sdiodev_s *priv = (struct cxd56_sdiodev_s *)dev;
|
||||
irqstate_t flags;
|
||||
|
|
@ -3454,7 +3454,7 @@ void cxd56_sdhci_wrprotect(FAR struct sdio_dev_s *dev, bool wrprotect)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
void cxd56_sdio_resetstatus(FAR struct sdio_dev_s *dev)
|
||||
void cxd56_sdio_resetstatus(struct sdio_dev_s *dev)
|
||||
{
|
||||
struct cxd56_sdiodev_s *priv = (struct cxd56_sdiodev_s *)dev;
|
||||
priv->cdstatus = 0;
|
||||
|
|
|
|||
|
|
@ -424,7 +424,7 @@ struct sdio_dev_s;
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
FAR struct sdio_dev_s *cxd56_sdhci_initialize(int slotno);
|
||||
struct sdio_dev_s *cxd56_sdhci_initialize(int slotno);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: cxd56_sdhci_finalize
|
||||
|
|
@ -441,7 +441,7 @@ FAR struct sdio_dev_s *cxd56_sdhci_initialize(int slotno);
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
FAR struct sdio_dev_s *cxd56_sdhci_finalize(int slotno);
|
||||
struct sdio_dev_s *cxd56_sdhci_finalize(int slotno);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: cxd56_sdhci_mediachange
|
||||
|
|
@ -459,7 +459,7 @@ FAR struct sdio_dev_s *cxd56_sdhci_finalize(int slotno);
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
void cxd56_sdhci_mediachange(FAR struct sdio_dev_s *dev);
|
||||
void cxd56_sdhci_mediachange(struct sdio_dev_s *dev);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: sdio_wrprotect
|
||||
|
|
@ -477,7 +477,7 @@ void cxd56_sdhci_mediachange(FAR struct sdio_dev_s *dev);
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
void cxd56_sdhci_wrprotect(FAR struct sdio_dev_s *dev, bool wrprotect);
|
||||
void cxd56_sdhci_wrprotect(struct sdio_dev_s *dev, bool wrprotect);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: cxd56_sdio_resetstatus
|
||||
|
|
@ -490,7 +490,7 @@ void cxd56_sdhci_wrprotect(FAR struct sdio_dev_s *dev, bool wrprotect);
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
void cxd56_sdio_resetstatus(FAR struct sdio_dev_s *dev);
|
||||
void cxd56_sdio_resetstatus(struct sdio_dev_s *dev);
|
||||
|
||||
#undef EXTERN
|
||||
#ifdef __cplusplus
|
||||
|
|
|
|||
|
|
@ -94,23 +94,23 @@ struct up_dev_s
|
|||
#ifndef CONFIG_SUPPRESS_UART_CONFIG
|
||||
static void up_set_format(struct uart_dev_s *dev);
|
||||
#endif
|
||||
static int up_setup(FAR struct uart_dev_s *dev);
|
||||
static void up_shutdown(FAR struct uart_dev_s *dev);
|
||||
static int up_attach(FAR struct uart_dev_s *dev);
|
||||
static void up_detach(FAR struct uart_dev_s *dev);
|
||||
static int up_interrupt(int irq, FAR void *context, FAR void *arg);
|
||||
static int up_ioctl(FAR struct file *filep, int cmd, unsigned long arg);
|
||||
static int up_setup(struct uart_dev_s *dev);
|
||||
static void up_shutdown(struct uart_dev_s *dev);
|
||||
static int up_attach(struct uart_dev_s *dev);
|
||||
static void up_detach(struct uart_dev_s *dev);
|
||||
static int up_interrupt(int irq, void *context, void *arg);
|
||||
static int up_ioctl(struct file *filep, int cmd, unsigned long arg);
|
||||
#ifdef CONFIG_UART2_IFLOWCONTROL
|
||||
static bool up_rxflowcontrol(FAR struct uart_dev_s *dev,
|
||||
static bool up_rxflowcontrol(struct uart_dev_s *dev,
|
||||
unsigned int nbuffered, bool upper);
|
||||
#endif
|
||||
static int up_receive(FAR struct uart_dev_s *dev, FAR unsigned int *status);
|
||||
static void up_rxint(FAR struct uart_dev_s *dev, bool enable);
|
||||
static bool up_rxavailable(FAR struct uart_dev_s *dev);
|
||||
static void up_send(FAR struct uart_dev_s *dev, int ch);
|
||||
static void up_txint(FAR struct uart_dev_s *dev, bool enable);
|
||||
static bool up_txready(FAR struct uart_dev_s *dev);
|
||||
static bool up_txempty(FAR struct uart_dev_s *dev);
|
||||
static int up_receive(struct uart_dev_s *dev, unsigned int *status);
|
||||
static void up_rxint(struct uart_dev_s *dev, bool enable);
|
||||
static bool up_rxavailable(struct uart_dev_s *dev);
|
||||
static void up_send(struct uart_dev_s *dev, int ch);
|
||||
static void up_txint(struct uart_dev_s *dev, bool enable);
|
||||
static bool up_txready(struct uart_dev_s *dev);
|
||||
static bool up_txempty(struct uart_dev_s *dev);
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
|
|
@ -264,7 +264,7 @@ static uart_dev_t g_uart2port =
|
|||
* Name: up_serialin
|
||||
****************************************************************************/
|
||||
|
||||
static inline uint32_t up_serialin(FAR struct up_dev_s *priv, int offset)
|
||||
static inline uint32_t up_serialin(struct up_dev_s *priv, int offset)
|
||||
{
|
||||
return getreg32(priv->uartbase + offset);
|
||||
}
|
||||
|
|
@ -273,7 +273,7 @@ static inline uint32_t up_serialin(FAR struct up_dev_s *priv, int offset)
|
|||
* Name: up_serialout
|
||||
****************************************************************************/
|
||||
|
||||
static inline void up_serialout(FAR struct up_dev_s *priv, int offset,
|
||||
static inline void up_serialout(struct up_dev_s *priv, int offset,
|
||||
uint32_t value)
|
||||
{
|
||||
putreg32(value, priv->uartbase + offset);
|
||||
|
|
@ -283,8 +283,8 @@ static inline void up_serialout(FAR struct up_dev_s *priv, int offset,
|
|||
* Name: up_disableuartint
|
||||
****************************************************************************/
|
||||
|
||||
static inline void up_disableuartint(FAR struct up_dev_s *priv,
|
||||
FAR uint32_t *ier)
|
||||
static inline void up_disableuartint(struct up_dev_s *priv,
|
||||
uint32_t *ier)
|
||||
{
|
||||
irqstate_t flags;
|
||||
|
||||
|
|
@ -303,7 +303,7 @@ static inline void up_disableuartint(FAR struct up_dev_s *priv,
|
|||
* Name: up_restoreuartint
|
||||
****************************************************************************/
|
||||
|
||||
static inline void up_restoreuartint(FAR struct up_dev_s *priv, uint32_t ier)
|
||||
static inline void up_restoreuartint(struct up_dev_s *priv, uint32_t ier)
|
||||
{
|
||||
irqstate_t flags;
|
||||
|
||||
|
|
@ -317,7 +317,7 @@ static inline void up_restoreuartint(FAR struct up_dev_s *priv, uint32_t ier)
|
|||
* Name: up_enablebreaks
|
||||
****************************************************************************/
|
||||
|
||||
static inline void up_enablebreaks(FAR struct up_dev_s *priv, bool enable)
|
||||
static inline void up_enablebreaks(struct up_dev_s *priv, bool enable)
|
||||
{
|
||||
uint32_t lcr = up_serialin(priv, CXD56_UART_LCR_H);
|
||||
if (enable)
|
||||
|
|
@ -339,7 +339,7 @@ static inline void up_enablebreaks(FAR struct up_dev_s *priv, bool enable)
|
|||
#ifdef CONFIG_CXD56_UART2
|
||||
static int cxd56_serial2_pm_event(uint8_t id)
|
||||
{
|
||||
FAR struct up_dev_s *priv = (FAR struct up_dev_s *)&g_uart2priv;
|
||||
struct up_dev_s *priv = (struct up_dev_s *)&g_uart2priv;
|
||||
|
||||
switch (id)
|
||||
{
|
||||
|
|
@ -366,7 +366,7 @@ static int cxd56_serial2_pm_event(uint8_t id)
|
|||
#ifndef CONFIG_SUPPRESS_UART_CONFIG
|
||||
static void up_set_format(struct uart_dev_s *dev)
|
||||
{
|
||||
FAR struct up_dev_s *priv = (FAR struct up_dev_s *)dev->priv;
|
||||
struct up_dev_s *priv = (struct up_dev_s *)dev->priv;
|
||||
uint32_t lcr;
|
||||
uint32_t cr;
|
||||
uint32_t cr_en;
|
||||
|
|
@ -451,10 +451,10 @@ static void up_set_format(struct uart_dev_s *dev)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int up_setup(FAR struct uart_dev_s *dev)
|
||||
static int up_setup(struct uart_dev_s *dev)
|
||||
{
|
||||
#ifndef CONFIG_SUPPRESS_UART_CONFIG
|
||||
FAR struct up_dev_s *priv = (FAR struct up_dev_s *)dev->priv;
|
||||
struct up_dev_s *priv = (struct up_dev_s *)dev->priv;
|
||||
uint32_t lcr;
|
||||
uint32_t cr;
|
||||
|
||||
|
|
@ -524,9 +524,9 @@ static int up_setup(FAR struct uart_dev_s *dev)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static void up_shutdown(FAR struct uart_dev_s *dev)
|
||||
static void up_shutdown(struct uart_dev_s *dev)
|
||||
{
|
||||
FAR struct up_dev_s *priv = (FAR struct up_dev_s *)dev->priv;
|
||||
struct up_dev_s *priv = (struct up_dev_s *)dev->priv;
|
||||
|
||||
/* Disable further interrupts from the UART */
|
||||
|
||||
|
|
@ -572,9 +572,9 @@ static void up_shutdown(FAR struct uart_dev_s *dev)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int up_attach(FAR struct uart_dev_s *dev)
|
||||
static int up_attach(struct uart_dev_s *dev)
|
||||
{
|
||||
FAR struct up_dev_s *priv = (FAR struct up_dev_s *)dev->priv;
|
||||
struct up_dev_s *priv = (struct up_dev_s *)dev->priv;
|
||||
int ret;
|
||||
|
||||
/* Attach and enable the IRQ */
|
||||
|
|
@ -602,9 +602,9 @@ static int up_attach(FAR struct uart_dev_s *dev)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static void up_detach(FAR struct uart_dev_s *dev)
|
||||
static void up_detach(struct uart_dev_s *dev)
|
||||
{
|
||||
FAR struct up_dev_s *priv = (FAR struct up_dev_s *)dev->priv;
|
||||
struct up_dev_s *priv = (struct up_dev_s *)dev->priv;
|
||||
up_disable_irq(priv->irq);
|
||||
irq_detach(priv->irq);
|
||||
}
|
||||
|
|
@ -633,7 +633,7 @@ static void up_detach(FAR struct uart_dev_s *dev)
|
|||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_SERIAL_IFLOWCONTROL
|
||||
static bool up_rxflowcontrol(FAR struct uart_dev_s *dev,
|
||||
static bool up_rxflowcontrol(struct uart_dev_s *dev,
|
||||
unsigned int nbuffered, bool upper)
|
||||
{
|
||||
up_rxint(dev, !upper);
|
||||
|
|
@ -653,14 +653,14 @@ static bool up_rxflowcontrol(FAR struct uart_dev_s *dev,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int up_interrupt(int irq, FAR void *context, FAR void *arg)
|
||||
static int up_interrupt(int irq, void *context, void *arg)
|
||||
{
|
||||
FAR struct uart_dev_s *dev = (FAR struct uart_dev_s *)arg;
|
||||
FAR struct up_dev_s *priv;
|
||||
struct uart_dev_s *dev = (struct uart_dev_s *)arg;
|
||||
struct up_dev_s *priv;
|
||||
uint32_t status;
|
||||
int passes;
|
||||
|
||||
priv = (FAR struct up_dev_s *)dev->priv;
|
||||
priv = (struct up_dev_s *)dev->priv;
|
||||
|
||||
/* Loop until there are no characters to be transferred or,
|
||||
* until we have been looping for a long time.
|
||||
|
|
@ -733,19 +733,19 @@ static int up_interrupt(int irq, FAR void *context, FAR void *arg)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int up_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
|
||||
static int up_ioctl(struct file *filep, int cmd, unsigned long arg)
|
||||
{
|
||||
FAR struct inode *inode = filep->f_inode;
|
||||
FAR struct uart_dev_s *dev = inode->i_private;
|
||||
FAR struct up_dev_s *priv = (FAR struct up_dev_s *)dev->priv;
|
||||
int ret = OK;
|
||||
struct inode *inode = filep->f_inode;
|
||||
struct uart_dev_s *dev = inode->i_private;
|
||||
struct up_dev_s *priv = (struct up_dev_s *)dev->priv;
|
||||
int ret = OK;
|
||||
|
||||
switch (cmd)
|
||||
{
|
||||
#ifdef CONFIG_SERIAL_TIOCSERGSTRUCT
|
||||
case TIOCSERGSTRUCT:
|
||||
{
|
||||
FAR struct up_dev_s *user = (FAR struct up_dev_s *)arg;
|
||||
struct up_dev_s *user = (struct up_dev_s *)arg;
|
||||
if (!user)
|
||||
{
|
||||
ret = -EINVAL;
|
||||
|
|
@ -761,7 +761,7 @@ static int up_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
|
|||
#ifdef CONFIG_SERIAL_TERMIOS
|
||||
case TCGETS:
|
||||
{
|
||||
FAR struct termios *termiosp = (FAR struct termios *)arg;
|
||||
struct termios *termiosp = (struct termios *)arg;
|
||||
irqstate_t flags;
|
||||
|
||||
if (!termiosp)
|
||||
|
|
@ -810,7 +810,7 @@ static int up_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
|
|||
|
||||
case TCSETS:
|
||||
{
|
||||
FAR struct termios *termiosp = (FAR struct termios *)arg;
|
||||
struct termios *termiosp = (struct termios *)arg;
|
||||
irqstate_t flags;
|
||||
|
||||
if (!termiosp)
|
||||
|
|
@ -910,9 +910,9 @@ static int up_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int up_receive(FAR struct uart_dev_s *dev, FAR unsigned int *status)
|
||||
static int up_receive(struct uart_dev_s *dev, unsigned int *status)
|
||||
{
|
||||
FAR struct up_dev_s *priv = (struct up_dev_s *)dev->priv;
|
||||
struct up_dev_s *priv = (struct up_dev_s *)dev->priv;
|
||||
uint32_t rbr;
|
||||
|
||||
rbr = up_serialin(priv, CXD56_UART_DR);
|
||||
|
|
@ -928,9 +928,9 @@ static int up_receive(FAR struct uart_dev_s *dev, FAR unsigned int *status)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static void up_rxint(FAR struct uart_dev_s *dev, bool enable)
|
||||
static void up_rxint(struct uart_dev_s *dev, bool enable)
|
||||
{
|
||||
FAR struct up_dev_s *priv = (FAR struct up_dev_s *)dev->priv;
|
||||
struct up_dev_s *priv = (struct up_dev_s *)dev->priv;
|
||||
irqstate_t flags;
|
||||
|
||||
flags = spin_lock_irqsave(&priv->lock);
|
||||
|
|
@ -957,9 +957,9 @@ static void up_rxint(FAR struct uart_dev_s *dev, bool enable)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static bool up_rxavailable(FAR struct uart_dev_s *dev)
|
||||
static bool up_rxavailable(struct uart_dev_s *dev)
|
||||
{
|
||||
FAR struct up_dev_s *priv = (FAR struct up_dev_s *)dev->priv;
|
||||
struct up_dev_s *priv = (struct up_dev_s *)dev->priv;
|
||||
return ((up_serialin(priv, CXD56_UART_FR) & UART_FLAG_RXFE) == 0);
|
||||
}
|
||||
|
||||
|
|
@ -971,9 +971,9 @@ static bool up_rxavailable(FAR struct uart_dev_s *dev)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static void up_send(FAR struct uart_dev_s *dev, int ch)
|
||||
static void up_send(struct uart_dev_s *dev, int ch)
|
||||
{
|
||||
FAR struct up_dev_s *priv = (FAR struct up_dev_s *)dev->priv;
|
||||
struct up_dev_s *priv = (struct up_dev_s *)dev->priv;
|
||||
up_serialout(priv, CXD56_UART_DR, (uint32_t)ch);
|
||||
}
|
||||
|
||||
|
|
@ -985,9 +985,9 @@ static void up_send(FAR struct uart_dev_s *dev, int ch)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static void up_txint(FAR struct uart_dev_s *dev, bool enable)
|
||||
static void up_txint(struct uart_dev_s *dev, bool enable)
|
||||
{
|
||||
FAR struct up_dev_s *priv = (FAR struct up_dev_s *)dev->priv;
|
||||
struct up_dev_s *priv = (struct up_dev_s *)dev->priv;
|
||||
irqstate_t flags;
|
||||
|
||||
flags = spin_lock_irqsave(&priv->lock);
|
||||
|
|
@ -1027,9 +1027,9 @@ static void up_txint(FAR struct uart_dev_s *dev, bool enable)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static bool up_txready(FAR struct uart_dev_s *dev)
|
||||
static bool up_txready(struct uart_dev_s *dev)
|
||||
{
|
||||
FAR struct up_dev_s *priv = (FAR struct up_dev_s *)dev->priv;
|
||||
struct up_dev_s *priv = (struct up_dev_s *)dev->priv;
|
||||
return ((up_serialin(priv, CXD56_UART_FR) & UART_FLAG_TXFF) == 0);
|
||||
}
|
||||
|
||||
|
|
@ -1041,9 +1041,9 @@ static bool up_txready(FAR struct uart_dev_s *dev)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static bool up_txempty(FAR struct uart_dev_s *dev)
|
||||
static bool up_txempty(struct uart_dev_s *dev)
|
||||
{
|
||||
FAR struct up_dev_s *priv = (FAR struct up_dev_s *)dev->priv;
|
||||
struct up_dev_s *priv = (struct up_dev_s *)dev->priv;
|
||||
uint32_t rbr = 0;
|
||||
rbr = up_serialin(priv, CXD56_UART_FR);
|
||||
return (((rbr & UART_FLAG_TXFE) != 0) && ((rbr & UART_FLAG_BUSY) == 0));
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ static struct flash_controller_s g_sfc;
|
|||
* Name: cxd56_erase
|
||||
****************************************************************************/
|
||||
|
||||
static int cxd56_erase(FAR struct mtd_dev_s *dev, off_t startblock,
|
||||
static int cxd56_erase(struct mtd_dev_s *dev, off_t startblock,
|
||||
size_t nblocks)
|
||||
{
|
||||
int ret;
|
||||
|
|
@ -97,8 +97,8 @@ static int cxd56_erase(FAR struct mtd_dev_s *dev, off_t startblock,
|
|||
return OK;
|
||||
}
|
||||
|
||||
static ssize_t cxd56_bread(FAR struct mtd_dev_s *dev, off_t startblock,
|
||||
size_t nblocks, FAR uint8_t *buffer)
|
||||
static ssize_t cxd56_bread(struct mtd_dev_s *dev, off_t startblock,
|
||||
size_t nblocks, uint8_t *buffer)
|
||||
{
|
||||
int ret;
|
||||
|
||||
|
|
@ -115,8 +115,8 @@ static ssize_t cxd56_bread(FAR struct mtd_dev_s *dev, off_t startblock,
|
|||
return nblocks;
|
||||
}
|
||||
|
||||
static ssize_t cxd56_bwrite(FAR struct mtd_dev_s *dev, off_t startblock,
|
||||
size_t nblocks, FAR const uint8_t *buffer)
|
||||
static ssize_t cxd56_bwrite(struct mtd_dev_s *dev, off_t startblock,
|
||||
size_t nblocks, const uint8_t *buffer)
|
||||
{
|
||||
int ret;
|
||||
|
||||
|
|
@ -138,8 +138,8 @@ static ssize_t cxd56_bwrite(FAR struct mtd_dev_s *dev, off_t startblock,
|
|||
return nblocks;
|
||||
}
|
||||
|
||||
static ssize_t cxd56_read(FAR struct mtd_dev_s *dev, off_t offset,
|
||||
size_t nbytes, FAR uint8_t *buffer)
|
||||
static ssize_t cxd56_read(struct mtd_dev_s *dev, off_t offset,
|
||||
size_t nbytes, uint8_t *buffer)
|
||||
{
|
||||
int ret;
|
||||
|
||||
|
|
@ -155,8 +155,8 @@ static ssize_t cxd56_read(FAR struct mtd_dev_s *dev, off_t offset,
|
|||
}
|
||||
|
||||
#ifdef CONFIG_MTD_BYTE_WRITE
|
||||
static ssize_t cxd56_write(FAR struct mtd_dev_s *dev, off_t offset,
|
||||
size_t nbytes, FAR const uint8_t *buffer)
|
||||
static ssize_t cxd56_write(struct mtd_dev_s *dev, off_t offset,
|
||||
size_t nbytes, const uint8_t *buffer)
|
||||
{
|
||||
int ret;
|
||||
|
||||
|
|
@ -176,7 +176,7 @@ static ssize_t cxd56_write(FAR struct mtd_dev_s *dev, off_t offset,
|
|||
}
|
||||
#endif
|
||||
|
||||
static int cxd56_ioctl(FAR struct mtd_dev_s *dev, int cmd, unsigned long arg)
|
||||
static int cxd56_ioctl(struct mtd_dev_s *dev, int cmd, unsigned long arg)
|
||||
{
|
||||
struct flash_controller_s *priv = (struct flash_controller_s *)dev;
|
||||
int ret = OK;
|
||||
|
|
@ -185,8 +185,8 @@ static int cxd56_ioctl(FAR struct mtd_dev_s *dev, int cmd, unsigned long arg)
|
|||
{
|
||||
case MTDIOC_GEOMETRY:
|
||||
{
|
||||
FAR struct mtd_geometry_s *geo =
|
||||
(FAR struct mtd_geometry_s *)((uintptr_t)arg);
|
||||
struct mtd_geometry_s *geo =
|
||||
(struct mtd_geometry_s *)((uintptr_t)arg);
|
||||
finfo("cmd: GEOM\n");
|
||||
if (geo)
|
||||
{
|
||||
|
|
@ -214,8 +214,8 @@ static int cxd56_ioctl(FAR struct mtd_dev_s *dev, int cmd, unsigned long arg)
|
|||
|
||||
case BIOC_PARTINFO:
|
||||
{
|
||||
FAR struct partition_info_s *info =
|
||||
(FAR struct partition_info_s *)arg;
|
||||
struct partition_info_s *info =
|
||||
(struct partition_info_s *)arg;
|
||||
if (info != NULL)
|
||||
{
|
||||
info->numsectors = priv->density / PAGE_SIZE;
|
||||
|
|
@ -251,7 +251,7 @@ static int cxd56_ioctl(FAR struct mtd_dev_s *dev, int cmd, unsigned long arg)
|
|||
return ret;
|
||||
}
|
||||
|
||||
FAR struct mtd_dev_s *cxd56_sfc_initialize(void)
|
||||
struct mtd_dev_s *cxd56_sfc_initialize(void)
|
||||
{
|
||||
struct flash_controller_s *priv = &g_sfc;
|
||||
|
||||
|
|
@ -272,7 +272,7 @@ FAR struct mtd_dev_s *cxd56_sfc_initialize(void)
|
|||
|
||||
/* Allocate a buffer for the erase block cache */
|
||||
|
||||
priv->cache = (FAR uint8_t *)kmm_malloc(SPIFI_BLKSIZE);
|
||||
priv->cache = (uint8_t *)kmm_malloc(SPIFI_BLKSIZE);
|
||||
if (!priv->cache)
|
||||
{
|
||||
/* Allocation failed! */
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ extern "C"
|
|||
* Public Functions Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
FAR struct mtd_dev_s *cxd56_sfc_initialize(void);
|
||||
struct mtd_dev_s *cxd56_sfc_initialize(void);
|
||||
|
||||
#undef EXTERN
|
||||
#ifdef __cplusplus
|
||||
|
|
|
|||
|
|
@ -76,14 +76,14 @@ struct sph_dev_s
|
|||
* Private Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
static int sph_open(FAR struct file *filep);
|
||||
static int sph_ioctl(FAR struct file *filep, int cmd, unsigned long arg);
|
||||
static int sph_open(struct file *filep);
|
||||
static int sph_ioctl(struct file *filep, int cmd, unsigned long arg);
|
||||
static int sph_semtake(sem_t *id);
|
||||
static void sph_semgive(sem_t *id);
|
||||
static int sph_lock(FAR struct sph_dev_s *priv);
|
||||
static int sph_trylock(FAR struct sph_dev_s *priv);
|
||||
static inline int sph_unlock(FAR struct sph_dev_s *priv);
|
||||
static int cxd56_sphirqhandler(int irq, FAR void *context, FAR void *arg);
|
||||
static int sph_lock(struct sph_dev_s *priv);
|
||||
static int sph_trylock(struct sph_dev_s *priv);
|
||||
static inline int sph_unlock(struct sph_dev_s *priv);
|
||||
static int cxd56_sphirqhandler(int irq, void *context, void *arg);
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
|
|
@ -102,7 +102,7 @@ static int g_cpuid;
|
|||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
static int sph_open(FAR struct file *filep)
|
||||
static int sph_open(struct file *filep)
|
||||
{
|
||||
/* Exclusive access */
|
||||
|
||||
|
|
@ -114,10 +114,10 @@ static int sph_open(FAR struct file *filep)
|
|||
return OK;
|
||||
}
|
||||
|
||||
static int sph_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
|
||||
static int sph_ioctl(struct file *filep, int cmd, unsigned long arg)
|
||||
{
|
||||
FAR struct sph_dev_s *priv =
|
||||
(FAR struct sph_dev_s *)filep->f_inode->i_private;
|
||||
struct sph_dev_s *priv =
|
||||
(struct sph_dev_s *)filep->f_inode->i_private;
|
||||
int ret = -ENOTTY;
|
||||
|
||||
hsinfo("cmd = %x\n", cmd);
|
||||
|
|
@ -158,7 +158,7 @@ static void sph_semgive(sem_t *id)
|
|||
nxsem_post(id);
|
||||
}
|
||||
|
||||
static int sph_lock(FAR struct sph_dev_s *priv)
|
||||
static int sph_lock(struct sph_dev_s *priv)
|
||||
{
|
||||
uint32_t sts;
|
||||
int ret;
|
||||
|
|
@ -201,7 +201,7 @@ static int sph_lock(FAR struct sph_dev_s *priv)
|
|||
return OK;
|
||||
}
|
||||
|
||||
static int sph_trylock(FAR struct sph_dev_s *priv)
|
||||
static int sph_trylock(struct sph_dev_s *priv)
|
||||
{
|
||||
uint32_t sts;
|
||||
|
||||
|
|
@ -221,22 +221,22 @@ static int sph_trylock(FAR struct sph_dev_s *priv)
|
|||
return -EBUSY;
|
||||
}
|
||||
|
||||
static inline int sph_unlock(FAR struct sph_dev_s *priv)
|
||||
static inline int sph_unlock(struct sph_dev_s *priv)
|
||||
{
|
||||
putreg32(REQ_UNLOCK, CXD56_SPH_REQ(priv->id));
|
||||
hsinfo("hsem%d is unlocked.\n", priv->id);
|
||||
return OK;
|
||||
}
|
||||
|
||||
static inline int cxd56_sphdevinit(FAR const char *devname, int num)
|
||||
static inline int cxd56_sphdevinit(const char *devname, int num)
|
||||
{
|
||||
FAR struct sph_dev_s *priv = &g_sphdev[num];
|
||||
struct sph_dev_s *priv = &g_sphdev[num];
|
||||
char fullpath[64];
|
||||
int ret;
|
||||
|
||||
snprintf(fullpath, sizeof(fullpath), "/dev/%s%d", devname, num);
|
||||
|
||||
ret = register_driver(fullpath, &sph_fops, 0666, (FAR void *)priv);
|
||||
ret = register_driver(fullpath, &sph_fops, 0666, (void *)priv);
|
||||
if (ret != 0)
|
||||
{
|
||||
return ERROR;
|
||||
|
|
@ -252,7 +252,7 @@ static inline int cxd56_sphdevinit(FAR const char *devname, int num)
|
|||
return OK;
|
||||
}
|
||||
|
||||
static int cxd56_sphirqhandler(int irq, FAR void *context, FAR void *arg)
|
||||
static int cxd56_sphirqhandler(int irq, void *context, void *arg)
|
||||
{
|
||||
int id;
|
||||
|
||||
|
|
@ -277,7 +277,7 @@ static int cxd56_sphirqhandler(int irq, FAR void *context, FAR void *arg)
|
|||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
int cxd56_sphinitialize(FAR const char *devname)
|
||||
int cxd56_sphinitialize(const char *devname)
|
||||
{
|
||||
int ret;
|
||||
int i;
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ extern "C"
|
|||
* Public Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
int cxd56_sphinitialize(FAR const char *devname);
|
||||
int cxd56_sphinitialize(const char *devname);
|
||||
|
||||
#undef EXTERN
|
||||
#ifdef __cplusplus
|
||||
|
|
|
|||
|
|
@ -92,46 +92,46 @@ struct cxd56_spidev_s
|
|||
|
||||
/* Helpers */
|
||||
|
||||
static inline uint32_t spi_getreg(FAR struct cxd56_spidev_s *priv,
|
||||
static inline uint32_t spi_getreg(struct cxd56_spidev_s *priv,
|
||||
uint8_t offset);
|
||||
static inline void spi_putreg(FAR struct cxd56_spidev_s *priv,
|
||||
static inline void spi_putreg(struct cxd56_spidev_s *priv,
|
||||
uint8_t offset, uint32_t value);
|
||||
|
||||
/* DMA support */
|
||||
|
||||
#ifdef CONFIG_CXD56_DMAC
|
||||
static void unused_code spi_dmaexchange(FAR struct spi_dev_s *dev,
|
||||
FAR const void *txbuffer,
|
||||
FAR void *rxbuffer, size_t nwords);
|
||||
static void spi_dmatrxwait(FAR struct cxd56_spidev_s *priv);
|
||||
static void unused_code spi_dmaexchange(struct spi_dev_s *dev,
|
||||
const void *txbuffer,
|
||||
void *rxbuffer, size_t nwords);
|
||||
static void spi_dmatrxwait(struct cxd56_spidev_s *priv);
|
||||
static void spi_dmatxcallback(DMA_HANDLE handle, uint8_t status, void *data);
|
||||
static void spi_dmarxcallback(DMA_HANDLE handle, uint8_t status, void *data);
|
||||
static void spi_dmatxsetup(FAR struct cxd56_spidev_s *priv,
|
||||
FAR const void *txbuffer, size_t nwords);
|
||||
static void spi_dmarxsetup(FAR struct cxd56_spidev_s *priv,
|
||||
FAR const void *rxbuffer, size_t nwords);
|
||||
static void spi_dmatxsetup(struct cxd56_spidev_s *priv,
|
||||
const void *txbuffer, size_t nwords);
|
||||
static void spi_dmarxsetup(struct cxd56_spidev_s *priv,
|
||||
const void *rxbuffer, size_t nwords);
|
||||
#ifndef CONFIG_SPI_EXCHANGE
|
||||
static void spi_dmasndblock(FAR struct spi_dev_s *dev,
|
||||
FAR const void *buffer, size_t nwords);
|
||||
static void spi_dmasndblock(struct spi_dev_s *dev,
|
||||
const void *buffer, size_t nwords);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* SPI methods */
|
||||
|
||||
static int spi_lock(FAR struct spi_dev_s *dev, bool lock);
|
||||
static uint32_t spi_setfrequency(FAR struct spi_dev_s *dev,
|
||||
static int spi_lock(struct spi_dev_s *dev, bool lock);
|
||||
static uint32_t spi_setfrequency(struct spi_dev_s *dev,
|
||||
uint32_t frequency);
|
||||
static void spi_setmode(FAR struct spi_dev_s *dev, enum spi_mode_e mode);
|
||||
static void spi_setbits(FAR struct spi_dev_s *dev, int nbits);
|
||||
static uint32_t spi_send(FAR struct spi_dev_s *dev, uint32_t wd);
|
||||
static void unused_code spi_exchange(FAR struct spi_dev_s *dev,
|
||||
FAR const void *txbuffer,
|
||||
FAR void *rxbuffer,
|
||||
static void spi_setmode(struct spi_dev_s *dev, enum spi_mode_e mode);
|
||||
static void spi_setbits(struct spi_dev_s *dev, int nbits);
|
||||
static uint32_t spi_send(struct spi_dev_s *dev, uint32_t wd);
|
||||
static void unused_code spi_exchange(struct spi_dev_s *dev,
|
||||
const void *txbuffer,
|
||||
void *rxbuffer,
|
||||
size_t nwords);
|
||||
#ifndef CONFIG_SPI_EXCHANGE
|
||||
static void spi_sndblock(FAR struct spi_dev_s *dev, FAR const void *buffer,
|
||||
static void spi_sndblock(struct spi_dev_s *dev, const void *buffer,
|
||||
size_t nwords);
|
||||
static void spi_recvblock(FAR struct spi_dev_s *dev, FAR void *buffer,
|
||||
static void spi_recvblock(struct spi_dev_s *dev, void *buffer,
|
||||
size_t nwords);
|
||||
#endif
|
||||
|
||||
|
|
@ -347,7 +347,7 @@ static struct pm_cpu_freqlock_s g_hold_lock =
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static inline uint32_t spi_getreg(FAR struct cxd56_spidev_s *priv,
|
||||
static inline uint32_t spi_getreg(struct cxd56_spidev_s *priv,
|
||||
uint8_t offset)
|
||||
{
|
||||
return getreg32(priv->spibase + (uint32_t)offset);
|
||||
|
|
@ -369,7 +369,7 @@ static inline uint32_t spi_getreg(FAR struct cxd56_spidev_s *priv,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static inline void spi_putreg(FAR struct cxd56_spidev_s *priv,
|
||||
static inline void spi_putreg(struct cxd56_spidev_s *priv,
|
||||
uint8_t offset, uint32_t value)
|
||||
{
|
||||
putreg32(value, priv->spibase + (uint32_t)offset);
|
||||
|
|
@ -396,9 +396,9 @@ static inline void spi_putreg(FAR struct cxd56_spidev_s *priv,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int spi_lock(FAR struct spi_dev_s *dev, bool lock)
|
||||
static int spi_lock(struct spi_dev_s *dev, bool lock)
|
||||
{
|
||||
FAR struct cxd56_spidev_s *priv = (FAR struct cxd56_spidev_s *)dev;
|
||||
struct cxd56_spidev_s *priv = (struct cxd56_spidev_s *)dev;
|
||||
|
||||
if (lock)
|
||||
{
|
||||
|
|
@ -427,10 +427,10 @@ static int spi_lock(FAR struct spi_dev_s *dev, bool lock)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static uint32_t spi_setfrequency(FAR struct spi_dev_s *dev,
|
||||
static uint32_t spi_setfrequency(struct spi_dev_s *dev,
|
||||
uint32_t frequency)
|
||||
{
|
||||
FAR struct cxd56_spidev_s *priv = (FAR struct cxd56_spidev_s *)dev;
|
||||
struct cxd56_spidev_s *priv = (struct cxd56_spidev_s *)dev;
|
||||
uint32_t divisor;
|
||||
uint32_t actual;
|
||||
|
||||
|
|
@ -496,9 +496,9 @@ static uint32_t spi_setfrequency(FAR struct spi_dev_s *dev,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static void spi_setmode(FAR struct spi_dev_s *dev, enum spi_mode_e mode)
|
||||
static void spi_setmode(struct spi_dev_s *dev, enum spi_mode_e mode)
|
||||
{
|
||||
FAR struct cxd56_spidev_s *priv = (FAR struct cxd56_spidev_s *)dev;
|
||||
struct cxd56_spidev_s *priv = (struct cxd56_spidev_s *)dev;
|
||||
uint32_t regval;
|
||||
uint32_t cr1val;
|
||||
|
||||
|
|
@ -581,9 +581,9 @@ static void spi_setmode(FAR struct spi_dev_s *dev, enum spi_mode_e mode)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static void spi_setbits(FAR struct spi_dev_s *dev, int nbits)
|
||||
static void spi_setbits(struct spi_dev_s *dev, int nbits)
|
||||
{
|
||||
FAR struct cxd56_spidev_s *priv = (FAR struct cxd56_spidev_s *)dev;
|
||||
struct cxd56_spidev_s *priv = (struct cxd56_spidev_s *)dev;
|
||||
uint32_t regval;
|
||||
|
||||
/* Has the number of bits changed? */
|
||||
|
|
@ -646,9 +646,9 @@ static void spi_setbits(FAR struct spi_dev_s *dev, int nbits)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static uint32_t spi_send(FAR struct spi_dev_s *dev, uint32_t wd)
|
||||
static uint32_t spi_send(struct spi_dev_s *dev, uint32_t wd)
|
||||
{
|
||||
FAR struct cxd56_spidev_s *priv = (FAR struct cxd56_spidev_s *)dev;
|
||||
struct cxd56_spidev_s *priv = (struct cxd56_spidev_s *)dev;
|
||||
register uint32_t regval;
|
||||
register uint32_t cr1val = 0;
|
||||
|
||||
|
|
@ -724,25 +724,25 @@ static uint32_t spi_send(FAR struct spi_dev_s *dev, uint32_t wd)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static void spi_do_exchange(FAR struct spi_dev_s *dev,
|
||||
FAR const void *txbuffer, FAR void *rxbuffer,
|
||||
static void spi_do_exchange(struct spi_dev_s *dev,
|
||||
const void *txbuffer, void *rxbuffer,
|
||||
size_t nwords)
|
||||
{
|
||||
FAR struct cxd56_spidev_s *priv = (FAR struct cxd56_spidev_s *)dev;
|
||||
struct cxd56_spidev_s *priv = (struct cxd56_spidev_s *)dev;
|
||||
uint32_t regval = 0;
|
||||
|
||||
union
|
||||
{
|
||||
FAR const uint8_t *p8;
|
||||
FAR const uint16_t *p16;
|
||||
FAR const void *pv;
|
||||
const uint8_t *p8;
|
||||
const uint16_t *p16;
|
||||
const void *pv;
|
||||
} tx;
|
||||
|
||||
union
|
||||
{
|
||||
FAR uint8_t *p8;
|
||||
FAR uint16_t *p16;
|
||||
FAR void *pv;
|
||||
uint8_t *p8;
|
||||
uint16_t *p16;
|
||||
void *pv;
|
||||
} rx;
|
||||
|
||||
uint32_t data;
|
||||
|
|
@ -859,11 +859,11 @@ static void spi_do_exchange(FAR struct spi_dev_s *dev,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static void spi_exchange(FAR struct spi_dev_s *dev, FAR const void *txbuffer,
|
||||
FAR void *rxbuffer, size_t nwords)
|
||||
static void spi_exchange(struct spi_dev_s *dev, const void *txbuffer,
|
||||
void *rxbuffer, size_t nwords)
|
||||
{
|
||||
#ifdef CONFIG_CXD56_DMAC
|
||||
FAR struct cxd56_spidev_s *priv = (FAR struct cxd56_spidev_s *)dev;
|
||||
struct cxd56_spidev_s *priv = (struct cxd56_spidev_s *)dev;
|
||||
|
||||
#ifdef CONFIG_CXD56_SPI_DMATHRESHOLD
|
||||
size_t dmath = CONFIG_CXD56_SPI_DMATHRESHOLD;
|
||||
|
|
@ -903,7 +903,7 @@ static void spi_exchange(FAR struct spi_dev_s *dev, FAR const void *txbuffer,
|
|||
****************************************************************************/
|
||||
|
||||
#ifndef CONFIG_SPI_EXCHANGE
|
||||
static void spi_sndblock(FAR struct spi_dev_s *dev, FAR const void *buffer,
|
||||
static void spi_sndblock(struct spi_dev_s *dev, const void *buffer,
|
||||
size_t nwords)
|
||||
{
|
||||
return spi_exchange(dev, buffer, NULL, nwords);
|
||||
|
|
@ -929,7 +929,7 @@ static void spi_sndblock(FAR struct spi_dev_s *dev, FAR const void *buffer,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static void spi_recvblock(FAR struct spi_dev_s *dev, FAR void *buffer,
|
||||
static void spi_recvblock(struct spi_dev_s *dev, void *buffer,
|
||||
size_t nwords)
|
||||
{
|
||||
return spi_exchange(dev, NULL, buffer, nwords);
|
||||
|
|
@ -1081,7 +1081,7 @@ static void cxd56_spi_pincontrol(int ch, bool on)
|
|||
|
||||
static int spi4_colockchange(uint8_t id)
|
||||
{
|
||||
FAR struct cxd56_spidev_s *priv = &g_spi4dev;
|
||||
struct cxd56_spidev_s *priv = &g_spi4dev;
|
||||
|
||||
switch (id)
|
||||
{
|
||||
|
|
@ -1112,7 +1112,7 @@ static int spi4_colockchange(uint8_t id)
|
|||
|
||||
static int spi5_colockchange(uint8_t id)
|
||||
{
|
||||
FAR struct cxd56_spidev_s *priv = &g_spi5dev;
|
||||
struct cxd56_spidev_s *priv = &g_spi5dev;
|
||||
|
||||
switch (id)
|
||||
{
|
||||
|
|
@ -1146,9 +1146,9 @@ static int spi5_colockchange(uint8_t id)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
FAR struct spi_dev_s *cxd56_spibus_initialize(int port)
|
||||
struct spi_dev_s *cxd56_spibus_initialize(int port)
|
||||
{
|
||||
FAR struct cxd56_spidev_s *priv;
|
||||
struct cxd56_spidev_s *priv;
|
||||
uint32_t regval;
|
||||
int i;
|
||||
|
||||
|
|
@ -1242,7 +1242,7 @@ FAR struct spi_dev_s *cxd56_spibus_initialize(int port)
|
|||
|
||||
/* Select a default frequency of approx. 400KHz */
|
||||
|
||||
spi_setfrequency((FAR struct spi_dev_s *)priv, 400000);
|
||||
spi_setfrequency((struct spi_dev_s *)priv, 400000);
|
||||
|
||||
/* Initialize the SPI semaphore that enforces mutually exclusive access */
|
||||
|
||||
|
|
@ -1298,9 +1298,9 @@ FAR struct spi_dev_s *cxd56_spibus_initialize(int port)
|
|||
****************************************************************************/
|
||||
|
||||
void cxd56_spi_dmaconfig(int port, int chtype, DMA_HANDLE handle,
|
||||
FAR dma_config_t *conf)
|
||||
dma_config_t *conf)
|
||||
{
|
||||
FAR struct cxd56_spidev_s *priv = NULL;
|
||||
struct cxd56_spidev_s *priv = NULL;
|
||||
|
||||
switch (port)
|
||||
{
|
||||
|
|
@ -1370,9 +1370,9 @@ void cxd56_spi_dmaconfig(int port, int chtype, DMA_HANDLE handle,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
void spi_flush(FAR struct spi_dev_s *dev)
|
||||
void spi_flush(struct spi_dev_s *dev)
|
||||
{
|
||||
FAR struct cxd56_spidev_s *priv = (FAR struct cxd56_spidev_s *)dev;
|
||||
struct cxd56_spidev_s *priv = (struct cxd56_spidev_s *)dev;
|
||||
uint32_t regval = 0;
|
||||
|
||||
/* Prohibit the clock change during SPI transfer */
|
||||
|
|
@ -1438,11 +1438,11 @@ void spi_flush(FAR struct spi_dev_s *dev)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static void spi_dmaexchange(FAR struct spi_dev_s *dev,
|
||||
FAR const void *txbuffer,
|
||||
FAR void *rxbuffer, size_t nwords)
|
||||
static void spi_dmaexchange(struct spi_dev_s *dev,
|
||||
const void *txbuffer,
|
||||
void *rxbuffer, size_t nwords)
|
||||
{
|
||||
FAR struct cxd56_spidev_s *priv = (FAR struct cxd56_spidev_s *)dev;
|
||||
struct cxd56_spidev_s *priv = (struct cxd56_spidev_s *)dev;
|
||||
uint32_t regval = 0;
|
||||
|
||||
DEBUGASSERT(priv && priv->spibase);
|
||||
|
|
@ -1503,8 +1503,8 @@ static void spi_dmaexchange(FAR struct spi_dev_s *dev,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static void spi_dmasndblock(FAR struct spi_dev_s *dev,
|
||||
FAR const void *buffer, size_t nwords)
|
||||
static void spi_dmasndblock(struct spi_dev_s *dev,
|
||||
const void *buffer, size_t nwords)
|
||||
{
|
||||
spi_dmaexchange(dev, buffer, NULL, nwords);
|
||||
}
|
||||
|
|
@ -1517,8 +1517,8 @@ static void spi_dmasndblock(FAR struct spi_dev_s *dev,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static void spi_dmarecvblock(FAR struct spi_dev_s *dev,
|
||||
FAR const void *buffer, size_t nwords)
|
||||
static void spi_dmarecvblock(struct spi_dev_s *dev,
|
||||
const void *buffer, size_t nwords)
|
||||
{
|
||||
spi_dmaexchange(dev, NULL, buffer, nwords);
|
||||
}
|
||||
|
|
@ -1534,7 +1534,7 @@ static void spi_dmarecvblock(FAR struct spi_dev_s *dev,
|
|||
|
||||
static void spi_dmatxcallback(DMA_HANDLE handle, uint8_t status, void *data)
|
||||
{
|
||||
FAR struct cxd56_spidev_s *priv = (FAR struct cxd56_spidev_s *)data;
|
||||
struct cxd56_spidev_s *priv = (struct cxd56_spidev_s *)data;
|
||||
|
||||
/* Wake-up the SPI driver */
|
||||
|
||||
|
|
@ -1556,7 +1556,7 @@ static void spi_dmatxcallback(DMA_HANDLE handle, uint8_t status, void *data)
|
|||
|
||||
static void spi_dmarxcallback(DMA_HANDLE handle, uint8_t status, void *data)
|
||||
{
|
||||
FAR struct cxd56_spidev_s *priv = (FAR struct cxd56_spidev_s *)data;
|
||||
struct cxd56_spidev_s *priv = (struct cxd56_spidev_s *)data;
|
||||
|
||||
/* Wake-up the SPI driver */
|
||||
|
||||
|
|
@ -1576,8 +1576,8 @@ static void spi_dmarxcallback(DMA_HANDLE handle, uint8_t status, void *data)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static void spi_dmatxsetup(FAR struct cxd56_spidev_s *priv,
|
||||
FAR const void *txbuffer, size_t nwords)
|
||||
static void spi_dmatxsetup(struct cxd56_spidev_s *priv,
|
||||
const void *txbuffer, size_t nwords)
|
||||
{
|
||||
uint32_t dst;
|
||||
uint32_t val;
|
||||
|
|
@ -1599,8 +1599,8 @@ static void spi_dmatxsetup(FAR struct cxd56_spidev_s *priv,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static void spi_dmarxsetup(FAR struct cxd56_spidev_s *priv,
|
||||
FAR const void *rxbuffer, size_t nwords)
|
||||
static void spi_dmarxsetup(struct cxd56_spidev_s *priv,
|
||||
const void *rxbuffer, size_t nwords)
|
||||
{
|
||||
uint32_t src;
|
||||
uint32_t val;
|
||||
|
|
@ -1622,7 +1622,7 @@ static void spi_dmarxsetup(FAR struct cxd56_spidev_s *priv,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static void spi_dmatrxwait(FAR struct cxd56_spidev_s *priv)
|
||||
static void spi_dmatrxwait(struct cxd56_spidev_s *priv)
|
||||
{
|
||||
uint32_t val;
|
||||
|
||||
|
|
|
|||
|
|
@ -99,7 +99,7 @@ extern "C"
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
FAR struct spi_dev_s *cxd56_spibus_initialize(int port);
|
||||
struct spi_dev_s *cxd56_spibus_initialize(int port);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: cxd56_spi_dmaconfig
|
||||
|
|
@ -120,7 +120,7 @@ FAR struct spi_dev_s *cxd56_spibus_initialize(int port);
|
|||
|
||||
#ifdef CONFIG_CXD56_DMAC
|
||||
void cxd56_spi_dmaconfig(int port, int chtype, DMA_HANDLE handle,
|
||||
FAR dma_config_t *conf);
|
||||
dma_config_t *conf);
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
|
|
@ -140,52 +140,52 @@ void cxd56_spi_dmaconfig(int port, int chtype, DMA_HANDLE handle,
|
|||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_CXD56_SPI0
|
||||
void cxd56_spi0select(FAR struct spi_dev_s *dev,
|
||||
void cxd56_spi0select(struct spi_dev_s *dev,
|
||||
uint32_t devid,
|
||||
bool selected);
|
||||
uint8_t cxd56_spi0status(FAR struct spi_dev_s *dev,
|
||||
uint8_t cxd56_spi0status(struct spi_dev_s *dev,
|
||||
uint32_t devid);
|
||||
#ifdef CONFIG_SPI_CMDDATA
|
||||
int cxd56_spi0cmddata(FAR struct spi_dev_s *dev,
|
||||
int cxd56_spi0cmddata(struct spi_dev_s *dev,
|
||||
uint32_t devid,
|
||||
bool cmd);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_CXD56_SPI3
|
||||
void cxd56_spi3select(FAR struct spi_dev_s *dev,
|
||||
void cxd56_spi3select(struct spi_dev_s *dev,
|
||||
uint32_t devid,
|
||||
bool selected);
|
||||
uint8_t cxd56_spi3status(FAR struct spi_dev_s *dev,
|
||||
uint8_t cxd56_spi3status(struct spi_dev_s *dev,
|
||||
uint32_t devid);
|
||||
#ifdef CONFIG_SPI_CMDDATA
|
||||
int cxd56_spi3cmddata(FAR struct spi_dev_s *dev,
|
||||
int cxd56_spi3cmddata(struct spi_dev_s *dev,
|
||||
uint32_t devid,
|
||||
bool cmd);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_CXD56_SPI4
|
||||
void cxd56_spi4select(FAR struct spi_dev_s *dev,
|
||||
void cxd56_spi4select(struct spi_dev_s *dev,
|
||||
uint32_t devid,
|
||||
bool selected);
|
||||
uint8_t cxd56_spi4status(FAR struct spi_dev_s *dev,
|
||||
uint8_t cxd56_spi4status(struct spi_dev_s *dev,
|
||||
uint32_t devid);
|
||||
#ifdef CONFIG_SPI_CMDDATA
|
||||
int cxd56_spi4cmddata(FAR struct spi_dev_s *dev,
|
||||
int cxd56_spi4cmddata(struct spi_dev_s *dev,
|
||||
uint32_t devid,
|
||||
bool cmd);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_CXD56_SPI5
|
||||
void cxd56_spi5select(FAR struct spi_dev_s *dev,
|
||||
void cxd56_spi5select(struct spi_dev_s *dev,
|
||||
uint32_t devid,
|
||||
bool selected);
|
||||
uint8_t cxd56_spi5status(FAR struct spi_dev_s *dev,
|
||||
uint8_t cxd56_spi5status(struct spi_dev_s *dev,
|
||||
uint32_t devid);
|
||||
#ifdef CONFIG_SPI_CMDDATA
|
||||
int cxd56_spi5cmddata(FAR struct spi_dev_s *dev,
|
||||
int cxd56_spi5cmddata(struct spi_dev_s *dev,
|
||||
uint32_t devid,
|
||||
bool cmd);
|
||||
#endif
|
||||
|
|
@ -207,7 +207,7 @@ int cxd56_spi5cmddata(FAR struct spi_dev_s *dev,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
void spi_flush(FAR struct spi_dev_s *dev);
|
||||
void spi_flush(struct spi_dev_s *dev);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: cxd56_spiXregister
|
||||
|
|
@ -231,23 +231,23 @@ void spi_flush(FAR struct spi_dev_s *dev);
|
|||
|
||||
#ifdef CONFIG_SPI_CALLBACK
|
||||
#ifdef CONFIG_CXD56_SPI0
|
||||
int cxd56_spi0register(FAR struct spi_dev_s *dev, spi_mediachange_t callback,
|
||||
FAR void *arg);
|
||||
int cxd56_spi0register(struct spi_dev_s *dev, spi_mediachange_t callback,
|
||||
void *arg);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_CXD56_SPI3
|
||||
int cxd56_spi3register(FAR struct spi_dev_s *dev, spi_mediachange_t callback,
|
||||
FAR void *arg);
|
||||
int cxd56_spi3register(struct spi_dev_s *dev, spi_mediachange_t callback,
|
||||
void *arg);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_CXD56_SPI4
|
||||
int cxd56_spi4register(FAR struct spi_dev_s *dev, spi_mediachange_t callback,
|
||||
FAR void *arg);
|
||||
int cxd56_spi4register(struct spi_dev_s *dev, spi_mediachange_t callback,
|
||||
void *arg);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_CXD56_SPI5
|
||||
int cxd56_spi5register(FAR struct spi_dev_s *dev, spi_mediachange_t callback,
|
||||
FAR void *arg);
|
||||
int cxd56_spi5register(struct spi_dev_s *dev, spi_mediachange_t callback,
|
||||
void *arg);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -56,12 +56,12 @@
|
|||
* Private Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
static int sysctl_ioctl(FAR struct file *filep, int cmd, unsigned long arg);
|
||||
static int sysctl_ioctl(struct file *filep, int cmd, unsigned long arg);
|
||||
static int sysctl_semtake(sem_t *semid);
|
||||
static void sysctl_semgive(sem_t *semid);
|
||||
static int sysctl_rxhandler(int cpuid, int protoid,
|
||||
uint32_t pdata, uint32_t data,
|
||||
FAR void *userdata);
|
||||
void *userdata);
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
|
|
@ -80,7 +80,7 @@ static const struct file_operations g_sysctlfops =
|
|||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
static int sysctl_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
|
||||
static int sysctl_ioctl(struct file *filep, int cmd, unsigned long arg)
|
||||
{
|
||||
int ret = OK;
|
||||
|
||||
|
|
@ -108,7 +108,7 @@ static void sysctl_semgive(sem_t *semid)
|
|||
|
||||
static int sysctl_rxhandler(int cpuid, int protoid,
|
||||
uint32_t pdata, uint32_t data,
|
||||
FAR void *userdata)
|
||||
void *userdata)
|
||||
{
|
||||
DEBUGASSERT(cpuid == 0);
|
||||
DEBUGASSERT(protoid == CXD56_PROTO_SYSCTL);
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@
|
|||
* Name: up_testset2
|
||||
****************************************************************************/
|
||||
|
||||
spinlock_t up_testset2(volatile FAR spinlock_t *lock)
|
||||
spinlock_t up_testset2(volatile spinlock_t *lock)
|
||||
{
|
||||
register uintptr_t ret asm("r0") = (uintptr_t)(lock);
|
||||
|
||||
|
|
@ -90,7 +90,7 @@ spinlock_t up_testset2(volatile FAR spinlock_t *lock)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
spinlock_t up_testset(volatile FAR spinlock_t *lock)
|
||||
spinlock_t up_testset(volatile spinlock_t *lock)
|
||||
{
|
||||
#ifdef CONFIG_CXD56_TESTSET_WITH_HWSEM
|
||||
spinlock_t ret;
|
||||
|
|
|
|||
|
|
@ -47,10 +47,10 @@
|
|||
* Name: up_textheap_memalign()
|
||||
****************************************************************************/
|
||||
|
||||
FAR void *up_textheap_memalign(size_t align, size_t size)
|
||||
void *up_textheap_memalign(size_t align, size_t size)
|
||||
{
|
||||
FAR void *ret;
|
||||
ret = (FAR void *)kmm_malloc(size);
|
||||
void *ret;
|
||||
ret = (void *)kmm_malloc(size);
|
||||
|
||||
#ifdef CONFIG_CXD56_USE_SYSBUS
|
||||
if (ret)
|
||||
|
|
@ -75,7 +75,7 @@ FAR void *up_textheap_memalign(size_t align, size_t size)
|
|||
* Name: up_textheap_free()
|
||||
****************************************************************************/
|
||||
|
||||
void up_textheap_free(FAR void *p)
|
||||
void up_textheap_free(void *p)
|
||||
{
|
||||
#ifdef CONFIG_CXD56_USE_SYSBUS
|
||||
if (p)
|
||||
|
|
|
|||
|
|
@ -85,16 +85,16 @@
|
|||
|
||||
struct cxd56_lowerhalf_s
|
||||
{
|
||||
FAR const struct timer_ops_s *ops; /* Lower half operations */
|
||||
const struct timer_ops_s *ops; /* Lower half operations */
|
||||
|
||||
/* Private data */
|
||||
|
||||
uint32_t base; /* Base address of the timer */
|
||||
tccb_t callback; /* Current user interrupt callback */
|
||||
FAR void *arg; /* Argument passed to upper half callback */
|
||||
uint32_t timeout; /* The current timeout value (us) */
|
||||
uint32_t clkticks; /* actual clock ticks for current interval */
|
||||
bool started; /* The timer has been started */
|
||||
uint32_t base; /* Base address of the timer */
|
||||
tccb_t callback; /* Current user interrupt callback */
|
||||
void *arg; /* Argument passed to upper half callback */
|
||||
uint32_t timeout; /* The current timeout value (us) */
|
||||
uint32_t clkticks; /* actual clock ticks for current interval */
|
||||
bool started; /* The timer has been started */
|
||||
};
|
||||
|
||||
/****************************************************************************
|
||||
|
|
@ -103,20 +103,20 @@ struct cxd56_lowerhalf_s
|
|||
|
||||
/* Interrupt handling *******************************************************/
|
||||
|
||||
static int cxd56_timer_interrupt(int irq, FAR void *context,
|
||||
FAR void *arg);
|
||||
static int cxd56_timer_interrupt(int irq, void *context,
|
||||
void *arg);
|
||||
|
||||
/* "Lower half" driver methods **********************************************/
|
||||
|
||||
static int cxd56_start(FAR struct timer_lowerhalf_s *lower);
|
||||
static int cxd56_stop(FAR struct timer_lowerhalf_s *lower);
|
||||
static int cxd56_getstatus(FAR struct timer_lowerhalf_s *lower,
|
||||
FAR struct timer_status_s *status);
|
||||
static int cxd56_settimeout(FAR struct timer_lowerhalf_s *lower,
|
||||
static int cxd56_start(struct timer_lowerhalf_s *lower);
|
||||
static int cxd56_stop(struct timer_lowerhalf_s *lower);
|
||||
static int cxd56_getstatus(struct timer_lowerhalf_s *lower,
|
||||
struct timer_status_s *status);
|
||||
static int cxd56_settimeout(struct timer_lowerhalf_s *lower,
|
||||
uint32_t timeout);
|
||||
static void cxd56_setcallback(struct timer_lowerhalf_s *lower,
|
||||
tccb_t callback, FAR void *arg);
|
||||
static int cxd56_ioctl(FAR struct timer_lowerhalf_s *lower, int cmd,
|
||||
tccb_t callback, void *arg);
|
||||
static int cxd56_ioctl(struct timer_lowerhalf_s *lower, int cmd,
|
||||
unsigned long arg);
|
||||
|
||||
/****************************************************************************
|
||||
|
|
@ -157,9 +157,9 @@ static struct cxd56_lowerhalf_s g_tmrdevs[2];
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int cxd56_timer_interrupt(int irq, FAR void *context, FAR void *arg)
|
||||
static int cxd56_timer_interrupt(int irq, void *context, void *arg)
|
||||
{
|
||||
FAR struct cxd56_lowerhalf_s *priv = (FAR struct cxd56_lowerhalf_s *)arg;
|
||||
struct cxd56_lowerhalf_s *priv = (struct cxd56_lowerhalf_s *)arg;
|
||||
uint32_t timeout;
|
||||
uint32_t load;
|
||||
|
||||
|
|
@ -187,7 +187,7 @@ static int cxd56_timer_interrupt(int irq, FAR void *context, FAR void *arg)
|
|||
{
|
||||
/* No callback or the callback returned false.. stop the timer */
|
||||
|
||||
cxd56_stop((FAR struct timer_lowerhalf_s *)priv);
|
||||
cxd56_stop((struct timer_lowerhalf_s *)priv);
|
||||
tmrinfo("Stopped\n");
|
||||
}
|
||||
|
||||
|
|
@ -213,9 +213,9 @@ static int cxd56_timer_interrupt(int irq, FAR void *context, FAR void *arg)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int cxd56_start(FAR struct timer_lowerhalf_s *lower)
|
||||
static int cxd56_start(struct timer_lowerhalf_s *lower)
|
||||
{
|
||||
FAR struct cxd56_lowerhalf_s *priv = (FAR struct cxd56_lowerhalf_s *)lower;
|
||||
struct cxd56_lowerhalf_s *priv = (struct cxd56_lowerhalf_s *)lower;
|
||||
|
||||
tmrinfo("Entry: started %d\n", priv->started);
|
||||
|
||||
|
|
@ -263,9 +263,9 @@ static int cxd56_start(FAR struct timer_lowerhalf_s *lower)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int cxd56_stop(FAR struct timer_lowerhalf_s *lower)
|
||||
static int cxd56_stop(struct timer_lowerhalf_s *lower)
|
||||
{
|
||||
FAR struct cxd56_lowerhalf_s *priv = (FAR struct cxd56_lowerhalf_s *)lower;
|
||||
struct cxd56_lowerhalf_s *priv = (struct cxd56_lowerhalf_s *)lower;
|
||||
|
||||
tmrinfo("Entry: started %d\n", priv->started);
|
||||
|
||||
|
|
@ -306,10 +306,10 @@ static int cxd56_stop(FAR struct timer_lowerhalf_s *lower)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int cxd56_getstatus(FAR struct timer_lowerhalf_s *lower,
|
||||
FAR struct timer_status_s *status)
|
||||
static int cxd56_getstatus(struct timer_lowerhalf_s *lower,
|
||||
struct timer_status_s *status)
|
||||
{
|
||||
FAR struct cxd56_lowerhalf_s *priv = (FAR struct cxd56_lowerhalf_s *)lower;
|
||||
struct cxd56_lowerhalf_s *priv = (struct cxd56_lowerhalf_s *)lower;
|
||||
uint64_t remaining;
|
||||
|
||||
tmrinfo("Entry\n");
|
||||
|
|
@ -360,10 +360,10 @@ static int cxd56_getstatus(FAR struct timer_lowerhalf_s *lower,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int cxd56_settimeout(FAR struct timer_lowerhalf_s *lower,
|
||||
static int cxd56_settimeout(struct timer_lowerhalf_s *lower,
|
||||
uint32_t timeout)
|
||||
{
|
||||
FAR struct cxd56_lowerhalf_s *priv = (FAR struct cxd56_lowerhalf_s *)lower;
|
||||
struct cxd56_lowerhalf_s *priv = (struct cxd56_lowerhalf_s *)lower;
|
||||
uint32_t load;
|
||||
|
||||
DEBUGASSERT(priv);
|
||||
|
|
@ -423,9 +423,9 @@ static int cxd56_settimeout(FAR struct timer_lowerhalf_s *lower,
|
|||
****************************************************************************/
|
||||
|
||||
static void cxd56_setcallback(struct timer_lowerhalf_s *lower,
|
||||
tccb_t callback, FAR void *arg)
|
||||
tccb_t callback, void *arg)
|
||||
{
|
||||
FAR struct cxd56_lowerhalf_s *priv = (struct cxd56_lowerhalf_s *)lower;
|
||||
struct cxd56_lowerhalf_s *priv = (struct cxd56_lowerhalf_s *)lower;
|
||||
irqstate_t flags;
|
||||
|
||||
flags = enter_critical_section();
|
||||
|
|
@ -461,7 +461,7 @@ static void cxd56_setcallback(struct timer_lowerhalf_s *lower,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int cxd56_ioctl(FAR struct timer_lowerhalf_s *lower, int cmd,
|
||||
static int cxd56_ioctl(struct timer_lowerhalf_s *lower, int cmd,
|
||||
unsigned long arg)
|
||||
{
|
||||
int ret = -ENOTTY;
|
||||
|
|
@ -479,11 +479,11 @@ static int cxd56_ioctl(FAR struct timer_lowerhalf_s *lower, int cmd,
|
|||
|
||||
case TCIOC_SETHANDLER:
|
||||
{
|
||||
FAR struct timer_sethandler_s *param;
|
||||
struct timer_sethandler_s *param;
|
||||
|
||||
/* Set user provided timeout callback function */
|
||||
|
||||
param = (FAR struct timer_sethandler_s *)((uintptr_t)arg);
|
||||
param = (struct timer_sethandler_s *)((uintptr_t)arg);
|
||||
|
||||
if (param != NULL)
|
||||
{
|
||||
|
|
@ -524,9 +524,9 @@ static int cxd56_ioctl(FAR struct timer_lowerhalf_s *lower, int cmd,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
void cxd56_timer_initialize(FAR const char *devpath, int timer)
|
||||
void cxd56_timer_initialize(const char *devpath, int timer)
|
||||
{
|
||||
FAR struct cxd56_lowerhalf_s *priv = &g_tmrdevs[timer];
|
||||
struct cxd56_lowerhalf_s *priv = &g_tmrdevs[timer];
|
||||
int irq;
|
||||
|
||||
tmrinfo("Entry: devpath=%s\n", devpath);
|
||||
|
|
@ -565,7 +565,7 @@ void cxd56_timer_initialize(FAR const char *devpath, int timer)
|
|||
|
||||
/* Register the timer driver as /dev/timerX */
|
||||
|
||||
timer_register(devpath, (FAR struct timer_lowerhalf_s *)priv);
|
||||
timer_register(devpath, (struct timer_lowerhalf_s *)priv);
|
||||
}
|
||||
|
||||
#endif /* CONFIG_TIMER */
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ extern "C"
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
void cxd56_timer_initialize(FAR const char *devpath, int timer);
|
||||
void cxd56_timer_initialize(const char *devpath, int timer);
|
||||
|
||||
#undef EXTERN
|
||||
#if defined(__cplusplus)
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ static uint32_t g_systrvr;
|
|||
****************************************************************************/
|
||||
|
||||
static int cxd56_changeclock(uint8_t id);
|
||||
static int cxd56_timerisr(int irq, uint32_t *regs, FAR void *arg);
|
||||
static int cxd56_timerisr(int irq, uint32_t *regs, void *arg);
|
||||
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
|
|
@ -129,7 +129,7 @@ static int cxd56_changeclock(uint8_t id)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int cxd56_timerisr(int irq, uint32_t *regs, FAR void *arg)
|
||||
static int cxd56_timerisr(int irq, uint32_t *regs, void *arg)
|
||||
{
|
||||
/* Process timer interrupt */
|
||||
|
||||
|
|
|
|||
|
|
@ -66,12 +66,12 @@
|
|||
* Private Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
static int uart0_open(FAR struct file *filep);
|
||||
static int uart0_close(FAR struct file *filep);
|
||||
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_open(struct file *filep);
|
||||
static int uart0_close(struct file *filep);
|
||||
static ssize_t uart0_read(struct file *filep,
|
||||
char *buffer, size_t len);
|
||||
static ssize_t uart0_write(struct file *filep,
|
||||
const char *buffer, size_t len);
|
||||
static int uart0_semtake(sem_t *id);
|
||||
static void uart0_semgive(sem_t *id);
|
||||
|
||||
|
|
@ -128,9 +128,9 @@ static void uart0_semgive(sem_t *id)
|
|||
* Name: uart0_open
|
||||
****************************************************************************/
|
||||
|
||||
static int uart0_open(FAR struct file *filep)
|
||||
static int uart0_open(struct file *filep)
|
||||
{
|
||||
FAR struct inode *inode = filep->f_inode;
|
||||
struct inode *inode = filep->f_inode;
|
||||
int flowctl;
|
||||
int bits;
|
||||
int stop;
|
||||
|
|
@ -189,9 +189,9 @@ static int uart0_open(FAR struct file *filep)
|
|||
* Name: uart0_close
|
||||
****************************************************************************/
|
||||
|
||||
static int uart0_close(FAR struct file *filep)
|
||||
static int uart0_close(struct file *filep)
|
||||
{
|
||||
FAR struct inode *inode = filep->f_inode;
|
||||
struct inode *inode = filep->f_inode;
|
||||
|
||||
if (inode->i_crefs == 1)
|
||||
{
|
||||
|
|
@ -214,8 +214,8 @@ static int uart0_close(FAR struct file *filep)
|
|||
* Name: uart0_read
|
||||
****************************************************************************/
|
||||
|
||||
static ssize_t uart0_read(FAR struct file *filep,
|
||||
FAR char *buffer, size_t len)
|
||||
static ssize_t uart0_read(struct file *filep,
|
||||
char *buffer, size_t len)
|
||||
{
|
||||
int ret;
|
||||
|
||||
|
|
@ -233,14 +233,14 @@ static ssize_t uart0_read(FAR struct file *filep,
|
|||
* Name: uart0_write
|
||||
****************************************************************************/
|
||||
|
||||
static ssize_t uart0_write(FAR struct file *filep,
|
||||
FAR const char *buffer, size_t len)
|
||||
static ssize_t uart0_write(struct file *filep,
|
||||
const char *buffer, size_t len)
|
||||
{
|
||||
int ret;
|
||||
|
||||
uart0_semtake(&g_lock);
|
||||
|
||||
ret = fw_pd_uartsend(0, (FAR void *)buffer, len,
|
||||
ret = fw_pd_uartsend(0, (void *)buffer, len,
|
||||
((filep->f_oflags & O_NONBLOCK) != 0));
|
||||
|
||||
uart0_semgive(&g_lock);
|
||||
|
|
@ -252,7 +252,7 @@ static ssize_t uart0_write(FAR struct file *filep,
|
|||
* Name: cxd56_uart0initialize
|
||||
****************************************************************************/
|
||||
|
||||
int cxd56_uart0initialize(FAR const char *devname)
|
||||
int cxd56_uart0initialize(const char *devname)
|
||||
{
|
||||
int ret;
|
||||
|
||||
|
|
@ -271,7 +271,7 @@ int cxd56_uart0initialize(FAR const char *devname)
|
|||
* Name: cxd56_uart0uninitialize
|
||||
****************************************************************************/
|
||||
|
||||
void cxd56_uart0uninitialize(FAR const char *devname)
|
||||
void cxd56_uart0uninitialize(const char *devname)
|
||||
{
|
||||
unregister_driver(devname);
|
||||
nxsem_destroy(&g_lock);
|
||||
|
|
|
|||
|
|
@ -169,7 +169,7 @@ static inline struct dma_descriptor_s *cxd56_get_descriptor(
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int cxd56_dmac_interrupt(int irq, void *context, FAR void *arg)
|
||||
static int cxd56_dmac_interrupt(int irq, void *context, void *arg)
|
||||
{
|
||||
struct dma_channel_s *dmach;
|
||||
unsigned int chndx;
|
||||
|
|
|
|||
|
|
@ -420,41 +420,41 @@ static struct pm_cpu_wakelock_s g_wake_lock =
|
|||
|
||||
/* Request queue operations *************************************************/
|
||||
|
||||
static FAR struct cxd56_req_s *cxd56_rqdequeue(
|
||||
FAR struct cxd56_ep_s *privep);
|
||||
static void cxd56_rqenqueue(FAR struct cxd56_ep_s *privep,
|
||||
FAR struct cxd56_req_s *req);
|
||||
static struct cxd56_req_s *cxd56_rqdequeue(
|
||||
struct cxd56_ep_s *privep);
|
||||
static void cxd56_rqenqueue(struct cxd56_ep_s *privep,
|
||||
struct cxd56_req_s *req);
|
||||
|
||||
/* Low level data transfers and request operations */
|
||||
|
||||
static int cxd56_epwrite(FAR struct cxd56_ep_s *privep, FAR uint8_t *buf,
|
||||
static int cxd56_epwrite(struct cxd56_ep_s *privep, uint8_t *buf,
|
||||
uint16_t nbytes);
|
||||
static inline void cxd56_abortrequest(FAR struct cxd56_ep_s *privep,
|
||||
FAR struct cxd56_req_s *privreq,
|
||||
static inline void cxd56_abortrequest(struct cxd56_ep_s *privep,
|
||||
struct cxd56_req_s *privreq,
|
||||
int16_t result);
|
||||
static void cxd56_reqcomplete(FAR struct cxd56_ep_s *privep, int16_t result);
|
||||
static int cxd56_wrrequest(FAR struct cxd56_ep_s *privep);
|
||||
static int cxd56_rdrequest(FAR struct cxd56_ep_s *privep);
|
||||
static void cxd56_cancelrequests(FAR struct cxd56_ep_s *privep);
|
||||
static void cxd56_usbdevreset(FAR struct cxd56_usbdev_s *priv);
|
||||
static void cxd56_usbreset(FAR struct cxd56_usbdev_s *priv);
|
||||
static void cxd56_reqcomplete(struct cxd56_ep_s *privep, int16_t result);
|
||||
static int cxd56_wrrequest(struct cxd56_ep_s *privep);
|
||||
static int cxd56_rdrequest(struct cxd56_ep_s *privep);
|
||||
static void cxd56_cancelrequests(struct cxd56_ep_s *privep);
|
||||
static void cxd56_usbdevreset(struct cxd56_usbdev_s *priv);
|
||||
static void cxd56_usbreset(struct cxd56_usbdev_s *priv);
|
||||
|
||||
/* Interrupt handling */
|
||||
|
||||
static FAR struct cxd56_ep_s *
|
||||
cxd56_epfindbyaddr(FAR struct cxd56_usbdev_s *priv, uint16_t eplog);
|
||||
static void cxd56_dispatchrequest(FAR struct cxd56_usbdev_s *priv);
|
||||
static inline void cxd56_ep0setup(FAR struct cxd56_usbdev_s *priv);
|
||||
static int cxd56_usbinterrupt(int irq, FAR void *context, FAR void *arg);
|
||||
static int cxd56_sysinterrupt(int irq, FAR void *context, FAR void *arg);
|
||||
static int cxd56_vbusinterrupt(int irq, FAR void *context, FAR void *arg);
|
||||
static int cxd56_vbusninterrupt(int irq, FAR void *context, FAR void *arg);
|
||||
static struct cxd56_ep_s *
|
||||
cxd56_epfindbyaddr(struct cxd56_usbdev_s *priv, uint16_t eplog);
|
||||
static void cxd56_dispatchrequest(struct cxd56_usbdev_s *priv);
|
||||
static inline void cxd56_ep0setup(struct cxd56_usbdev_s *priv);
|
||||
static int cxd56_usbinterrupt(int irq, void *context, void *arg);
|
||||
static int cxd56_sysinterrupt(int irq, void *context, void *arg);
|
||||
static int cxd56_vbusinterrupt(int irq, void *context, void *arg);
|
||||
static int cxd56_vbusninterrupt(int irq, void *context, void *arg);
|
||||
|
||||
/* Initialization operations */
|
||||
|
||||
static inline void cxd56_ep0hwinitialize(FAR struct cxd56_usbdev_s *priv);
|
||||
static void cxd56_ctrlinitialize(FAR struct cxd56_usbdev_s *priv);
|
||||
static void cxd56_epinitialize(FAR struct cxd56_usbdev_s *priv);
|
||||
static inline void cxd56_ep0hwinitialize(struct cxd56_usbdev_s *priv);
|
||||
static void cxd56_ctrlinitialize(struct cxd56_usbdev_s *priv);
|
||||
static void cxd56_epinitialize(struct cxd56_usbdev_s *priv);
|
||||
|
||||
/* Un-initialization operations */
|
||||
|
||||
|
|
@ -462,34 +462,34 @@ static void cxd56_usbhwuninit(void);
|
|||
|
||||
/* Endpoint methods */
|
||||
|
||||
static int cxd56_epconfigure(FAR struct usbdev_ep_s *ep,
|
||||
FAR const struct usb_epdesc_s *desc, bool last);
|
||||
static int cxd56_epdisable(FAR struct usbdev_ep_s *ep);
|
||||
static FAR struct usbdev_req_s *cxd56_epallocreq(FAR struct usbdev_ep_s *ep);
|
||||
static void cxd56_epfreereq(FAR struct usbdev_ep_s *ep,
|
||||
FAR struct usbdev_req_s *req);
|
||||
static int cxd56_epconfigure(struct usbdev_ep_s *ep,
|
||||
const struct usb_epdesc_s *desc, bool last);
|
||||
static int cxd56_epdisable(struct usbdev_ep_s *ep);
|
||||
static struct usbdev_req_s *cxd56_epallocreq(struct usbdev_ep_s *ep);
|
||||
static void cxd56_epfreereq(struct usbdev_ep_s *ep,
|
||||
struct usbdev_req_s *req);
|
||||
#ifdef CONFIG_USBDEV_DMA
|
||||
static FAR void *cxd56_epallocbuffer(FAR struct usbdev_ep_s *ep,
|
||||
static void *cxd56_epallocbuffer(struct usbdev_ep_s *ep,
|
||||
uint16_t nbytes);
|
||||
static void cxd56_epfreebuffer(FAR struct usbdev_ep_s *ep, FAR void *buf);
|
||||
static void cxd56_epfreebuffer(struct usbdev_ep_s *ep, void *buf);
|
||||
#endif
|
||||
static int cxd56_epsubmit(FAR struct usbdev_ep_s *ep,
|
||||
FAR struct usbdev_req_s *privreq);
|
||||
static int cxd56_epcancel(FAR struct usbdev_ep_s *ep,
|
||||
FAR struct usbdev_req_s *privreq);
|
||||
static int cxd56_epstall(FAR struct usbdev_ep_s *ep, bool resume);
|
||||
static int cxd56_epsubmit(struct usbdev_ep_s *ep,
|
||||
struct usbdev_req_s *privreq);
|
||||
static int cxd56_epcancel(struct usbdev_ep_s *ep,
|
||||
struct usbdev_req_s *privreq);
|
||||
static int cxd56_epstall(struct usbdev_ep_s *ep, bool resume);
|
||||
|
||||
/* USB device controller methods */
|
||||
|
||||
static FAR struct usbdev_ep_s *cxd56_allocep(FAR struct usbdev_s *dev,
|
||||
static struct usbdev_ep_s *cxd56_allocep(struct usbdev_s *dev,
|
||||
uint8_t epno, bool in,
|
||||
uint8_t eptype);
|
||||
static void cxd56_freeep(FAR struct usbdev_s *dev,
|
||||
FAR struct usbdev_ep_s *ep);
|
||||
static int cxd56_getframe(FAR struct usbdev_s *dev);
|
||||
static int cxd56_wakeup(FAR struct usbdev_s *dev);
|
||||
static int cxd56_selfpowered(FAR struct usbdev_s *dev, bool selfpowered);
|
||||
static int cxd56_pullup(FAR struct usbdev_s *dev, bool enable);
|
||||
static void cxd56_freeep(struct usbdev_s *dev,
|
||||
struct usbdev_ep_s *ep);
|
||||
static int cxd56_getframe(struct usbdev_s *dev);
|
||||
static int cxd56_wakeup(struct usbdev_s *dev);
|
||||
static int cxd56_selfpowered(struct usbdev_s *dev, bool selfpowered);
|
||||
static int cxd56_pullup(struct usbdev_s *dev, bool enable);
|
||||
|
||||
/* Notify USB device attach/detach signal */
|
||||
|
||||
|
|
@ -499,14 +499,14 @@ static void cxd56_notify_signal(uint16_t state, uint16_t power);
|
|||
|
||||
/* procfs methods */
|
||||
|
||||
static int cxd56_usbdev_open(FAR struct file *filep, FAR const char *relpath,
|
||||
static int cxd56_usbdev_open(struct file *filep, const char *relpath,
|
||||
int oflags, mode_t mode);
|
||||
static int cxd56_usbdev_close(FAR struct file *filep);
|
||||
static ssize_t cxd56_usbdev_read(FAR struct file *filep, FAR char *buffer,
|
||||
static int cxd56_usbdev_close(struct file *filep);
|
||||
static ssize_t cxd56_usbdev_read(struct file *filep, char *buffer,
|
||||
size_t buflen);
|
||||
static int cxd56_usbdev_dup(FAR const struct file *oldp,
|
||||
FAR struct file *newp);
|
||||
static int cxd56_usbdev_stat(FAR const char *relpath, FAR struct stat *buf);
|
||||
static int cxd56_usbdev_dup(const struct file *oldp,
|
||||
struct file *newp);
|
||||
static int cxd56_usbdev_stat(const char *relpath, struct stat *buf);
|
||||
|
||||
#endif
|
||||
|
||||
|
|
@ -685,9 +685,9 @@ static inline bool cxd56_iscableconnected(void)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static FAR struct cxd56_req_s *cxd56_rqdequeue(FAR struct cxd56_ep_s *privep)
|
||||
static struct cxd56_req_s *cxd56_rqdequeue(struct cxd56_ep_s *privep)
|
||||
{
|
||||
FAR struct cxd56_req_s *ret = privep->head;
|
||||
struct cxd56_req_s *ret = privep->head;
|
||||
|
||||
if (ret)
|
||||
{
|
||||
|
|
@ -711,8 +711,8 @@ static FAR struct cxd56_req_s *cxd56_rqdequeue(FAR struct cxd56_ep_s *privep)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static void cxd56_rqenqueue(FAR struct cxd56_ep_s *privep,
|
||||
FAR struct cxd56_req_s *req)
|
||||
static void cxd56_rqenqueue(struct cxd56_ep_s *privep,
|
||||
struct cxd56_req_s *req)
|
||||
{
|
||||
req->flink = NULL;
|
||||
if (!privep->head)
|
||||
|
|
@ -735,10 +735,10 @@ static void cxd56_rqenqueue(FAR struct cxd56_ep_s *privep,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int cxd56_epwrite(FAR struct cxd56_ep_s *privep, FAR uint8_t *buf,
|
||||
static int cxd56_epwrite(struct cxd56_ep_s *privep, uint8_t *buf,
|
||||
uint16_t nbytes)
|
||||
{
|
||||
FAR struct cxd56_data_desc_s *desc;
|
||||
struct cxd56_data_desc_s *desc;
|
||||
uint32_t ctrl;
|
||||
uint8_t epphy = privep->epphy;
|
||||
|
||||
|
|
@ -778,8 +778,8 @@ static int cxd56_epwrite(FAR struct cxd56_ep_s *privep, FAR uint8_t *buf,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static inline void cxd56_abortrequest(FAR struct cxd56_ep_s *privep,
|
||||
FAR struct cxd56_req_s *privreq,
|
||||
static inline void cxd56_abortrequest(struct cxd56_ep_s *privep,
|
||||
struct cxd56_req_s *privreq,
|
||||
int16_t result)
|
||||
{
|
||||
usbtrace(TRACE_DEVERROR(CXD56_TRACEERR_REQABORTED),
|
||||
|
|
@ -802,9 +802,9 @@ static inline void cxd56_abortrequest(FAR struct cxd56_ep_s *privep,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static void cxd56_reqcomplete(FAR struct cxd56_ep_s *privep, int16_t result)
|
||||
static void cxd56_reqcomplete(struct cxd56_ep_s *privep, int16_t result)
|
||||
{
|
||||
FAR struct cxd56_req_s *privreq;
|
||||
struct cxd56_req_s *privreq;
|
||||
int stalled = privep->stalled;
|
||||
irqstate_t flags;
|
||||
|
||||
|
|
@ -849,10 +849,10 @@ static void cxd56_reqcomplete(FAR struct cxd56_ep_s *privep, int16_t result)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static void cxd56_txdmacomplete(FAR struct cxd56_ep_s *privep)
|
||||
static void cxd56_txdmacomplete(struct cxd56_ep_s *privep)
|
||||
{
|
||||
FAR struct cxd56_data_desc_s *desc;
|
||||
FAR struct cxd56_req_s *privreq;
|
||||
struct cxd56_data_desc_s *desc;
|
||||
struct cxd56_req_s *privreq;
|
||||
|
||||
desc = privep->epphy == CXD56_EP0 ? &g_ep0in : privep->desc;
|
||||
|
||||
|
|
@ -891,10 +891,10 @@ static void cxd56_txdmacomplete(FAR struct cxd56_ep_s *privep)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int cxd56_wrrequest(FAR struct cxd56_ep_s *privep)
|
||||
static int cxd56_wrrequest(struct cxd56_ep_s *privep)
|
||||
{
|
||||
FAR struct cxd56_req_s *privreq;
|
||||
FAR uint8_t *buf;
|
||||
struct cxd56_req_s *privreq;
|
||||
uint8_t *buf;
|
||||
int nbytes;
|
||||
int bytesleft;
|
||||
|
||||
|
|
@ -969,10 +969,10 @@ static int cxd56_wrrequest(FAR struct cxd56_ep_s *privep)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static void cxd56_rxdmacomplete(FAR struct cxd56_ep_s *privep)
|
||||
static void cxd56_rxdmacomplete(struct cxd56_ep_s *privep)
|
||||
{
|
||||
FAR struct cxd56_data_desc_s *desc = privep->desc;
|
||||
FAR struct cxd56_req_s *privreq;
|
||||
struct cxd56_data_desc_s *desc = privep->desc;
|
||||
struct cxd56_req_s *privreq;
|
||||
uint32_t status = desc->status;
|
||||
uint16_t nrxbytes;
|
||||
|
||||
|
|
@ -1014,10 +1014,10 @@ static void cxd56_rxdmacomplete(FAR struct cxd56_ep_s *privep)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int cxd56_rdrequest(FAR struct cxd56_ep_s *privep)
|
||||
static int cxd56_rdrequest(struct cxd56_ep_s *privep)
|
||||
{
|
||||
FAR struct cxd56_data_desc_s *desc = privep->desc;
|
||||
FAR struct cxd56_req_s *privreq;
|
||||
struct cxd56_data_desc_s *desc = privep->desc;
|
||||
struct cxd56_req_s *privreq;
|
||||
uint32_t ctrl;
|
||||
|
||||
/* Check the request from the head of the endpoint request queue */
|
||||
|
|
@ -1058,7 +1058,7 @@ static int cxd56_rdrequest(FAR struct cxd56_ep_s *privep)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static void cxd56_stopinep(FAR struct cxd56_ep_s *privep)
|
||||
static void cxd56_stopinep(struct cxd56_ep_s *privep)
|
||||
{
|
||||
uint32_t ctrl;
|
||||
|
||||
|
|
@ -1077,7 +1077,7 @@ static void cxd56_stopinep(FAR struct cxd56_ep_s *privep)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static void cxd56_stopoutep(FAR struct cxd56_ep_s *privep)
|
||||
static void cxd56_stopoutep(struct cxd56_ep_s *privep)
|
||||
{
|
||||
uint32_t ctrl;
|
||||
uint32_t stat;
|
||||
|
|
@ -1103,7 +1103,7 @@ static void cxd56_stopoutep(FAR struct cxd56_ep_s *privep)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static void cxd56_cancelrequests(FAR struct cxd56_ep_s *privep)
|
||||
static void cxd56_cancelrequests(struct cxd56_ep_s *privep)
|
||||
{
|
||||
if (privep->epphy > 0)
|
||||
{
|
||||
|
|
@ -1146,10 +1146,10 @@ static void cxd56_cancelrequests(FAR struct cxd56_ep_s *privep)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static FAR struct cxd56_ep_s *
|
||||
cxd56_epfindbyaddr(FAR struct cxd56_usbdev_s *priv, uint16_t eplog)
|
||||
static struct cxd56_ep_s *
|
||||
cxd56_epfindbyaddr(struct cxd56_usbdev_s *priv, uint16_t eplog)
|
||||
{
|
||||
FAR struct cxd56_ep_s *privep;
|
||||
struct cxd56_ep_s *privep;
|
||||
int i;
|
||||
|
||||
/* Endpoint zero is a special case */
|
||||
|
|
@ -1188,7 +1188,7 @@ cxd56_epfindbyaddr(FAR struct cxd56_usbdev_s *priv, uint16_t eplog)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static void cxd56_dispatchrequest(FAR struct cxd56_usbdev_s *priv)
|
||||
static void cxd56_dispatchrequest(struct cxd56_usbdev_s *priv)
|
||||
{
|
||||
int ret;
|
||||
|
||||
|
|
@ -1216,11 +1216,11 @@ static void cxd56_dispatchrequest(FAR struct cxd56_usbdev_s *priv)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static inline void cxd56_ep0setup(FAR struct cxd56_usbdev_s *priv)
|
||||
static inline void cxd56_ep0setup(struct cxd56_usbdev_s *priv)
|
||||
{
|
||||
FAR struct cxd56_ep_s *ep0 = &priv->eplist[0];
|
||||
FAR struct cxd56_req_s *privreq = cxd56_rqpeek(ep0);
|
||||
FAR struct cxd56_ep_s *privep;
|
||||
struct cxd56_ep_s *ep0 = &priv->eplist[0];
|
||||
struct cxd56_req_s *privreq = cxd56_rqpeek(ep0);
|
||||
struct cxd56_ep_s *privep;
|
||||
uint16_t index;
|
||||
uint16_t value;
|
||||
uint16_t len;
|
||||
|
|
@ -1526,10 +1526,10 @@ static inline void cxd56_ep0setup(FAR struct cxd56_usbdev_s *priv)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int cxd56_epinterrupt(int irq, FAR void *context)
|
||||
static int cxd56_epinterrupt(int irq, void *context)
|
||||
{
|
||||
FAR struct cxd56_usbdev_s *priv = &g_usbdev;
|
||||
FAR struct cxd56_ep_s *privep;
|
||||
struct cxd56_usbdev_s *priv = &g_usbdev;
|
||||
struct cxd56_ep_s *privep;
|
||||
uint32_t eps;
|
||||
uint32_t stat;
|
||||
uint32_t ctrl;
|
||||
|
|
@ -1820,7 +1820,7 @@ static int cxd56_epinterrupt(int irq, FAR void *context)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int cxd56_usbinterrupt(int irq, FAR void *context, FAR void *arg)
|
||||
static int cxd56_usbinterrupt(int irq, void *context, void *arg)
|
||||
{
|
||||
struct usb_ctrlreq_s ctrl;
|
||||
uint32_t intr;
|
||||
|
|
@ -1843,7 +1843,7 @@ static int cxd56_usbinterrupt(int irq, FAR void *context, FAR void *arg)
|
|||
|
||||
if (intr & USB_INT_ENUM)
|
||||
{
|
||||
FAR struct cxd56_usbdev_s *priv = &g_usbdev;
|
||||
struct cxd56_usbdev_s *priv = &g_usbdev;
|
||||
uint32_t speed;
|
||||
uint32_t config;
|
||||
|
||||
|
|
@ -1895,8 +1895,8 @@ static int cxd56_usbinterrupt(int irq, FAR void *context, FAR void *arg)
|
|||
|
||||
for (i = 1; i < CXD56_NENDPOINTS; i++)
|
||||
{
|
||||
FAR struct cxd56_ep_s *privep =
|
||||
(FAR struct cxd56_ep_s *)&g_usbdev.eplist[i];
|
||||
struct cxd56_ep_s *privep =
|
||||
(struct cxd56_ep_s *)&g_usbdev.eplist[i];
|
||||
|
||||
cxd56_cancelrequests(privep);
|
||||
}
|
||||
|
|
@ -1977,9 +1977,9 @@ static int cxd56_usbinterrupt(int irq, FAR void *context, FAR void *arg)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int cxd56_sysinterrupt(int irq, FAR void *context, FAR void *arg)
|
||||
static int cxd56_sysinterrupt(int irq, void *context, void *arg)
|
||||
{
|
||||
FAR struct cxd56_usbdev_s *priv = (FAR struct cxd56_usbdev_s *)arg;
|
||||
struct cxd56_usbdev_s *priv = (struct cxd56_usbdev_s *)arg;
|
||||
uint32_t status;
|
||||
|
||||
UNUSED(priv);
|
||||
|
|
@ -2007,7 +2007,7 @@ static int cxd56_sysinterrupt(int irq, FAR void *context, FAR void *arg)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static void cxd56_ep0hwinitialize(FAR struct cxd56_usbdev_s *priv)
|
||||
static void cxd56_ep0hwinitialize(struct cxd56_usbdev_s *priv)
|
||||
{
|
||||
uint32_t maxp = g_epinfo[0].maxpacket;
|
||||
uint32_t bufsz = g_epinfo[0].bufsize / 4;
|
||||
|
|
@ -2051,7 +2051,7 @@ static void cxd56_ep0hwinitialize(FAR struct cxd56_usbdev_s *priv)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static void cxd56_ctrlinitialize(FAR struct cxd56_usbdev_s *priv)
|
||||
static void cxd56_ctrlinitialize(struct cxd56_usbdev_s *priv)
|
||||
{
|
||||
uint32_t ctrl;
|
||||
uint32_t config;
|
||||
|
|
@ -2080,7 +2080,7 @@ static void cxd56_ctrlinitialize(FAR struct cxd56_usbdev_s *priv)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static void cxd56_usbdevreset(FAR struct cxd56_usbdev_s *priv)
|
||||
static void cxd56_usbdevreset(struct cxd56_usbdev_s *priv)
|
||||
{
|
||||
uint32_t mask;
|
||||
int i;
|
||||
|
|
@ -2190,10 +2190,10 @@ static void cxd56_usbdevreset(FAR struct cxd56_usbdev_s *priv)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int cxd56_epconfigure(FAR struct usbdev_ep_s *ep,
|
||||
FAR const struct usb_epdesc_s *desc, bool last)
|
||||
static int cxd56_epconfigure(struct usbdev_ep_s *ep,
|
||||
const struct usb_epdesc_s *desc, bool last)
|
||||
{
|
||||
FAR struct cxd56_ep_s *privep = (FAR struct cxd56_ep_s *)ep;
|
||||
struct cxd56_ep_s *privep = (struct cxd56_ep_s *)ep;
|
||||
int n;
|
||||
int eptype;
|
||||
uint16_t maxpacket;
|
||||
|
|
@ -2269,9 +2269,9 @@ static int cxd56_epconfigure(FAR struct usbdev_ep_s *ep,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int cxd56_epdisable(FAR struct usbdev_ep_s *ep)
|
||||
static int cxd56_epdisable(struct usbdev_ep_s *ep)
|
||||
{
|
||||
FAR struct cxd56_ep_s *privep = (FAR struct cxd56_ep_s *)ep;
|
||||
struct cxd56_ep_s *privep = (struct cxd56_ep_s *)ep;
|
||||
irqstate_t flags;
|
||||
|
||||
#ifdef CONFIG_DEBUG_FEATURES
|
||||
|
|
@ -2283,7 +2283,7 @@ static int cxd56_epdisable(FAR struct usbdev_ep_s *ep)
|
|||
|
||||
#endif
|
||||
usbtrace(TRACE_EPDISABLE, privep->epphy);
|
||||
uinfo("EP%d\n", ((FAR struct cxd56_ep_s *)ep)->epphy);
|
||||
uinfo("EP%d\n", ((struct cxd56_ep_s *)ep)->epphy);
|
||||
|
||||
/* Cancel any ongoing activity and reset the endpoint */
|
||||
|
||||
|
|
@ -2302,9 +2302,9 @@ static int cxd56_epdisable(FAR struct usbdev_ep_s *ep)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static FAR struct usbdev_req_s *cxd56_epallocreq(FAR struct usbdev_ep_s *ep)
|
||||
static struct usbdev_req_s *cxd56_epallocreq(struct usbdev_ep_s *ep)
|
||||
{
|
||||
FAR struct cxd56_req_s *privreq;
|
||||
struct cxd56_req_s *privreq;
|
||||
|
||||
#ifdef CONFIG_DEBUG_FEATURES
|
||||
if (!ep)
|
||||
|
|
@ -2313,9 +2313,9 @@ static FAR struct usbdev_req_s *cxd56_epallocreq(FAR struct usbdev_ep_s *ep)
|
|||
}
|
||||
|
||||
#endif
|
||||
usbtrace(TRACE_EPALLOCREQ, ((FAR struct cxd56_ep_s *)ep)->epphy);
|
||||
usbtrace(TRACE_EPALLOCREQ, ((struct cxd56_ep_s *)ep)->epphy);
|
||||
|
||||
privreq = (FAR struct cxd56_req_s *)kmm_malloc(sizeof(struct cxd56_req_s));
|
||||
privreq = (struct cxd56_req_s *)kmm_malloc(sizeof(struct cxd56_req_s));
|
||||
if (!privreq)
|
||||
{
|
||||
usbtrace(TRACE_DEVERROR(CXD56_TRACEERR_ALLOCFAIL), 0);
|
||||
|
|
@ -2334,10 +2334,10 @@ static FAR struct usbdev_req_s *cxd56_epallocreq(FAR struct usbdev_ep_s *ep)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static void cxd56_epfreereq(FAR struct usbdev_ep_s *ep,
|
||||
FAR struct usbdev_req_s *req)
|
||||
static void cxd56_epfreereq(struct usbdev_ep_s *ep,
|
||||
struct usbdev_req_s *req)
|
||||
{
|
||||
FAR struct cxd56_req_s *privreq = (FAR struct cxd56_req_s *)req;
|
||||
struct cxd56_req_s *privreq = (struct cxd56_req_s *)req;
|
||||
|
||||
#ifdef CONFIG_DEBUG_FEATURES
|
||||
if (!ep || !req)
|
||||
|
|
@ -2347,7 +2347,7 @@ static void cxd56_epfreereq(FAR struct usbdev_ep_s *ep,
|
|||
}
|
||||
#endif
|
||||
|
||||
usbtrace(TRACE_EPFREEREQ, ((FAR struct cxd56_ep_s *)ep)->epphy);
|
||||
usbtrace(TRACE_EPFREEREQ, ((struct cxd56_ep_s *)ep)->epphy);
|
||||
kmm_free(privreq);
|
||||
}
|
||||
|
||||
|
|
@ -2360,10 +2360,10 @@ static void cxd56_epfreereq(FAR struct usbdev_ep_s *ep,
|
|||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_USBDEV_DMA
|
||||
static FAR void *cxd56_epallocbuffer(FAR struct usbdev_ep_s *ep,
|
||||
static void *cxd56_epallocbuffer(struct usbdev_ep_s *ep,
|
||||
uint16_t bytes)
|
||||
{
|
||||
FAR struct cxd56_ep_s *privep = (FAR struct cxd56_ep_s *)ep;
|
||||
struct cxd56_ep_s *privep = (struct cxd56_ep_s *)ep;
|
||||
|
||||
UNUSED(privep);
|
||||
usbtrace(TRACE_EPALLOCBUFFER, privep->epphy);
|
||||
|
|
@ -2381,9 +2381,9 @@ static FAR void *cxd56_epallocbuffer(FAR struct usbdev_ep_s *ep,
|
|||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_USBDEV_DMA
|
||||
static void cxd56_epfreebuffer(FAR struct usbdev_ep_s *ep, FAR void *buf)
|
||||
static void cxd56_epfreebuffer(struct usbdev_ep_s *ep, void *buf)
|
||||
{
|
||||
FAR struct cxd56_ep_s *privep = (FAR struct cxd56_ep_s *)ep;
|
||||
struct cxd56_ep_s *privep = (struct cxd56_ep_s *)ep;
|
||||
|
||||
UNUSED(privep);
|
||||
usbtrace(TRACE_EPFREEBUFFER, privep->epphy);
|
||||
|
|
@ -2400,12 +2400,12 @@ static void cxd56_epfreebuffer(FAR struct usbdev_ep_s *ep, FAR void *buf)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int cxd56_epsubmit(FAR struct usbdev_ep_s *ep,
|
||||
FAR struct usbdev_req_s *req)
|
||||
static int cxd56_epsubmit(struct usbdev_ep_s *ep,
|
||||
struct usbdev_req_s *req)
|
||||
{
|
||||
FAR struct cxd56_req_s *privreq = (FAR struct cxd56_req_s *)req;
|
||||
FAR struct cxd56_ep_s *privep = (FAR struct cxd56_ep_s *)ep;
|
||||
FAR struct cxd56_usbdev_s *priv;
|
||||
struct cxd56_req_s *privreq = (struct cxd56_req_s *)req;
|
||||
struct cxd56_ep_s *privep = (struct cxd56_ep_s *)ep;
|
||||
struct cxd56_usbdev_s *priv;
|
||||
uint32_t ctrl;
|
||||
irqstate_t flags;
|
||||
int ret = OK;
|
||||
|
|
@ -2481,9 +2481,9 @@ static int cxd56_epsubmit(FAR struct usbdev_ep_s *ep,
|
|||
if (priv->ctrl.req == USB_REQ_GETDESCRIPTOR &&
|
||||
priv->ctrl.value[1] == USB_DESC_TYPE_CONFIG)
|
||||
{
|
||||
FAR struct usb_cfgdesc_s *cfgdesc;
|
||||
struct usb_cfgdesc_s *cfgdesc;
|
||||
|
||||
cfgdesc = (FAR struct usb_cfgdesc_s *)req->buf;
|
||||
cfgdesc = (struct usb_cfgdesc_s *)req->buf;
|
||||
priv->power = cfgdesc->mxpower * 2;
|
||||
}
|
||||
|
||||
|
|
@ -2545,10 +2545,10 @@ static int cxd56_epsubmit(FAR struct usbdev_ep_s *ep,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int cxd56_epcancel(FAR struct usbdev_ep_s *ep,
|
||||
FAR struct usbdev_req_s *req)
|
||||
static int cxd56_epcancel(struct usbdev_ep_s *ep,
|
||||
struct usbdev_req_s *req)
|
||||
{
|
||||
FAR struct cxd56_ep_s *privep = (FAR struct cxd56_ep_s *)ep;
|
||||
struct cxd56_ep_s *privep = (struct cxd56_ep_s *)ep;
|
||||
irqstate_t flags;
|
||||
|
||||
#ifdef CONFIG_DEBUG_FEATURES
|
||||
|
|
@ -2575,9 +2575,9 @@ static int cxd56_epcancel(FAR struct usbdev_ep_s *ep,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int cxd56_epstall(FAR struct usbdev_ep_s *ep, bool resume)
|
||||
static int cxd56_epstall(struct usbdev_ep_s *ep, bool resume)
|
||||
{
|
||||
FAR struct cxd56_ep_s *privep = (FAR struct cxd56_ep_s *)ep;
|
||||
struct cxd56_ep_s *privep = (struct cxd56_ep_s *)ep;
|
||||
uint32_t ctrl;
|
||||
uint32_t addr;
|
||||
|
||||
|
|
@ -2606,7 +2606,7 @@ static int cxd56_epstall(FAR struct usbdev_ep_s *ep, bool resume)
|
|||
* Device Methods
|
||||
****************************************************************************/
|
||||
|
||||
static int cxd56_allocepbuffer(FAR struct cxd56_ep_s *privep)
|
||||
static int cxd56_allocepbuffer(struct cxd56_ep_s *privep)
|
||||
{
|
||||
DEBUGASSERT(!privep->desc && !privep->buffer);
|
||||
DEBUGASSERT(privep->epphy); /* Do not use for EP0 */
|
||||
|
|
@ -2637,7 +2637,7 @@ static int cxd56_allocepbuffer(FAR struct cxd56_ep_s *privep)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static void cxd56_freeepbuffer(FAR struct cxd56_ep_s *privep)
|
||||
static void cxd56_freeepbuffer(struct cxd56_ep_s *privep)
|
||||
{
|
||||
DEBUGASSERT(privep->epphy); /* Do not use for EP0 */
|
||||
|
||||
|
|
@ -2682,11 +2682,11 @@ static void cxd56_freeepbuffer(FAR struct cxd56_ep_s *privep)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static FAR struct usbdev_ep_s *cxd56_allocep(FAR struct usbdev_s *dev,
|
||||
static struct usbdev_ep_s *cxd56_allocep(struct usbdev_s *dev,
|
||||
uint8_t eplog, bool in,
|
||||
uint8_t eptype)
|
||||
{
|
||||
FAR struct cxd56_usbdev_s *priv = (FAR struct cxd56_usbdev_s *)dev;
|
||||
struct cxd56_usbdev_s *priv = (struct cxd56_usbdev_s *)dev;
|
||||
int ndx;
|
||||
|
||||
usbtrace(TRACE_DEVALLOCEP, eplog);
|
||||
|
|
@ -2766,11 +2766,11 @@ static FAR struct usbdev_ep_s *cxd56_allocep(FAR struct usbdev_s *dev,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static void cxd56_freeep(FAR struct usbdev_s *dev,
|
||||
FAR struct usbdev_ep_s *ep)
|
||||
static void cxd56_freeep(struct usbdev_s *dev,
|
||||
struct usbdev_ep_s *ep)
|
||||
{
|
||||
FAR struct cxd56_ep_s *privep = (FAR struct cxd56_ep_s *)ep;
|
||||
FAR struct cxd56_usbdev_s *pdev = privep->dev;
|
||||
struct cxd56_ep_s *privep = (struct cxd56_ep_s *)ep;
|
||||
struct cxd56_usbdev_s *pdev = privep->dev;
|
||||
irqstate_t flags;
|
||||
|
||||
usbtrace(TRACE_DEVFREEEP, (uint16_t)privep->epphy);
|
||||
|
|
@ -2790,7 +2790,7 @@ static void cxd56_freeep(FAR struct usbdev_s *dev,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int cxd56_getframe(FAR struct usbdev_s *dev)
|
||||
static int cxd56_getframe(struct usbdev_s *dev)
|
||||
{
|
||||
irqstate_t flags;
|
||||
int ret = 0;
|
||||
|
|
@ -2823,7 +2823,7 @@ static int cxd56_getframe(FAR struct usbdev_s *dev)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int cxd56_wakeup(FAR struct usbdev_s *dev)
|
||||
static int cxd56_wakeup(struct usbdev_s *dev)
|
||||
{
|
||||
irqstate_t flags;
|
||||
|
||||
|
|
@ -2843,9 +2843,9 @@ static int cxd56_wakeup(FAR struct usbdev_s *dev)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int cxd56_selfpowered(FAR struct usbdev_s *dev, bool selfpowered)
|
||||
static int cxd56_selfpowered(struct usbdev_s *dev, bool selfpowered)
|
||||
{
|
||||
FAR struct cxd56_usbdev_s *priv = &g_usbdev;
|
||||
struct cxd56_usbdev_s *priv = &g_usbdev;
|
||||
|
||||
usbtrace(TRACE_DEVSELFPOWERED, (uint16_t)selfpowered);
|
||||
|
||||
|
|
@ -2869,7 +2869,7 @@ static int cxd56_selfpowered(FAR struct usbdev_s *dev, bool selfpowered)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int cxd56_pullup(FAR struct usbdev_s *dev, bool enable)
|
||||
static int cxd56_pullup(struct usbdev_s *dev, bool enable)
|
||||
{
|
||||
uint32_t ctrl;
|
||||
uint32_t ep;
|
||||
|
|
@ -2904,7 +2904,7 @@ static int cxd56_pullup(FAR struct usbdev_s *dev, bool enable)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static void cxd56_epinitialize(FAR struct cxd56_usbdev_s *priv)
|
||||
static void cxd56_epinitialize(struct cxd56_usbdev_s *priv)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
|
@ -2937,8 +2937,8 @@ static void cxd56_epinitialize(FAR struct cxd56_usbdev_s *priv)
|
|||
|
||||
for (i = 1; i < CXD56_NENDPOINTS; i++)
|
||||
{
|
||||
FAR const struct cxd56_epinfo_s *info = &g_epinfo[i];
|
||||
FAR struct cxd56_ep_s *privep;
|
||||
const struct cxd56_epinfo_s *info = &g_epinfo[i];
|
||||
struct cxd56_ep_s *privep;
|
||||
|
||||
/* Set up the standard stuff */
|
||||
|
||||
|
|
@ -2988,9 +2988,9 @@ static void cxd56_usbhwuninit(void)
|
|||
* Name: cxd56_vbusinterrupt
|
||||
****************************************************************************/
|
||||
|
||||
static int cxd56_vbusinterrupt(int irq, FAR void *context, FAR void *arg)
|
||||
static int cxd56_vbusinterrupt(int irq, void *context, void *arg)
|
||||
{
|
||||
FAR struct cxd56_usbdev_s *priv = (FAR struct cxd56_usbdev_s *)arg;
|
||||
struct cxd56_usbdev_s *priv = (struct cxd56_usbdev_s *)arg;
|
||||
|
||||
cxd56_cableconnected(true);
|
||||
|
||||
|
|
@ -3030,10 +3030,10 @@ static int cxd56_vbusinterrupt(int irq, FAR void *context, FAR void *arg)
|
|||
* Name: cxd56_vbusninterrupt
|
||||
****************************************************************************/
|
||||
|
||||
static int cxd56_vbusninterrupt(int irq, FAR void *context, FAR void *arg)
|
||||
static int cxd56_vbusninterrupt(int irq, void *context, void *arg)
|
||||
{
|
||||
FAR struct cxd56_usbdev_s *priv = (FAR struct cxd56_usbdev_s *)arg;
|
||||
FAR struct cxd56_ep_s *privep;
|
||||
struct cxd56_usbdev_s *priv = (struct cxd56_usbdev_s *)arg;
|
||||
struct cxd56_ep_s *privep;
|
||||
int i;
|
||||
|
||||
cxd56_cableconnected(false);
|
||||
|
|
@ -3051,7 +3051,7 @@ static int cxd56_vbusninterrupt(int irq, FAR void *context, FAR void *arg)
|
|||
|
||||
for (i = 1; i < CXD56_NENDPOINTS; i++)
|
||||
{
|
||||
privep = (FAR struct cxd56_ep_s *)&priv->eplist[i];
|
||||
privep = (struct cxd56_ep_s *)&priv->eplist[i];
|
||||
|
||||
cxd56_epstall(&privep->ep, false);
|
||||
cxd56_cancelrequests(privep);
|
||||
|
|
@ -3144,7 +3144,7 @@ errout:
|
|||
|
||||
void arm_usbuninitialize(void)
|
||||
{
|
||||
FAR struct cxd56_usbdev_s *priv = &g_usbdev;
|
||||
struct cxd56_usbdev_s *priv = &g_usbdev;
|
||||
irqstate_t flags;
|
||||
|
||||
usbtrace(TRACE_DEVUNINIT, 0);
|
||||
|
|
@ -3188,7 +3188,7 @@ void arm_usbuninitialize(void)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
int usbdev_register(FAR struct usbdevclass_driver_s *driver)
|
||||
int usbdev_register(struct usbdevclass_driver_s *driver)
|
||||
{
|
||||
int ret;
|
||||
|
||||
|
|
@ -3246,9 +3246,9 @@ int usbdev_register(FAR struct usbdevclass_driver_s *driver)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
int usbdev_unregister(FAR struct usbdevclass_driver_s *driver)
|
||||
int usbdev_unregister(struct usbdevclass_driver_s *driver)
|
||||
{
|
||||
FAR struct cxd56_usbdev_s *priv = &g_usbdev;
|
||||
struct cxd56_usbdev_s *priv = &g_usbdev;
|
||||
irqstate_t flags;
|
||||
|
||||
usbtrace(TRACE_DEVUNREGISTER, 0);
|
||||
|
|
@ -3302,7 +3302,7 @@ int usbdev_unregister(FAR struct usbdevclass_driver_s *driver)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static void cxd56_usbreset(FAR struct cxd56_usbdev_s *priv)
|
||||
static void cxd56_usbreset(struct cxd56_usbdev_s *priv)
|
||||
{
|
||||
uint32_t mask;
|
||||
int i;
|
||||
|
|
@ -3358,7 +3358,7 @@ static void cxd56_usbreset(FAR struct cxd56_usbdev_s *priv)
|
|||
|
||||
int cxd56_usbdev_setsigno(int signo)
|
||||
{
|
||||
FAR struct cxd56_usbdev_s *priv = &g_usbdev;
|
||||
struct cxd56_usbdev_s *priv = &g_usbdev;
|
||||
|
||||
uinfo("signo = %d\n", signo);
|
||||
|
||||
|
|
@ -3378,7 +3378,7 @@ int cxd56_usbdev_setsigno(int signo)
|
|||
|
||||
static void cxd56_notify_signal(uint16_t state, uint16_t power)
|
||||
{
|
||||
FAR struct cxd56_usbdev_s *priv = &g_usbdev;
|
||||
struct cxd56_usbdev_s *priv = &g_usbdev;
|
||||
|
||||
if (priv->signo > 0)
|
||||
{
|
||||
|
|
@ -3394,10 +3394,10 @@ static void cxd56_notify_signal(uint16_t state, uint16_t power)
|
|||
* Name: cxd56_usbdev_open
|
||||
****************************************************************************/
|
||||
|
||||
static int cxd56_usbdev_open(FAR struct file *filep, FAR const char *relpath,
|
||||
static int cxd56_usbdev_open(struct file *filep, const char *relpath,
|
||||
int oflags, mode_t mode)
|
||||
{
|
||||
FAR struct cxd56_usbdev_file_s *priv;
|
||||
struct cxd56_usbdev_file_s *priv;
|
||||
|
||||
uinfo("Open '%s'\n", relpath);
|
||||
|
||||
|
|
@ -3415,7 +3415,7 @@ static int cxd56_usbdev_open(FAR struct file *filep, FAR const char *relpath,
|
|||
|
||||
/* Allocate the open file structure */
|
||||
|
||||
priv = (FAR struct cxd56_usbdev_file_s *)kmm_zalloc(
|
||||
priv = (struct cxd56_usbdev_file_s *)kmm_zalloc(
|
||||
sizeof(struct cxd56_usbdev_file_s));
|
||||
if (!priv)
|
||||
{
|
||||
|
|
@ -3427,7 +3427,7 @@ static int cxd56_usbdev_open(FAR struct file *filep, FAR const char *relpath,
|
|||
* filep->f_priv.
|
||||
*/
|
||||
|
||||
filep->f_priv = (FAR void *)priv;
|
||||
filep->f_priv = (void *)priv;
|
||||
return OK;
|
||||
}
|
||||
|
||||
|
|
@ -3435,13 +3435,13 @@ static int cxd56_usbdev_open(FAR struct file *filep, FAR const char *relpath,
|
|||
* Name: modprocfs_close
|
||||
****************************************************************************/
|
||||
|
||||
static int cxd56_usbdev_close(FAR struct file *filep)
|
||||
static int cxd56_usbdev_close(struct file *filep)
|
||||
{
|
||||
FAR struct cxd56_usbdev_file_s *priv;
|
||||
struct cxd56_usbdev_file_s *priv;
|
||||
|
||||
/* Recover our private data from the struct file instance */
|
||||
|
||||
priv = (FAR struct cxd56_usbdev_file_s *)filep->f_priv;
|
||||
priv = (struct cxd56_usbdev_file_s *)filep->f_priv;
|
||||
DEBUGASSERT(priv);
|
||||
|
||||
/* Release the file attributes structure */
|
||||
|
|
@ -3455,11 +3455,11 @@ static int cxd56_usbdev_close(FAR struct file *filep)
|
|||
* Name: cxd56_usbdev_read
|
||||
****************************************************************************/
|
||||
|
||||
static ssize_t cxd56_usbdev_read(FAR struct file *filep, FAR char *buffer,
|
||||
static ssize_t cxd56_usbdev_read(struct file *filep, char *buffer,
|
||||
size_t buflen)
|
||||
{
|
||||
FAR struct cxd56_usbdev_file_s *attr;
|
||||
FAR struct cxd56_usbdev_s *priv = &g_usbdev;
|
||||
struct cxd56_usbdev_file_s *attr;
|
||||
struct cxd56_usbdev_s *priv = &g_usbdev;
|
||||
off_t offset;
|
||||
int ret;
|
||||
|
||||
|
|
@ -3467,7 +3467,7 @@ static ssize_t cxd56_usbdev_read(FAR struct file *filep, FAR char *buffer,
|
|||
|
||||
/* Recover our private data from the struct file instance */
|
||||
|
||||
attr = (FAR struct cxd56_usbdev_file_s *)filep->f_priv;
|
||||
attr = (struct cxd56_usbdev_file_s *)filep->f_priv;
|
||||
DEBUGASSERT(attr);
|
||||
|
||||
/* Traverse all installed modules */
|
||||
|
|
@ -3495,22 +3495,22 @@ static ssize_t cxd56_usbdev_read(FAR struct file *filep, FAR char *buffer,
|
|||
* Name: cxd56_usbdev_dup
|
||||
****************************************************************************/
|
||||
|
||||
static int cxd56_usbdev_dup(FAR const struct file *oldp,
|
||||
FAR struct file *newp)
|
||||
static int cxd56_usbdev_dup(const struct file *oldp,
|
||||
struct file *newp)
|
||||
{
|
||||
FAR struct cxd56_usbdev_file_s *oldattr;
|
||||
FAR struct cxd56_usbdev_file_s *newattr;
|
||||
struct cxd56_usbdev_file_s *oldattr;
|
||||
struct cxd56_usbdev_file_s *newattr;
|
||||
|
||||
uinfo("Dup %p->%p\n", oldp, newp);
|
||||
|
||||
/* Recover our private data from the old struct file instance */
|
||||
|
||||
oldattr = (FAR struct cxd56_usbdev_file_s *)oldp->f_priv;
|
||||
oldattr = (struct cxd56_usbdev_file_s *)oldp->f_priv;
|
||||
DEBUGASSERT(oldattr);
|
||||
|
||||
/* Allocate a new container to hold the task and attribute selection */
|
||||
|
||||
newattr = (FAR struct cxd56_usbdev_file_s *)kmm_malloc(
|
||||
newattr = (struct cxd56_usbdev_file_s *)kmm_malloc(
|
||||
sizeof(struct cxd56_usbdev_file_s));
|
||||
if (!newattr)
|
||||
{
|
||||
|
|
@ -3524,7 +3524,7 @@ static int cxd56_usbdev_dup(FAR const struct file *oldp,
|
|||
|
||||
/* Save the new attributes in the new file structure */
|
||||
|
||||
newp->f_priv = (FAR void *)newattr;
|
||||
newp->f_priv = (void *)newattr;
|
||||
return OK;
|
||||
}
|
||||
|
||||
|
|
@ -3532,7 +3532,7 @@ static int cxd56_usbdev_dup(FAR const struct file *oldp,
|
|||
* Name: cxd56_usbdev_stat
|
||||
****************************************************************************/
|
||||
|
||||
static int cxd56_usbdev_stat(FAR const char *relpath, FAR struct stat *buf)
|
||||
static int cxd56_usbdev_stat(const char *relpath, struct stat *buf)
|
||||
{
|
||||
buf->st_mode = S_IFREG | S_IROTH | S_IRGRP | S_IRUSR;
|
||||
buf->st_size = 0;
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@
|
|||
|
||||
struct cxd56_lowerhalf_s
|
||||
{
|
||||
FAR const struct watchdog_ops_s *ops; /* Lower half operations */
|
||||
const struct watchdog_ops_s *ops; /* Lower half operations */
|
||||
#ifdef CONFIG_CXD56_WDT_INTERRUPT
|
||||
xcpt_t handler; /* Current WDT interrupt handler */
|
||||
#endif
|
||||
|
|
@ -95,21 +95,21 @@ static void cxd56_putreg(uint32_t regval, uintptr_t regaddr);
|
|||
/* Interrupt handling *******************************************************/
|
||||
|
||||
#ifdef CONFIG_CXD56_WDT_INTERRUPT
|
||||
static int cxd56_wdtinterrupt(int irq, FAR void *context, FAR void *arg);
|
||||
static int cxd56_wdtinterrupt(int irq, void *context, void *arg);
|
||||
#endif
|
||||
|
||||
/* "Lower half" driver methods **********************************************/
|
||||
|
||||
static int cxd56_start(FAR struct watchdog_lowerhalf_s *lower);
|
||||
static int cxd56_stop(FAR struct watchdog_lowerhalf_s *lower);
|
||||
static int cxd56_keepalive(FAR struct watchdog_lowerhalf_s *lower);
|
||||
static int cxd56_getstatus(FAR struct watchdog_lowerhalf_s *lower,
|
||||
FAR struct watchdog_status_s *status);
|
||||
static int cxd56_settimeout(FAR struct watchdog_lowerhalf_s *lower,
|
||||
static int cxd56_start(struct watchdog_lowerhalf_s *lower);
|
||||
static int cxd56_stop(struct watchdog_lowerhalf_s *lower);
|
||||
static int cxd56_keepalive(struct watchdog_lowerhalf_s *lower);
|
||||
static int cxd56_getstatus(struct watchdog_lowerhalf_s *lower,
|
||||
struct watchdog_status_s *status);
|
||||
static int cxd56_settimeout(struct watchdog_lowerhalf_s *lower,
|
||||
uint32_t timeout);
|
||||
static xcpt_t cxd56_capture(FAR struct watchdog_lowerhalf_s *lower,
|
||||
static xcpt_t cxd56_capture(struct watchdog_lowerhalf_s *lower,
|
||||
xcpt_t handler);
|
||||
static int cxd56_ioctl(FAR struct watchdog_lowerhalf_s *lower, int cmd,
|
||||
static int cxd56_ioctl(struct watchdog_lowerhalf_s *lower, int cmd,
|
||||
unsigned long arg);
|
||||
static int cxd56_pm_event(uint8_t id);
|
||||
|
||||
|
|
@ -241,9 +241,9 @@ static void cxd56_putreg(uint32_t regval, uintptr_t regaddr)
|
|||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_CXD56_WDT_INTERRUPT
|
||||
static int cxd56_wdtinterrupt(int irq, FAR void *context, FAR void *arg)
|
||||
static int cxd56_wdtinterrupt(int irq, void *context, void *arg)
|
||||
{
|
||||
FAR struct cxd56_lowerhalf_s *priv = arg;
|
||||
struct cxd56_lowerhalf_s *priv = arg;
|
||||
|
||||
/* Is there a registered handler? */
|
||||
|
||||
|
|
@ -276,9 +276,9 @@ static int cxd56_wdtinterrupt(int irq, FAR void *context, FAR void *arg)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int cxd56_start(FAR struct watchdog_lowerhalf_s *lower)
|
||||
static int cxd56_start(struct watchdog_lowerhalf_s *lower)
|
||||
{
|
||||
FAR struct cxd56_lowerhalf_s *priv = (FAR struct cxd56_lowerhalf_s *)lower;
|
||||
struct cxd56_lowerhalf_s *priv = (struct cxd56_lowerhalf_s *)lower;
|
||||
|
||||
wdinfo("Entry\n");
|
||||
|
||||
|
|
@ -305,9 +305,9 @@ static int cxd56_start(FAR struct watchdog_lowerhalf_s *lower)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int cxd56_stop(FAR struct watchdog_lowerhalf_s *lower)
|
||||
static int cxd56_stop(struct watchdog_lowerhalf_s *lower)
|
||||
{
|
||||
FAR struct cxd56_lowerhalf_s *priv = (FAR struct cxd56_lowerhalf_s *)lower;
|
||||
struct cxd56_lowerhalf_s *priv = (struct cxd56_lowerhalf_s *)lower;
|
||||
|
||||
wdinfo("Entry\n");
|
||||
cxd56_putreg(WDOGLOCK_UNLOCK_KEY, CXD56_WDT_WDOGLOCK);
|
||||
|
|
@ -333,7 +333,7 @@ static int cxd56_stop(FAR struct watchdog_lowerhalf_s *lower)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int cxd56_keepalive(FAR struct watchdog_lowerhalf_s *lower)
|
||||
static int cxd56_keepalive(struct watchdog_lowerhalf_s *lower)
|
||||
{
|
||||
wdinfo("Entry\n");
|
||||
cxd56_putreg(WDOGLOCK_UNLOCK_KEY, CXD56_WDT_WDOGLOCK);
|
||||
|
|
@ -358,10 +358,10 @@ static int cxd56_keepalive(FAR struct watchdog_lowerhalf_s *lower)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int cxd56_getstatus(FAR struct watchdog_lowerhalf_s *lower,
|
||||
FAR struct watchdog_status_s *status)
|
||||
static int cxd56_getstatus(struct watchdog_lowerhalf_s *lower,
|
||||
struct watchdog_status_s *status)
|
||||
{
|
||||
FAR struct cxd56_lowerhalf_s *priv = (FAR struct cxd56_lowerhalf_s *)lower;
|
||||
struct cxd56_lowerhalf_s *priv = (struct cxd56_lowerhalf_s *)lower;
|
||||
uint64_t remain;
|
||||
|
||||
wdinfo("Entry\n");
|
||||
|
|
@ -418,10 +418,10 @@ static int cxd56_getstatus(FAR struct watchdog_lowerhalf_s *lower,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int cxd56_settimeout(FAR struct watchdog_lowerhalf_s *lower,
|
||||
static int cxd56_settimeout(struct watchdog_lowerhalf_s *lower,
|
||||
uint32_t timeout)
|
||||
{
|
||||
FAR struct cxd56_lowerhalf_s *priv = (FAR struct cxd56_lowerhalf_s *)lower;
|
||||
struct cxd56_lowerhalf_s *priv = (struct cxd56_lowerhalf_s *)lower;
|
||||
uint32_t reload;
|
||||
uint32_t freq;
|
||||
uint64_t llreload;
|
||||
|
|
@ -504,14 +504,14 @@ static int cxd56_settimeout(FAR struct watchdog_lowerhalf_s *lower,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static xcpt_t cxd56_capture(FAR struct watchdog_lowerhalf_s *lower,
|
||||
static xcpt_t cxd56_capture(struct watchdog_lowerhalf_s *lower,
|
||||
xcpt_t handler)
|
||||
{
|
||||
#ifndef CONFIG_CXD56_WDT_INTERRUPT
|
||||
wderr("ERROR: Not configured for this mode\n");
|
||||
return NULL;
|
||||
#else
|
||||
FAR struct cxd56_lowerhalf_s *priv = (FAR struct cxd56_lowerhalf_s *)lower;
|
||||
struct cxd56_lowerhalf_s *priv = (struct cxd56_lowerhalf_s *)lower;
|
||||
irqstate_t flags;
|
||||
xcpt_t oldhandler;
|
||||
|
||||
|
|
@ -567,7 +567,7 @@ static xcpt_t cxd56_capture(FAR struct watchdog_lowerhalf_s *lower,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int cxd56_ioctl(FAR struct watchdog_lowerhalf_s *lower, int cmd,
|
||||
static int cxd56_ioctl(struct watchdog_lowerhalf_s *lower, int cmd,
|
||||
unsigned long arg)
|
||||
{
|
||||
wdinfo("cmd=%d arg=%ld\n", cmd, arg);
|
||||
|
|
@ -593,7 +593,7 @@ static int cxd56_ioctl(FAR struct watchdog_lowerhalf_s *lower, int cmd,
|
|||
|
||||
static int cxd56_pm_event(uint8_t id)
|
||||
{
|
||||
FAR struct cxd56_lowerhalf_s *priv = &g_wdtdev;
|
||||
struct cxd56_lowerhalf_s *priv = &g_wdtdev;
|
||||
|
||||
switch (id)
|
||||
{
|
||||
|
|
@ -647,7 +647,7 @@ static int cxd56_pm_event(uint8_t id)
|
|||
|
||||
int cxd56_wdt_initialize(void)
|
||||
{
|
||||
FAR struct cxd56_lowerhalf_s *priv = &g_wdtdev;
|
||||
struct cxd56_lowerhalf_s *priv = &g_wdtdev;
|
||||
|
||||
/* set load value to max and lock */
|
||||
|
||||
|
|
@ -666,7 +666,7 @@ int cxd56_wdt_initialize(void)
|
|||
|
||||
/* Register the watchdog driver as /dev/watchdog0 */
|
||||
|
||||
watchdog_register(DEVPATH, (FAR struct watchdog_lowerhalf_s *)priv);
|
||||
watchdog_register(DEVPATH, (struct watchdog_lowerhalf_s *)priv);
|
||||
|
||||
/* Register pm event callback */
|
||||
|
||||
|
|
|
|||
|
|
@ -67,9 +67,9 @@
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
void up_allocate_heap(FAR void **heap_start, size_t *heap_size)
|
||||
void up_allocate_heap(void **heap_start, size_t *heap_size)
|
||||
{
|
||||
board_autoled_on(LED_HEAPALLOCATE);
|
||||
*heap_start = (FAR void *)g_idle_topstack;
|
||||
*heap_start = (void *)g_idle_topstack;
|
||||
*heap_size = (DM320_SDRAM_VADDR + CONFIG_RAM_SIZE) - g_idle_topstack;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -478,44 +478,44 @@ static void dm320_hwinitialize(void);
|
|||
/* Framebuffer interface methods */
|
||||
|
||||
#ifndef CONFIG_DM320_VID0_DISABLE
|
||||
static int dm320_getvid0videoinfo(FAR struct fb_vtable_s *vtable,
|
||||
FAR struct fb_videoinfo_s *vinfo);
|
||||
static int dm320_getvid0planeinfo(FAR struct fb_vtable_s *vtable,
|
||||
static int dm320_getvid0videoinfo(struct fb_vtable_s *vtable,
|
||||
struct fb_videoinfo_s *vinfo);
|
||||
static int dm320_getvid0planeinfo(struct fb_vtable_s *vtable,
|
||||
int planeno,
|
||||
FAR struct fb_planeinfo_s *pinfo);
|
||||
struct fb_planeinfo_s *pinfo);
|
||||
#endif
|
||||
#ifndef CONFIG_DM320_VID1_DISABLE
|
||||
static int dm320_getvid1videoinfo(FAR struct fb_vtable_s *vtable,
|
||||
FAR struct fb_videoinfo_s *vinfo);
|
||||
static int dm320_getvid1planeinfo(FAR struct fb_vtable_s *vtable,
|
||||
static int dm320_getvid1videoinfo(struct fb_vtable_s *vtable,
|
||||
struct fb_videoinfo_s *vinfo);
|
||||
static int dm320_getvid1planeinfo(struct fb_vtable_s *vtable,
|
||||
int planeno,
|
||||
FAR struct fb_planeinfo_s *pinfo);
|
||||
struct fb_planeinfo_s *pinfo);
|
||||
#endif
|
||||
#ifndef CONFIG_DM320_OSD0_DISABLE
|
||||
static int dm320_getosd0videoinfo(FAR struct fb_vtable_s *vtable,
|
||||
FAR struct fb_videoinfo_s *vinfo);
|
||||
static int dm320_getosd0planeinfo(FAR struct fb_vtable_s *vtable,
|
||||
static int dm320_getosd0videoinfo(struct fb_vtable_s *vtable,
|
||||
struct fb_videoinfo_s *vinfo);
|
||||
static int dm320_getosd0planeinfo(struct fb_vtable_s *vtable,
|
||||
int planeno,
|
||||
FAR struct fb_planeinfo_s *pinfo);
|
||||
struct fb_planeinfo_s *pinfo);
|
||||
#endif
|
||||
#ifndef CONFIG_DM320_OSD1_DISABLE
|
||||
static int dm320_getosd1videoinfo(FAR struct fb_vtable_s *vtable,
|
||||
FAR struct fb_videoinfo_s *vinfo);
|
||||
static int dm320_getosd1planeinfo(FAR struct fb_vtable_s *vtable,
|
||||
static int dm320_getosd1videoinfo(struct fb_vtable_s *vtable,
|
||||
struct fb_videoinfo_s *vinfo);
|
||||
static int dm320_getosd1planeinfo(struct fb_vtable_s *vtable,
|
||||
int planeno,
|
||||
FAR struct fb_planeinfo_s *pinfo);
|
||||
struct fb_planeinfo_s *pinfo);
|
||||
#endif
|
||||
#if defined(CONFIG_FB_CMAP) && (!defined(CONFIG_DM320_OSD0_DISABLE) && !defined(CONFIG_DM320_OSD1_DISABLE))
|
||||
static int dm320_getcmap(FAR struct fb_vtable_s *vtable,
|
||||
FAR struct fb_cmap_s *cmap);
|
||||
static int dm320_putcmap(FAR struct fb_vtable_s *vtable,
|
||||
FAR const struct fb_cmap_s *cmap);
|
||||
static int dm320_getcmap(struct fb_vtable_s *vtable,
|
||||
struct fb_cmap_s *cmap);
|
||||
static int dm320_putcmap(struct fb_vtable_s *vtable,
|
||||
const struct fb_cmap_s *cmap);
|
||||
#endif
|
||||
#ifdef CONFIG_FB_HWCURSOR
|
||||
static int dm320_getcursor(FAR struct fb_vtable_s *vtable,
|
||||
FAR struct fb_cursorattrib_s *attrib);
|
||||
static int dm320_setcursor(FAR struct fb_vtable_s *vtable,
|
||||
FAR struct fb_setcursor_s *settings);
|
||||
static int dm320_getcursor(struct fb_vtable_s *vtable,
|
||||
struct fb_cursorattrib_s *attrib);
|
||||
static int dm320_setcursor(struct fb_vtable_s *vtable,
|
||||
struct fb_setcursor_s *settings);
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
|
|
@ -525,9 +525,9 @@ static int dm320_setcursor(FAR struct fb_vtable_s *vtable,
|
|||
/* These are the addresses of allocated framebuffer memory regions */
|
||||
|
||||
#ifndef CONFIG_DM320_VID0_DISABLE
|
||||
static FAR void *g_vid0base = 0;
|
||||
static void *g_vid0base = 0;
|
||||
#ifndef CONFIG_DM320_DISABLE_PINGPONG
|
||||
static FAR void *g_vid0ppbase = 0;
|
||||
static void *g_vid0ppbase = 0;
|
||||
#endif
|
||||
|
||||
static struct fb_vtable_s g_vid0vtable =
|
||||
|
|
@ -543,7 +543,7 @@ static struct fb_vtable_s g_vid0vtable =
|
|||
#endif
|
||||
|
||||
#ifndef CONFIG_DM320_VID1_DISABLE
|
||||
static FAR void *g_vid1base = 0;
|
||||
static void *g_vid1base = 0;
|
||||
|
||||
static struct fb_vtable_s g_vid1vtable =
|
||||
{
|
||||
|
|
@ -557,7 +557,7 @@ static struct fb_vtable_s g_vid1vtable =
|
|||
#endif
|
||||
|
||||
#ifndef CONFIG_DM320_OSD0_DISABLE
|
||||
static FAR void *g_osd0base = 0;
|
||||
static void *g_osd0base = 0;
|
||||
static struct fb_vtable_s g_osd0vtable =
|
||||
{
|
||||
.getvideoinfo = dm320_getosd0videoinfo,
|
||||
|
|
@ -575,7 +575,7 @@ static struct fb_vtable_s g_osd0vtable =
|
|||
#endif
|
||||
|
||||
#ifndef CONFIG_DM320_OSD1_DISABLE
|
||||
static FAR void *g_osd1base = 0;
|
||||
static void *g_osd1base = 0;
|
||||
static struct fb_vtable_s g_osd1vtable =
|
||||
{
|
||||
.getvideoinfo = dm320_getosd1videoinfo,
|
||||
|
|
@ -600,7 +600,7 @@ static inline void dm320_blankscreen(uint8_t *buffer, int len)
|
|||
memset(buffer, 0xff, len);
|
||||
}
|
||||
|
||||
static inline uint32_t dm320_physaddr(FAR void *fb_vaddr)
|
||||
static inline uint32_t dm320_physaddr(void *fb_vaddr)
|
||||
{
|
||||
return (uint32_t)fb_vaddr - DM320_SDRAM_VADDR;
|
||||
}
|
||||
|
|
@ -677,10 +677,10 @@ static int dm320_allocvideomemory(void)
|
|||
{
|
||||
#ifndef CONFIG_DM320_VID0_DISABLE
|
||||
#ifndef CONFIG_DM320_DISABLE_PINGPONG
|
||||
g_vid0base = (FAR void *)kmm_malloc(2 * DM320_VID0_FBLEN);
|
||||
g_vid0ppbase = (FAR char *)g_vid0base + DM320_VID0_FBLEN;
|
||||
g_vid0base = (void *)kmm_malloc(2 * DM320_VID0_FBLEN);
|
||||
g_vid0ppbase = (char *)g_vid0base + DM320_VID0_FBLEN;
|
||||
#else
|
||||
g_vid0base = (FAR void *)kmm_malloc(DM320_VID0_FBLEN);
|
||||
g_vid0base = (void *)kmm_malloc(DM320_VID0_FBLEN);
|
||||
#endif
|
||||
if (!g_vid0base)
|
||||
{
|
||||
|
|
@ -689,7 +689,7 @@ static int dm320_allocvideomemory(void)
|
|||
#endif
|
||||
|
||||
#ifndef CONFIG_DM320_VID1_DISABLE
|
||||
g_vid1base = (FAR void *)kmm_malloc(DM320_VID1_FBLEN);
|
||||
g_vid1base = (void *)kmm_malloc(DM320_VID1_FBLEN);
|
||||
if (!g_vid1base)
|
||||
{
|
||||
goto errout;
|
||||
|
|
@ -697,7 +697,7 @@ static int dm320_allocvideomemory(void)
|
|||
#endif
|
||||
|
||||
#ifndef CONFIG_DM320_OSD0_DISABLE
|
||||
g_osd0base = (FAR void *)kmm_malloc(DM320_OSD0_FBLEN);
|
||||
g_osd0base = (void *)kmm_malloc(DM320_OSD0_FBLEN);
|
||||
if (!g_osd0base)
|
||||
{
|
||||
goto errout;
|
||||
|
|
@ -705,7 +705,7 @@ static int dm320_allocvideomemory(void)
|
|||
#endif
|
||||
|
||||
#ifndef CONFIG_DM320_OSD1_DISABLE
|
||||
g_osd1base = (FAR void *)kmm_malloc(DM320_OSD1_FBLEN);
|
||||
g_osd1base = (void *)kmm_malloc(DM320_OSD1_FBLEN);
|
||||
if (!g_osd1base)
|
||||
{
|
||||
goto errout;
|
||||
|
|
@ -981,8 +981,8 @@ static void dm320_hwinitialize(void)
|
|||
****************************************************************************/
|
||||
|
||||
#ifndef CONFIG_DM320_VID0_DISABLE
|
||||
static int dm320_getvid0videoinfo(FAR struct fb_vtable_s *vtable,
|
||||
FAR struct fb_videoinfo_s *vinfo)
|
||||
static int dm320_getvid0videoinfo(struct fb_vtable_s *vtable,
|
||||
struct fb_videoinfo_s *vinfo)
|
||||
{
|
||||
#ifdef CONFIG_DEBUG_FEATURES
|
||||
if (!vtable || !vinfo)
|
||||
|
|
@ -1004,9 +1004,9 @@ static int dm320_getvid0videoinfo(FAR struct fb_vtable_s *vtable,
|
|||
****************************************************************************/
|
||||
|
||||
#ifndef CONFIG_DM320_VID0_DISABLE
|
||||
static int dm320_getvid0planeinfo(FAR struct fb_vtable_s *vtable,
|
||||
static int dm320_getvid0planeinfo(struct fb_vtable_s *vtable,
|
||||
int planeno,
|
||||
FAR struct fb_planeinfo_s *pinfo)
|
||||
struct fb_planeinfo_s *pinfo)
|
||||
{
|
||||
#ifdef CONFIG_DEBUG_FEATURES
|
||||
if (!vtable || !pinfo)
|
||||
|
|
@ -1029,8 +1029,8 @@ static int dm320_getvid0planeinfo(FAR struct fb_vtable_s *vtable,
|
|||
****************************************************************************/
|
||||
|
||||
#ifndef CONFIG_DM320_VID1_DISABLE
|
||||
static int dm320_getvid1videoinfo(FAR struct fb_vtable_s *vtable,
|
||||
FAR struct fb_videoinfo_s *vinfo)
|
||||
static int dm320_getvid1videoinfo(struct fb_vtable_s *vtable,
|
||||
struct fb_videoinfo_s *vinfo)
|
||||
{
|
||||
#ifdef CONFIG_DEBUG_FEATURES
|
||||
if (!vtable || !vinfo)
|
||||
|
|
@ -1052,9 +1052,9 @@ static int dm320_getvid1videoinfo(FAR struct fb_vtable_s *vtable,
|
|||
****************************************************************************/
|
||||
|
||||
#ifndef CONFIG_DM320_VID1_DISABLE
|
||||
static int dm320_getvid1planeinfo(FAR struct fb_vtable_s *vtable,
|
||||
static int dm320_getvid1planeinfo(struct fb_vtable_s *vtable,
|
||||
int planeno,
|
||||
FAR struct fb_planeinfo_s *pinfo)
|
||||
struct fb_planeinfo_s *pinfo)
|
||||
{
|
||||
#ifdef CONFIG_DEBUG_FEATURES
|
||||
if (!vtable || !pinfo)
|
||||
|
|
@ -1077,8 +1077,8 @@ static int dm320_getvid1planeinfo(FAR struct fb_vtable_s *vtable,
|
|||
****************************************************************************/
|
||||
|
||||
#ifndef CONFIG_DM320_OSD0_DISABLE
|
||||
static int dm320_getosd0videoinfo(FAR struct fb_vtable_s *vtable,
|
||||
FAR struct fb_videoinfo_s *vinfo)
|
||||
static int dm320_getosd0videoinfo(struct fb_vtable_s *vtable,
|
||||
struct fb_videoinfo_s *vinfo)
|
||||
{
|
||||
#ifdef CONFIG_DEBUG_FEATURES
|
||||
if (!vtable || !vinfo)
|
||||
|
|
@ -1104,9 +1104,9 @@ static int dm320_getosd0videoinfo(FAR struct fb_vtable_s *vtable,
|
|||
****************************************************************************/
|
||||
|
||||
#ifndef CONFIG_DM320_OSD0_DISABLE
|
||||
static int dm320_getosd0planeinfo(FAR struct fb_vtable_s *vtable,
|
||||
static int dm320_getosd0planeinfo(struct fb_vtable_s *vtable,
|
||||
int planeno,
|
||||
FAR struct fb_planeinfo_s *pinfo)
|
||||
struct fb_planeinfo_s *pinfo)
|
||||
{
|
||||
#ifdef CONFIG_DEBUG_FEATURES
|
||||
if (!vtable || !pinfo)
|
||||
|
|
@ -1129,8 +1129,8 @@ static int dm320_getosd0planeinfo(FAR struct fb_vtable_s *vtable,
|
|||
****************************************************************************/
|
||||
|
||||
#ifndef CONFIG_DM320_OSD1_DISABLE
|
||||
static int dm320_getosd1videoinfo(FAR struct fb_vtable_s *vtable,
|
||||
FAR struct fb_videoinfo_s *vinfo)
|
||||
static int dm320_getosd1videoinfo(struct fb_vtable_s *vtable,
|
||||
struct fb_videoinfo_s *vinfo)
|
||||
{
|
||||
#ifdef CONFIG_DEBUG_FEATURES
|
||||
if (!vtable || !vinfo)
|
||||
|
|
@ -1156,9 +1156,9 @@ static int dm320_getosd1videoinfo(FAR struct fb_vtable_s *vtable,
|
|||
****************************************************************************/
|
||||
|
||||
#ifndef CONFIG_DM320_OSD1_DISABLE
|
||||
static int dm320_getosd1planeinfo(FAR struct fb_vtable_s *vtable,
|
||||
static int dm320_getosd1planeinfo(struct fb_vtable_s *vtable,
|
||||
int planeno,
|
||||
FAR struct fb_planeinfo_s *pinfo)
|
||||
struct fb_planeinfo_s *pinfo)
|
||||
{
|
||||
#ifdef CONFIG_DEBUG_FEATURES
|
||||
if (!vtable || !pinfo)
|
||||
|
|
@ -1181,8 +1181,8 @@ static int dm320_getosd1planeinfo(FAR struct fb_vtable_s *vtable,
|
|||
****************************************************************************/
|
||||
|
||||
#if defined(CONFIG_FB_CMAP) && (!defined(CONFIG_DM320_OSD0_DISABLE) && !defined(CONFIG_DM320_OSD1_DISABLE))
|
||||
static int dm320_getcmap(FAR struct fb_vtable_s *vtable,
|
||||
FAR struct fb_cmap_s *cmap)
|
||||
static int dm320_getcmap(struct fb_vtable_s *vtable,
|
||||
struct fb_cmap_s *cmap)
|
||||
{
|
||||
/* I don't think the RAM clut is readable */
|
||||
|
||||
|
|
@ -1195,8 +1195,8 @@ static int dm320_getcmap(FAR struct fb_vtable_s *vtable,
|
|||
****************************************************************************/
|
||||
|
||||
#if defined(CONFIG_FB_CMAP) && (!defined(CONFIG_DM320_OSD0_DISABLE) && !defined(CONFIG_DM320_OSD1_DISABLE))
|
||||
static int dm320_putcmap(FAR struct fb_vtable_s *vtable,
|
||||
FAR struct fb_cmap_s *cmap)
|
||||
static int dm320_putcmap(struct fb_vtable_s *vtable,
|
||||
struct fb_cmap_s *cmap)
|
||||
{
|
||||
irqstate_t flags;
|
||||
uint16_t regval;
|
||||
|
|
@ -1251,8 +1251,8 @@ static int dm320_putcmap(FAR struct fb_vtable_s *vtable,
|
|||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_FB_HWCURSOR
|
||||
static int dm320_getcursor(FAR struct fb_vtable_s *vtable,
|
||||
FAR struct fb_cursorattrib_s *attrib)
|
||||
static int dm320_getcursor(struct fb_vtable_s *vtable,
|
||||
struct fb_cursorattrib_s *attrib)
|
||||
{
|
||||
irqstate_t flags;
|
||||
|
||||
|
|
@ -1294,8 +1294,8 @@ static int dm320_getcursor(FAR struct fb_vtable_s *vtable,
|
|||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_FB_HWCURSOR
|
||||
static int dm320_setcursor(FAR struct fb_vtable_s *vtable,
|
||||
FAR struct fb_setcursor_s *settings)
|
||||
static int dm320_setcursor(struct fb_vtable_s *vtable,
|
||||
struct fb_setcursor_s *settings)
|
||||
{
|
||||
irqstate_t flags;
|
||||
uint16_t regval;
|
||||
|
|
@ -1427,7 +1427,7 @@ int up_fbinitialize(int display)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
FAR struct fb_vtable_s *up_fbgetvplane(int display, int vplane)
|
||||
struct fb_vtable_s *up_fbgetvplane(int display, int vplane)
|
||||
{
|
||||
switch (vplane)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int dm320_timerisr(int irq, uint32_t *regs, FAR void *arg)
|
||||
static int dm320_timerisr(int irq, uint32_t *regs, void *arg)
|
||||
{
|
||||
/* Process timer interrupt */
|
||||
|
||||
|
|
|
|||
|
|
@ -271,11 +271,11 @@ static void dm320_putreg32(uint32_t val, uint32_t addr);
|
|||
|
||||
/* Request queue operations *************************************************/
|
||||
|
||||
static FAR struct
|
||||
dm320_req_s *dm320_rqdequeue(FAR struct dm320_ep_s *privep);
|
||||
static struct
|
||||
dm320_req_s *dm320_rqdequeue(struct dm320_ep_s *privep);
|
||||
|
||||
static void dm320_rqenqueue(FAR struct dm320_ep_s *privep,
|
||||
FAR struct dm320_req_s *req);
|
||||
static void dm320_rqenqueue(struct dm320_ep_s *privep,
|
||||
struct dm320_req_s *req);
|
||||
|
||||
/* Low level data transfers and request operations */
|
||||
|
||||
|
|
@ -297,8 +297,8 @@ static void dm320_dispatchrequest(struct dm320_usbdev_s *priv,
|
|||
const struct usb_ctrlreq_s *ctrl);
|
||||
static inline void dm320_ep0setup(struct dm320_usbdev_s *priv);
|
||||
static inline uint32_t dm320_highestpriinterrupt(int intstatus);
|
||||
static int dm320_ctlrinterrupt(int irq, FAR void *context, FAR void *arg);
|
||||
static int dm320_attachinterrupt(int irq, FAR void *context, FAR void *arg);
|
||||
static int dm320_ctlrinterrupt(int irq, void *context, void *arg);
|
||||
static int dm320_attachinterrupt(int irq, void *context, void *arg);
|
||||
|
||||
/* Initialization operations */
|
||||
|
||||
|
|
@ -308,28 +308,28 @@ static void dm320_ctrlinitialize(struct dm320_usbdev_s *priv);
|
|||
|
||||
/* Endpoint methods */
|
||||
|
||||
static int dm320_epconfigure(FAR struct usbdev_ep_s *ep,
|
||||
static int dm320_epconfigure(struct usbdev_ep_s *ep,
|
||||
const struct usb_epdesc_s *desc, bool last);
|
||||
static int dm320_epdisable(FAR struct usbdev_ep_s *ep);
|
||||
static FAR struct usbdev_req_s *dm320_epallocreq(FAR struct usbdev_ep_s *ep);
|
||||
static void dm320_epfreereq(FAR struct usbdev_ep_s *ep,
|
||||
FAR struct usbdev_req_s *req);
|
||||
static int dm320_epdisable(struct usbdev_ep_s *ep);
|
||||
static struct usbdev_req_s *dm320_epallocreq(struct usbdev_ep_s *ep);
|
||||
static void dm320_epfreereq(struct usbdev_ep_s *ep,
|
||||
struct usbdev_req_s *req);
|
||||
#ifdef CONFIG_USBDEV_DMA
|
||||
static FAR void *dm320_epallocbuffer(FAR struct usbdev_ep_s *ep,
|
||||
static void *dm320_epallocbuffer(struct usbdev_ep_s *ep,
|
||||
uint16_t nbytes);
|
||||
static void dm320_epfreebuffer(FAR struct usbdev_ep_s *ep, void *buf);
|
||||
static void dm320_epfreebuffer(struct usbdev_ep_s *ep, void *buf);
|
||||
#endif
|
||||
static int dm320_epsubmit(FAR struct usbdev_ep_s *ep,
|
||||
static int dm320_epsubmit(struct usbdev_ep_s *ep,
|
||||
struct usbdev_req_s *privreq);
|
||||
static int dm320_epcancel(FAR struct usbdev_ep_s *ep,
|
||||
static int dm320_epcancel(struct usbdev_ep_s *ep,
|
||||
struct usbdev_req_s *privreq);
|
||||
|
||||
/* USB device controller methods */
|
||||
|
||||
static FAR struct usbdev_ep_s *dm320_allocep(FAR struct usbdev_s *dev,
|
||||
static struct usbdev_ep_s *dm320_allocep(struct usbdev_s *dev,
|
||||
uint8_t epno, bool in, uint8_t eptype);
|
||||
static void dm320_freeep(FAR struct usbdev_s *dev,
|
||||
FAR struct usbdev_ep_s *ep);
|
||||
static void dm320_freeep(struct usbdev_s *dev,
|
||||
struct usbdev_ep_s *ep);
|
||||
static int dm320_getframe(struct usbdev_s *dev);
|
||||
static int dm320_wakeup(struct usbdev_s *dev);
|
||||
static int dm320_selfpowered(struct usbdev_s *dev, bool selfpowered);
|
||||
|
|
@ -669,9 +669,9 @@ static void dm320_putreg32(uint32_t val, uint32_t addr)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static FAR struct dm320_req_s *dm320_rqdequeue(FAR struct dm320_ep_s *privep)
|
||||
static struct dm320_req_s *dm320_rqdequeue(struct dm320_ep_s *privep)
|
||||
{
|
||||
FAR struct dm320_req_s *ret = privep->head;
|
||||
struct dm320_req_s *ret = privep->head;
|
||||
|
||||
if (ret)
|
||||
{
|
||||
|
|
@ -695,8 +695,8 @@ static FAR struct dm320_req_s *dm320_rqdequeue(FAR struct dm320_ep_s *privep)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static void dm320_rqenqueue(FAR struct dm320_ep_s *privep,
|
||||
FAR struct dm320_req_s *req)
|
||||
static void dm320_rqenqueue(struct dm320_ep_s *privep,
|
||||
struct dm320_req_s *req)
|
||||
{
|
||||
req->flink = NULL;
|
||||
if (!privep->head)
|
||||
|
|
@ -1537,7 +1537,7 @@ static inline uint32_t dm320_highestpriinterrupt(int intstatus)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int dm320_ctlrinterrupt(int irq, FAR void *context, FAR void *arg)
|
||||
static int dm320_ctlrinterrupt(int irq, void *context, void *arg)
|
||||
{
|
||||
struct dm320_usbdev_s *priv = &g_usbdev;
|
||||
struct dm320_ep_s *privep ;
|
||||
|
|
@ -1711,7 +1711,7 @@ static int dm320_ctlrinterrupt(int irq, FAR void *context, FAR void *arg)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int dm320_attachinterrupt(int irq, FAR void *context, FAR void *arg)
|
||||
static int dm320_attachinterrupt(int irq, void *context, void *arg)
|
||||
{
|
||||
struct dm320_usbdev_s *priv = &g_usbdev;
|
||||
uint16_t gio;
|
||||
|
|
@ -1882,7 +1882,7 @@ static inline void dm320_epinitialize(struct dm320_usbdev_s *priv)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static void dm320_ctrlinitialize(FAR struct dm320_usbdev_s *priv)
|
||||
static void dm320_ctrlinitialize(struct dm320_usbdev_s *priv)
|
||||
{
|
||||
/* Setup the USB controller for operation as a periperhal *****************/
|
||||
|
||||
|
|
@ -1957,11 +1957,11 @@ static void dm320_ctrlinitialize(FAR struct dm320_usbdev_s *priv)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int dm320_epconfigure(FAR struct usbdev_ep_s *ep,
|
||||
FAR const struct usb_epdesc_s *desc,
|
||||
static int dm320_epconfigure(struct usbdev_ep_s *ep,
|
||||
const struct usb_epdesc_s *desc,
|
||||
bool last)
|
||||
{
|
||||
FAR struct dm320_ep_s *privep = (FAR struct dm320_ep_s *)ep;
|
||||
struct dm320_ep_s *privep = (struct dm320_ep_s *)ep;
|
||||
|
||||
/* Retain what we need from the descriptor */
|
||||
|
||||
|
|
@ -1979,9 +1979,9 @@ static int dm320_epconfigure(FAR struct usbdev_ep_s *ep,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int dm320_epdisable(FAR struct usbdev_ep_s *ep)
|
||||
static int dm320_epdisable(struct usbdev_ep_s *ep)
|
||||
{
|
||||
FAR struct dm320_ep_s *privep = (FAR struct dm320_ep_s *)ep;
|
||||
struct dm320_ep_s *privep = (struct dm320_ep_s *)ep;
|
||||
irqstate_t flags;
|
||||
|
||||
#ifdef CONFIG_DEBUG_FEATURES
|
||||
|
|
@ -2012,9 +2012,9 @@ static int dm320_epdisable(FAR struct usbdev_ep_s *ep)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static FAR struct usbdev_req_s *dm320_epallocreq(FAR struct usbdev_ep_s *ep)
|
||||
static struct usbdev_req_s *dm320_epallocreq(struct usbdev_ep_s *ep)
|
||||
{
|
||||
FAR struct dm320_req_s *privreq;
|
||||
struct dm320_req_s *privreq;
|
||||
|
||||
#ifdef CONFIG_DEBUG_FEATURES
|
||||
if (!ep)
|
||||
|
|
@ -2023,9 +2023,9 @@ static FAR struct usbdev_req_s *dm320_epallocreq(FAR struct usbdev_ep_s *ep)
|
|||
}
|
||||
#endif
|
||||
|
||||
usbtrace(TRACE_EPALLOCREQ, ((FAR struct dm320_ep_s *)ep)->epphy);
|
||||
usbtrace(TRACE_EPALLOCREQ, ((struct dm320_ep_s *)ep)->epphy);
|
||||
|
||||
privreq = (FAR struct dm320_req_s *)kmm_malloc(sizeof(struct dm320_req_s));
|
||||
privreq = (struct dm320_req_s *)kmm_malloc(sizeof(struct dm320_req_s));
|
||||
if (!privreq)
|
||||
{
|
||||
usbtrace(TRACE_DEVERROR(DM320_TRACEERR_ALLOCFAIL), 0);
|
||||
|
|
@ -2044,10 +2044,10 @@ static FAR struct usbdev_req_s *dm320_epallocreq(FAR struct usbdev_ep_s *ep)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static void dm320_epfreereq(FAR struct usbdev_ep_s *ep,
|
||||
FAR struct usbdev_req_s *req)
|
||||
static void dm320_epfreereq(struct usbdev_ep_s *ep,
|
||||
struct usbdev_req_s *req)
|
||||
{
|
||||
FAR struct dm320_req_s *privreq = (FAR struct dm320_req_s *)req;
|
||||
struct dm320_req_s *privreq = (struct dm320_req_s *)req;
|
||||
|
||||
#ifdef CONFIG_DEBUG_FEATURES
|
||||
if (!ep || !req)
|
||||
|
|
@ -2057,7 +2057,7 @@ static void dm320_epfreereq(FAR struct usbdev_ep_s *ep,
|
|||
}
|
||||
#endif
|
||||
|
||||
usbtrace(TRACE_EPFREEREQ, ((FAR struct dm320_ep_s *)ep)->epphy);
|
||||
usbtrace(TRACE_EPFREEREQ, ((struct dm320_ep_s *)ep)->epphy);
|
||||
kmm_free(privreq);
|
||||
}
|
||||
|
||||
|
|
@ -2070,7 +2070,7 @@ static void dm320_epfreereq(FAR struct usbdev_ep_s *ep,
|
|||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_USBDEV_DMA
|
||||
static void *dm320_epallocbuffer(FAR struct usbdev_ep_s *ep, unsigned bytes)
|
||||
static void *dm320_epallocbuffer(struct usbdev_ep_s *ep, unsigned bytes)
|
||||
{
|
||||
usbtrace(TRACE_EPALLOCBUFFER, privep->epphy);
|
||||
|
||||
|
|
@ -2091,7 +2091,7 @@ static void *dm320_epallocbuffer(FAR struct usbdev_ep_s *ep, unsigned bytes)
|
|||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_USBDEV_DMA
|
||||
static void dm320_epfreebuffer(FAR struct usbdev_ep_s *ep, FAR void *buf)
|
||||
static void dm320_epfreebuffer(struct usbdev_ep_s *ep, void *buf)
|
||||
{
|
||||
usbtrace(TRACE_EPFREEBUFFER, privep->epphy);
|
||||
|
||||
|
|
@ -2111,12 +2111,12 @@ static void dm320_epfreebuffer(FAR struct usbdev_ep_s *ep, FAR void *buf)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int dm320_epsubmit(FAR struct usbdev_ep_s *ep,
|
||||
FAR struct usbdev_req_s *req)
|
||||
static int dm320_epsubmit(struct usbdev_ep_s *ep,
|
||||
struct usbdev_req_s *req)
|
||||
{
|
||||
FAR struct dm320_req_s *privreq = (FAR struct dm320_req_s *)req;
|
||||
FAR struct dm320_ep_s *privep = (FAR struct dm320_ep_s *)ep;
|
||||
FAR struct dm320_usbdev_s *priv;
|
||||
struct dm320_req_s *privreq = (struct dm320_req_s *)req;
|
||||
struct dm320_ep_s *privep = (struct dm320_ep_s *)ep;
|
||||
struct dm320_usbdev_s *priv;
|
||||
irqstate_t flags;
|
||||
int ret = OK;
|
||||
|
||||
|
|
@ -2212,10 +2212,10 @@ static int dm320_epsubmit(FAR struct usbdev_ep_s *ep,
|
|||
****************************************************************************/
|
||||
|
||||
static int dm320_epcancel(struct usbdev_ep_s *ep,
|
||||
FAR struct usbdev_req_s *req)
|
||||
struct usbdev_req_s *req)
|
||||
{
|
||||
FAR struct dm320_ep_s *privep = (FAR struct dm320_ep_s *)ep;
|
||||
FAR struct dm320_usbdev_s *priv;
|
||||
struct dm320_ep_s *privep = (struct dm320_ep_s *)ep;
|
||||
struct dm320_usbdev_s *priv;
|
||||
irqstate_t flags;
|
||||
|
||||
#ifdef CONFIG_DEBUG_FEATURES
|
||||
|
|
@ -2256,11 +2256,11 @@ static int dm320_epcancel(struct usbdev_ep_s *ep,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static FAR struct usbdev_ep_s *dm320_allocep(FAR struct usbdev_s *dev,
|
||||
static struct usbdev_ep_s *dm320_allocep(struct usbdev_s *dev,
|
||||
uint8_t eplog,
|
||||
bool in, uint8_t eptype)
|
||||
{
|
||||
FAR struct dm320_usbdev_s *priv = (FAR struct dm320_usbdev_s *)dev;
|
||||
struct dm320_usbdev_s *priv = (struct dm320_usbdev_s *)dev;
|
||||
int ndx;
|
||||
|
||||
usbtrace(TRACE_DEVALLOCEP, 0);
|
||||
|
|
@ -2319,10 +2319,10 @@ static FAR struct usbdev_ep_s *dm320_allocep(FAR struct usbdev_s *dev,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static void dm320_freeep(FAR struct usbdev_s *dev,
|
||||
FAR struct usbdev_ep_s *ep)
|
||||
static void dm320_freeep(struct usbdev_s *dev,
|
||||
struct usbdev_ep_s *ep)
|
||||
{
|
||||
FAR struct dm320_ep_s *privep = (FAR struct dm320_ep_s *)ep;
|
||||
struct dm320_ep_s *privep = (struct dm320_ep_s *)ep;
|
||||
usbtrace(TRACE_DEVFREEEP, (uint16_t)privep->epphy);
|
||||
UNUSED(privep);
|
||||
|
||||
|
|
@ -2593,7 +2593,7 @@ void arm_usbuninitialize(void)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
int usbdev_register(FAR struct usbdevclass_driver_s *driver)
|
||||
int usbdev_register(struct usbdevclass_driver_s *driver)
|
||||
{
|
||||
int ret;
|
||||
|
||||
|
|
@ -2654,7 +2654,7 @@ int usbdev_register(FAR struct usbdevclass_driver_s *driver)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
int usbdev_unregister(FAR struct usbdevclass_driver_s *driver)
|
||||
int usbdev_unregister(struct usbdevclass_driver_s *driver)
|
||||
{
|
||||
usbtrace(TRACE_DEVUNREGISTER, 0);
|
||||
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@
|
|||
|
||||
struct efm32_dev_s
|
||||
{
|
||||
FAR const struct adc_callback_s *cb;
|
||||
const struct adc_callback_s *cb;
|
||||
uint8_t irq; /* Interrupt generated by this ADC block */
|
||||
uint8_t nchannels; /* Number of channels */
|
||||
uint8_t current; /* Current ADC channel being converted */
|
||||
|
|
@ -107,26 +107,26 @@ static void adc_hw_reset(struct efm32_dev_s *priv, bool reset);
|
|||
/* ADC Interrupt Handler */
|
||||
|
||||
static int adc_interrupt(int irq,
|
||||
FAR void *context, FAR struct adc_dev_s *dev);
|
||||
void *context, struct adc_dev_s *dev);
|
||||
|
||||
/* ADC Driver Methods */
|
||||
|
||||
static int adc_bind(FAR struct adc_dev_s *dev,
|
||||
FAR const struct adc_callback_s *callback);
|
||||
static void adc_reset(FAR struct adc_dev_s *dev);
|
||||
static int adc_setup(FAR struct adc_dev_s *dev);
|
||||
static void adc_shutdown(FAR struct adc_dev_s *dev);
|
||||
static void adc_rxint(FAR struct adc_dev_s *dev, bool enable);
|
||||
static int adc_ioctl(FAR struct adc_dev_s *dev, int cmd, unsigned long arg);
|
||||
static void adc_enable(FAR struct efm32_dev_s *priv, bool enable);
|
||||
static int adc_bind(struct adc_dev_s *dev,
|
||||
const struct adc_callback_s *callback);
|
||||
static void adc_reset(struct adc_dev_s *dev);
|
||||
static int adc_setup(struct adc_dev_s *dev);
|
||||
static void adc_shutdown(struct adc_dev_s *dev);
|
||||
static void adc_rxint(struct adc_dev_s *dev, bool enable);
|
||||
static int adc_ioctl(struct adc_dev_s *dev, int cmd, unsigned long arg);
|
||||
static void adc_enable(struct efm32_dev_s *priv, bool enable);
|
||||
|
||||
#ifdef ADC_HAVE_TIMER
|
||||
static void adc_timstart(FAR struct efm32_dev_s *priv, bool enable);
|
||||
static int adc_timinit(FAR struct efm32_dev_s *priv);
|
||||
static void adc_timstart(struct efm32_dev_s *priv, bool enable);
|
||||
static int adc_timinit(struct efm32_dev_s *priv);
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_EFM32_EFM32GG)
|
||||
static void adc_startconv(FAR struct efm32_dev_s *priv, bool enable);
|
||||
static void adc_startconv(struct efm32_dev_s *priv, bool enable);
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
|
|
@ -720,7 +720,7 @@ endif /* defined(ADC_COUNT) && (ADC_COUNT > 0) */
|
|||
****************************************************************************/
|
||||
|
||||
#ifdef ADC_HAVE_TIMER
|
||||
static void adc_tim_dumpregs(struct efm32_dev_s *priv, FAR const char *msg)
|
||||
static void adc_tim_dumpregs(struct efm32_dev_s *priv, const char *msg)
|
||||
{
|
||||
#if defined(CONFIG_DEBUG_ANALOG) && defined(CONFIG_DEBUG_INFO)
|
||||
ainfo("%s:\n", msg);
|
||||
|
|
@ -866,7 +866,7 @@ static void adc_hw_reset(struct efm32_dev_s *priv, bool reset)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static void adc_enable(FAR struct efm32_dev_s *priv, bool enable)
|
||||
static void adc_enable(struct efm32_dev_s *priv, bool enable)
|
||||
{
|
||||
uint32_t regval;
|
||||
|
||||
|
|
@ -894,10 +894,10 @@ static void adc_enable(FAR struct efm32_dev_s *priv, bool enable)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int adc_bind(FAR struct adc_dev_s *dev,
|
||||
FAR const struct adc_callback_s *callback)
|
||||
static int adc_bind(struct adc_dev_s *dev,
|
||||
const struct adc_callback_s *callback)
|
||||
{
|
||||
FAR struct efm32_dev_s *priv = (FAR struct efm32_dev_s *)dev->ad_priv;
|
||||
struct efm32_dev_s *priv = (struct efm32_dev_s *)dev->ad_priv;
|
||||
|
||||
DEBUGASSERT(priv != NULL);
|
||||
priv->cb = callback;
|
||||
|
|
@ -917,9 +917,9 @@ static int adc_bind(FAR struct adc_dev_s *dev,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static void adc_reset(FAR struct adc_dev_s *dev)
|
||||
static void adc_reset(struct adc_dev_s *dev)
|
||||
{
|
||||
FAR struct efm32_dev_s *priv = (FAR struct efm32_dev_s *)dev->ad_priv;
|
||||
struct efm32_dev_s *priv = (struct efm32_dev_s *)dev->ad_priv;
|
||||
irqstate_t flags;
|
||||
uint32_t regval;
|
||||
int offset;
|
||||
|
|
@ -1073,9 +1073,9 @@ static void adc_reset(FAR struct adc_dev_s *dev)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int adc_setup(FAR struct adc_dev_s *dev)
|
||||
static int adc_setup(struct adc_dev_s *dev)
|
||||
{
|
||||
FAR struct efm32_dev_s *priv = (FAR struct efm32_dev_s *)dev->ad_priv;
|
||||
struct efm32_dev_s *priv = (struct efm32_dev_s *)dev->ad_priv;
|
||||
int ret;
|
||||
|
||||
/* Attach the ADC interrupt */
|
||||
|
|
@ -1109,9 +1109,9 @@ static int adc_setup(FAR struct adc_dev_s *dev)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static void adc_shutdown(FAR struct adc_dev_s *dev)
|
||||
static void adc_shutdown(struct adc_dev_s *dev)
|
||||
{
|
||||
FAR struct efm32_dev_s *priv = (FAR struct efm32_dev_s *)dev->ad_priv;
|
||||
struct efm32_dev_s *priv = (struct efm32_dev_s *)dev->ad_priv;
|
||||
|
||||
/* Disable ADC interrupts and detach the ADC interrupt handler */
|
||||
|
||||
|
|
@ -1135,9 +1135,9 @@ static void adc_shutdown(FAR struct adc_dev_s *dev)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static void adc_rxint(FAR struct adc_dev_s *dev, bool enable)
|
||||
static void adc_rxint(struct adc_dev_s *dev, bool enable)
|
||||
{
|
||||
FAR struct efm32_dev_s *priv = (FAR struct efm32_dev_s *)dev->ad_priv;
|
||||
struct efm32_dev_s *priv = (struct efm32_dev_s *)dev->ad_priv;
|
||||
uint32_t regval;
|
||||
|
||||
ainfo("intf: %d enable: %d\n", priv->intf, enable);
|
||||
|
|
@ -1171,9 +1171,9 @@ static void adc_rxint(FAR struct adc_dev_s *dev, bool enable)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int adc_ioctl(FAR struct adc_dev_s *dev, int cmd, unsigned long arg)
|
||||
static int adc_ioctl(struct adc_dev_s *dev, int cmd, unsigned long arg)
|
||||
{
|
||||
FAR struct efm32_dev_s *priv = (FAR struct efm32_dev_s *)dev->ad_priv;
|
||||
struct efm32_dev_s *priv = (struct efm32_dev_s *)dev->ad_priv;
|
||||
int ret = -ENOTTY;
|
||||
|
||||
switch (cmd)
|
||||
|
|
@ -1210,9 +1210,9 @@ static int adc_ioctl(FAR struct adc_dev_s *dev, int cmd, unsigned long arg)
|
|||
****************************************************************************/
|
||||
|
||||
static int adc_interrupt(int irq,
|
||||
FAR void *context, FAR struct adc_dev_s *dev)
|
||||
void *context, struct adc_dev_s *dev)
|
||||
{
|
||||
FAR struct efm32_dev_s *priv = (FAR struct efm32_dev_s *)dev->ad_priv;
|
||||
struct efm32_dev_s *priv = (struct efm32_dev_s *)dev->ad_priv;
|
||||
uint32_t adcsr;
|
||||
int32_t value;
|
||||
|
||||
|
|
@ -1302,8 +1302,8 @@ static int adc_interrupt(int irq,
|
|||
struct adc_dev_s *efm32_adcinitialize(int intf,
|
||||
const uint8_t *chanlist, int nchannels)
|
||||
{
|
||||
FAR struct adc_dev_s *dev;
|
||||
FAR struct efm32_dev_s *priv;
|
||||
struct adc_dev_s *dev;
|
||||
struct efm32_dev_s *priv;
|
||||
|
||||
ainfo("intf: %d nchannels: %d\n", intf, nchannels);
|
||||
|
||||
|
|
|
|||
|
|
@ -195,7 +195,7 @@ efm32_get_descriptor(struct dma_channel_s *dmach, bool alt)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int efm32_dmac_interrupt(int irq, void *context, FAR void *arg)
|
||||
static int efm32_dmac_interrupt(int irq, void *context, void *arg)
|
||||
{
|
||||
struct dma_channel_s *dmach;
|
||||
unsigned int chndx;
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@
|
|||
* DMA channel.
|
||||
*/
|
||||
|
||||
typedef FAR void *DMA_HANDLE;
|
||||
typedef void *DMA_HANDLE;
|
||||
|
||||
/* Description:
|
||||
* This is the type of the callback that is used to inform the user of the
|
||||
|
|
|
|||
|
|
@ -118,7 +118,7 @@ static int efm32_gpio_interrupt(uint32_t mask, void *context)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int efm32_even_interrupt(int irq, void *context, FAR void *arg)
|
||||
static int efm32_even_interrupt(int irq, void *context, void *arg)
|
||||
{
|
||||
return efm32_gpio_interrupt(0x00005555, context);
|
||||
}
|
||||
|
|
@ -131,7 +131,7 @@ static int efm32_even_interrupt(int irq, void *context, FAR void *arg)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int efm32_odd_interrupt(int irq, void *context, FAR void *arg)
|
||||
static int efm32_odd_interrupt(int irq, void *context, void *arg)
|
||||
{
|
||||
return efm32_gpio_interrupt(0x0000aaaa, context);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -253,48 +253,48 @@ struct efm32_i2c_priv_s
|
|||
* Private Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
static inline uint32_t efm32_i2c_getreg(FAR struct efm32_i2c_priv_s *priv,
|
||||
static inline uint32_t efm32_i2c_getreg(struct efm32_i2c_priv_s *priv,
|
||||
uint8_t offset);
|
||||
static inline void efm32_i2c_putreg(FAR struct efm32_i2c_priv_s *priv,
|
||||
static inline void efm32_i2c_putreg(struct efm32_i2c_priv_s *priv,
|
||||
uint8_t offset, uint32_t value);
|
||||
static inline void efm32_i2c_modifyreg(FAR struct efm32_i2c_priv_s *priv,
|
||||
static inline void efm32_i2c_modifyreg(struct efm32_i2c_priv_s *priv,
|
||||
uint8_t offset, uint32_t clearbits,
|
||||
uint32_t setbits);
|
||||
static inline int efm32_i2c_sem_wait(FAR struct efm32_i2c_priv_s *priv);
|
||||
static inline int efm32_i2c_sem_wait(struct efm32_i2c_priv_s *priv);
|
||||
static int
|
||||
efm32_i2c_sem_wait_noncancelable(FAR struct efm32_i2c_priv_s *priv);
|
||||
efm32_i2c_sem_wait_noncancelable(struct efm32_i2c_priv_s *priv);
|
||||
|
||||
#ifdef CONFIG_EFM32_I2C_DYNTIMEOUT
|
||||
static useconds_t efm32_i2c_tousecs(int msgc, FAR struct i2c_msg_s *msgs);
|
||||
static useconds_t efm32_i2c_tousecs(int msgc, struct i2c_msg_s *msgs);
|
||||
#endif /* CONFIG_EFM32_I2C_DYNTIMEOUT */
|
||||
|
||||
static inline int efm32_i2c_sem_waitdone(FAR struct efm32_i2c_priv_s *priv);
|
||||
static inline void efm32_i2c_sem_post(FAR struct efm32_i2c_priv_s *priv);
|
||||
static inline void efm32_i2c_sem_init(FAR struct efm32_i2c_priv_s *priv);
|
||||
static inline void efm32_i2c_sem_destroy(FAR struct efm32_i2c_priv_s *priv);
|
||||
static inline int efm32_i2c_sem_waitdone(struct efm32_i2c_priv_s *priv);
|
||||
static inline void efm32_i2c_sem_post(struct efm32_i2c_priv_s *priv);
|
||||
static inline void efm32_i2c_sem_init(struct efm32_i2c_priv_s *priv);
|
||||
static inline void efm32_i2c_sem_destroy(struct efm32_i2c_priv_s *priv);
|
||||
|
||||
#ifdef CONFIG_I2C_TRACE
|
||||
static void efm32_i2c_tracereset(FAR struct efm32_i2c_priv_s *priv);
|
||||
static void efm32_i2c_tracenew(FAR struct efm32_i2c_priv_s *priv);
|
||||
static void efm32_i2c_tracedump(FAR struct efm32_i2c_priv_s *priv);
|
||||
static void efm32_i2c_tracereset(struct efm32_i2c_priv_s *priv);
|
||||
static void efm32_i2c_tracenew(struct efm32_i2c_priv_s *priv);
|
||||
static void efm32_i2c_tracedump(struct efm32_i2c_priv_s *priv);
|
||||
#endif /* CONFIG_I2C_TRACE */
|
||||
|
||||
static void efm32_i2c_setclock(FAR struct efm32_i2c_priv_s *priv,
|
||||
static void efm32_i2c_setclock(struct efm32_i2c_priv_s *priv,
|
||||
uint32_t frequency);
|
||||
|
||||
static int efm32_i2c_isr_process(struct efm32_i2c_priv_s *priv);
|
||||
|
||||
#ifndef CONFIG_I2C_POLLED
|
||||
static int efm32_i2c_isr(int irq, void *context, FAR void *arg);
|
||||
static int efm32_i2c_isr(int irq, void *context, void *arg);
|
||||
#endif /* !CONFIG_I2C_POLLED */
|
||||
|
||||
static void efm32_i2c_hwreset(FAR struct efm32_i2c_priv_s *priv);
|
||||
static int efm32_i2c_init(FAR struct efm32_i2c_priv_s *priv);
|
||||
static int efm32_i2c_deinit(FAR struct efm32_i2c_priv_s *priv);
|
||||
static int efm32_i2c_transfer(FAR struct i2c_master_s *dev,
|
||||
FAR struct i2c_msg_s *msgs, int count);
|
||||
static void efm32_i2c_hwreset(struct efm32_i2c_priv_s *priv);
|
||||
static int efm32_i2c_init(struct efm32_i2c_priv_s *priv);
|
||||
static int efm32_i2c_deinit(struct efm32_i2c_priv_s *priv);
|
||||
static int efm32_i2c_transfer(struct i2c_master_s *dev,
|
||||
struct i2c_msg_s *msgs, int count);
|
||||
#ifdef CONFIG_I2C_RESET
|
||||
static int efm32_i2c_reset(FAR struct i2c_master_s *dev);
|
||||
static int efm32_i2c_reset(struct i2c_master_s *dev);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_I2C_TRACE
|
||||
|
|
@ -383,7 +383,7 @@ static struct efm32_i2c_priv_s efm32_i2c1_priv =
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static inline uint32_t efm32_i2c_getreg(FAR struct efm32_i2c_priv_s *priv,
|
||||
static inline uint32_t efm32_i2c_getreg(struct efm32_i2c_priv_s *priv,
|
||||
uint8_t offset)
|
||||
{
|
||||
return getreg32(priv->config->base + offset);
|
||||
|
|
@ -397,7 +397,7 @@ static inline uint32_t efm32_i2c_getreg(FAR struct efm32_i2c_priv_s *priv,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static inline void efm32_i2c_putreg(FAR struct efm32_i2c_priv_s *priv,
|
||||
static inline void efm32_i2c_putreg(struct efm32_i2c_priv_s *priv,
|
||||
uint8_t offset, uint32_t value)
|
||||
{
|
||||
putreg32(value, priv->config->base + offset);
|
||||
|
|
@ -411,7 +411,7 @@ static inline void efm32_i2c_putreg(FAR struct efm32_i2c_priv_s *priv,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static inline void efm32_i2c_modifyreg(FAR struct efm32_i2c_priv_s *priv,
|
||||
static inline void efm32_i2c_modifyreg(struct efm32_i2c_priv_s *priv,
|
||||
uint8_t offset, uint32_t clearbits,
|
||||
uint32_t setbits)
|
||||
{
|
||||
|
|
@ -468,7 +468,7 @@ static const char *efm32_i2c_state_str(int i2c_state)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static inline int efm32_i2c_sem_wait(FAR struct efm32_i2c_priv_s *priv)
|
||||
static inline int efm32_i2c_sem_wait(struct efm32_i2c_priv_s *priv)
|
||||
{
|
||||
return nxsem_wait(&priv->sem_excl);
|
||||
}
|
||||
|
|
@ -482,7 +482,7 @@ static inline int efm32_i2c_sem_wait(FAR struct efm32_i2c_priv_s *priv)
|
|||
****************************************************************************/
|
||||
|
||||
static int
|
||||
efm32_i2c_sem_wait_noncancelable(FAR struct efm32_i2c_priv_s *priv)
|
||||
efm32_i2c_sem_wait_noncancelable(struct efm32_i2c_priv_s *priv)
|
||||
{
|
||||
return nxsem_wait_uninterruptible(&priv->sem_excl);
|
||||
}
|
||||
|
|
@ -497,7 +497,7 @@ static int
|
|||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_EFM32_I2C_DYNTIMEO
|
||||
static useconds_t efm32_i2c_tousecs(int msgc, FAR struct i2c_msg_s *msgs)
|
||||
static useconds_t efm32_i2c_tousecs(int msgc, struct i2c_msg_s *msgs)
|
||||
{
|
||||
size_t bytecount = 0;
|
||||
int i;
|
||||
|
|
@ -526,7 +526,7 @@ static useconds_t efm32_i2c_tousecs(int msgc, FAR struct i2c_msg_s *msgs)
|
|||
****************************************************************************/
|
||||
|
||||
#ifndef CONFIG_I2C_POLLED
|
||||
static inline int efm32_i2c_sem_waitdone(FAR struct efm32_i2c_priv_s *priv)
|
||||
static inline int efm32_i2c_sem_waitdone(struct efm32_i2c_priv_s *priv)
|
||||
{
|
||||
struct timespec abstime;
|
||||
int ret;
|
||||
|
|
@ -599,7 +599,7 @@ static inline int efm32_i2c_sem_waitdone(FAR struct efm32_i2c_priv_s *priv)
|
|||
return ret;
|
||||
}
|
||||
#else
|
||||
static inline int efm32_i2c_sem_waitdone(FAR struct efm32_i2c_priv_s *priv)
|
||||
static inline int efm32_i2c_sem_waitdone(struct efm32_i2c_priv_s *priv)
|
||||
{
|
||||
clock_t timeout;
|
||||
clock_t start;
|
||||
|
|
@ -660,7 +660,7 @@ static inline int efm32_i2c_sem_waitdone(FAR struct efm32_i2c_priv_s *priv)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static inline void efm32_i2c_sem_post(FAR struct efm32_i2c_priv_s *priv)
|
||||
static inline void efm32_i2c_sem_post(struct efm32_i2c_priv_s *priv)
|
||||
{
|
||||
nxsem_post(&priv->sem_excl);
|
||||
}
|
||||
|
|
@ -673,7 +673,7 @@ static inline void efm32_i2c_sem_post(FAR struct efm32_i2c_priv_s *priv)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static inline void efm32_i2c_sem_init(FAR struct efm32_i2c_priv_s *priv)
|
||||
static inline void efm32_i2c_sem_init(struct efm32_i2c_priv_s *priv)
|
||||
{
|
||||
nxsem_init(&priv->sem_excl, 0, 1);
|
||||
|
||||
|
|
@ -695,7 +695,7 @@ static inline void efm32_i2c_sem_init(FAR struct efm32_i2c_priv_s *priv)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static inline void efm32_i2c_sem_destroy(FAR struct efm32_i2c_priv_s *priv)
|
||||
static inline void efm32_i2c_sem_destroy(struct efm32_i2c_priv_s *priv)
|
||||
{
|
||||
nxsem_destroy(&priv->sem_excl);
|
||||
#ifndef CONFIG_I2C_POLLED
|
||||
|
|
@ -712,7 +712,7 @@ static inline void efm32_i2c_sem_destroy(FAR struct efm32_i2c_priv_s *priv)
|
|||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_I2C_TRACE
|
||||
static void efm32_i2c_traceclear(FAR struct efm32_i2c_priv_s *priv)
|
||||
static void efm32_i2c_traceclear(struct efm32_i2c_priv_s *priv)
|
||||
{
|
||||
struct efm32_trace_s *trace = &priv->trace[priv->tndx];
|
||||
|
||||
|
|
@ -723,7 +723,7 @@ static void efm32_i2c_traceclear(FAR struct efm32_i2c_priv_s *priv)
|
|||
trace->time = 0; /* Time of first status or event */
|
||||
}
|
||||
|
||||
static void efm32_i2c_tracereset(FAR struct efm32_i2c_priv_s *priv)
|
||||
static void efm32_i2c_tracereset(struct efm32_i2c_priv_s *priv)
|
||||
{
|
||||
/* Reset the trace info for a new data collection */
|
||||
|
||||
|
|
@ -732,7 +732,7 @@ static void efm32_i2c_tracereset(FAR struct efm32_i2c_priv_s *priv)
|
|||
efm32_i2c_traceclear(priv);
|
||||
}
|
||||
|
||||
static void efm32_i2c_tracenew(FAR struct efm32_i2c_priv_s *priv)
|
||||
static void efm32_i2c_tracenew(struct efm32_i2c_priv_s *priv)
|
||||
{
|
||||
struct efm32_trace_s *trace = &priv->trace[priv->tndx];
|
||||
|
||||
|
|
@ -778,7 +778,7 @@ static void efm32_i2c_tracenew(FAR struct efm32_i2c_priv_s *priv)
|
|||
}
|
||||
}
|
||||
|
||||
static void efm32_i2c_tracedump(FAR struct efm32_i2c_priv_s *priv)
|
||||
static void efm32_i2c_tracedump(struct efm32_i2c_priv_s *priv)
|
||||
{
|
||||
struct efm32_trace_s *trace;
|
||||
int i;
|
||||
|
|
@ -807,7 +807,7 @@ static void efm32_i2c_tracedump(FAR struct efm32_i2c_priv_s *priv)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static void efm32_i2c_setclock(FAR struct efm32_i2c_priv_s *priv,
|
||||
static void efm32_i2c_setclock(struct efm32_i2c_priv_s *priv,
|
||||
uint32_t frequency)
|
||||
{
|
||||
uint32_t div;
|
||||
|
|
@ -1274,7 +1274,7 @@ done:
|
|||
****************************************************************************/
|
||||
|
||||
#ifndef CONFIG_I2C_POLLED
|
||||
static int efm32_i2c_isr(int irq, void *context, FAR void *arg)
|
||||
static int efm32_i2c_isr(int irq, void *context, void *arg)
|
||||
{
|
||||
struct efm32_i2c_priv_s *priv = (struct efm32_i2c_priv_s *)arg;
|
||||
|
||||
|
|
@ -1291,7 +1291,7 @@ static int efm32_i2c_isr(int irq, void *context, FAR void *arg)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static void efm32_i2c_hwreset(FAR struct efm32_i2c_priv_s *priv)
|
||||
static void efm32_i2c_hwreset(struct efm32_i2c_priv_s *priv)
|
||||
{
|
||||
efm32_i2c_putreg(priv, EFM32_I2C_CTRL_OFFSET,
|
||||
_I2C_CTRL_RESETVALUE);
|
||||
|
|
@ -1318,7 +1318,7 @@ static void efm32_i2c_hwreset(FAR struct efm32_i2c_priv_s *priv)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int efm32_i2c_init(FAR struct efm32_i2c_priv_s *priv)
|
||||
static int efm32_i2c_init(struct efm32_i2c_priv_s *priv)
|
||||
{
|
||||
int regval;
|
||||
|
||||
|
|
@ -1388,7 +1388,7 @@ static int efm32_i2c_init(FAR struct efm32_i2c_priv_s *priv)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int efm32_i2c_deinit(FAR struct efm32_i2c_priv_s *priv)
|
||||
static int efm32_i2c_deinit(struct efm32_i2c_priv_s *priv)
|
||||
{
|
||||
/* Disable I2C */
|
||||
|
||||
|
|
@ -1424,10 +1424,10 @@ static int efm32_i2c_deinit(FAR struct efm32_i2c_priv_s *priv)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int efm32_i2c_transfer(FAR struct i2c_master_s *dev,
|
||||
FAR struct i2c_msg_s *msgs, int count)
|
||||
static int efm32_i2c_transfer(struct i2c_master_s *dev,
|
||||
struct i2c_msg_s *msgs, int count)
|
||||
{
|
||||
FAR struct efm32_i2c_priv_s *priv = (struct efm32_i2c_priv_s *)dev;
|
||||
struct efm32_i2c_priv_s *priv = (struct efm32_i2c_priv_s *)dev;
|
||||
int ret;
|
||||
|
||||
DEBUGASSERT(count > 0);
|
||||
|
|
@ -1589,9 +1589,9 @@ static int efm32_i2c_transfer(FAR struct i2c_master_s *dev,
|
|||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_I2C_RESET
|
||||
int efm32_i2c_reset(FAR struct i2c_master_s *dev)
|
||||
int efm32_i2c_reset(struct i2c_master_s *dev)
|
||||
{
|
||||
FAR struct efm32_i2c_priv_s *priv = (struct efm32_i2c_priv_s *)dev;
|
||||
struct efm32_i2c_priv_s *priv = (struct efm32_i2c_priv_s *)dev;
|
||||
unsigned int clock_count;
|
||||
unsigned int stretch_count;
|
||||
uint32_t scl_gpio;
|
||||
|
|
@ -1712,7 +1712,7 @@ out:
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
FAR struct i2c_master_s *efm32_i2cbus_initialize(int port)
|
||||
struct i2c_master_s *efm32_i2cbus_initialize(int port)
|
||||
{
|
||||
struct efm32_i2c_priv_s *priv = NULL;
|
||||
irqstate_t flags;
|
||||
|
|
@ -1761,9 +1761,9 @@ FAR struct i2c_master_s *efm32_i2cbus_initialize(int port)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
int efm32_i2cbus_uninitialize(FAR struct i2c_master_s *dev)
|
||||
int efm32_i2cbus_uninitialize(struct i2c_master_s *dev)
|
||||
{
|
||||
FAR struct efm32_i2c_priv_s *priv = (struct efm32_i2c_priv_s *)dev;
|
||||
struct efm32_i2c_priv_s *priv = (struct efm32_i2c_priv_s *)dev;
|
||||
irqstate_t flags;
|
||||
|
||||
DEBUGASSERT(dev);
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
FAR struct i2c_master_s *efm32_i2cbus_initialize(int port);
|
||||
struct i2c_master_s *efm32_i2cbus_initialize(int port);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: efm32_i2cbus_uninitialize
|
||||
|
|
@ -66,6 +66,6 @@ FAR struct i2c_master_s *efm32_i2cbus_initialize(int port);
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
int efm32_i2cbus_uninitialize(FAR struct i2c_master_s *dev);
|
||||
int efm32_i2cbus_uninitialize(struct i2c_master_s *dev);
|
||||
|
||||
#endif /* __ARCH_ARM_SRC_EFM32_EFM32_I2C_H */
|
||||
|
|
|
|||
|
|
@ -161,7 +161,7 @@ static void efm32_dumpnvic(const char *msg, int irq)
|
|||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_DEBUG_FEATURES
|
||||
static int efm32_nmi(int irq, FAR void *context, FAR void *arg)
|
||||
static int efm32_nmi(int irq, void *context, void *arg)
|
||||
{
|
||||
up_irq_save();
|
||||
_err("PANIC!!! NMI received\n");
|
||||
|
|
@ -169,7 +169,7 @@ static int efm32_nmi(int irq, FAR void *context, FAR void *arg)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int efm32_busfault(int irq, FAR void *context, FAR void *arg)
|
||||
static int efm32_busfault(int irq, void *context, void *arg)
|
||||
{
|
||||
up_irq_save();
|
||||
_err("PANIC!!! Bus fault received: %08x\n", getreg32(NVIC_CFAULTS));
|
||||
|
|
@ -177,7 +177,7 @@ static int efm32_busfault(int irq, FAR void *context, FAR void *arg)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int efm32_usagefault(int irq, FAR void *context, FAR void *arg)
|
||||
static int efm32_usagefault(int irq, void *context, void *arg)
|
||||
{
|
||||
up_irq_save();
|
||||
_err("PANIC!!! Usage fault received: %08x\n", getreg32(NVIC_CFAULTS));
|
||||
|
|
@ -185,7 +185,7 @@ static int efm32_usagefault(int irq, FAR void *context, FAR void *arg)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int efm32_pendsv(int irq, FAR void *context, FAR void *arg)
|
||||
static int efm32_pendsv(int irq, void *context, void *arg)
|
||||
{
|
||||
up_irq_save();
|
||||
_err("PANIC!!! PendSV received\n");
|
||||
|
|
@ -193,7 +193,7 @@ static int efm32_pendsv(int irq, FAR void *context, FAR void *arg)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int efm32_dbgmonitor(int irq, FAR void *context, FAR void *arg)
|
||||
static int efm32_dbgmonitor(int irq, void *context, void *arg)
|
||||
{
|
||||
up_irq_save();
|
||||
_err("PANIC!!! Debug Monitor received\n");
|
||||
|
|
@ -201,7 +201,7 @@ static int efm32_dbgmonitor(int irq, FAR void *context, FAR void *arg)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int efm32_reserved(int irq, FAR void *context, FAR void *arg)
|
||||
static int efm32_reserved(int irq, void *context, void *arg)
|
||||
{
|
||||
up_irq_save();
|
||||
_err("PANIC!!! Reserved interrupt\n");
|
||||
|
|
|
|||
|
|
@ -149,7 +149,7 @@ static int efm32_setup(struct uart_dev_s *dev);
|
|||
static void efm32_shutdown(struct uart_dev_s *dev);
|
||||
static int efm32_attach(struct uart_dev_s *dev);
|
||||
static void efm32_detach(struct uart_dev_s *dev);
|
||||
static int efm32_interrupt(int irq, void *context, FAR void *arg);
|
||||
static int efm32_interrupt(int irq, void *context, void *arg);
|
||||
static int efm32_ioctl(struct file *filep, int cmd, unsigned long arg);
|
||||
static int efm32_receive(struct uart_dev_s *dev, unsigned int *status);
|
||||
static void efm32_rxint(struct uart_dev_s *dev, bool enable);
|
||||
|
|
@ -453,7 +453,7 @@ static void efm32_detach(struct uart_dev_s *dev)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int efm32_interrupt(int irq, void *context, FAR void *arg)
|
||||
static int efm32_interrupt(int irq, void *context, void *arg)
|
||||
{
|
||||
struct uart_dev_s *dev = (struct uart_dev_s *)arg;
|
||||
struct efm32_leuart_s *priv;
|
||||
|
|
|
|||
|
|
@ -75,22 +75,22 @@
|
|||
|
||||
struct efm32_pwmtimer_s
|
||||
{
|
||||
FAR const struct pwm_ops_s *ops; /* PWM operations */
|
||||
uint8_t timid; /* Timer ID {1,...,14} */
|
||||
uint8_t channel; /* Timer output channel: {1,..4} */
|
||||
uint8_t pinloc; /* Timer output channel pin location */
|
||||
const struct pwm_ops_s *ops; /* PWM operations */
|
||||
uint8_t timid; /* Timer ID {1,...,14} */
|
||||
uint8_t channel; /* Timer output channel: {1,..4} */
|
||||
uint8_t pinloc; /* Timer output channel pin location */
|
||||
#ifdef CONFIG_PWM_PULSECOUNT
|
||||
uint8_t irq; /* Timer update IRQ */
|
||||
uint8_t prev; /* The previous value of the RCR (pre-loaded) */
|
||||
uint8_t curr; /* The current value of the RCR (pre-loaded) */
|
||||
uint32_t count; /* Remaining pulse count */
|
||||
uint8_t irq; /* Timer update IRQ */
|
||||
uint8_t prev; /* The previous value of the RCR (pre-loaded) */
|
||||
uint8_t curr; /* The current value of the RCR (pre-loaded) */
|
||||
uint32_t count; /* Remaining pulse count */
|
||||
#endif
|
||||
uint32_t base; /* The base address of the timer */
|
||||
uint32_t pincfg; /* Output pin configuration */
|
||||
uint32_t pclk; /* The frequency of the peripheral clock
|
||||
* that drives the timer module. */
|
||||
uint32_t base; /* The base address of the timer */
|
||||
uint32_t pincfg; /* Output pin configuration */
|
||||
uint32_t pclk; /* The frequency of the peripheral clock
|
||||
* that drives the timer module. */
|
||||
#ifdef CONFIG_PWM_PULSECOUNT
|
||||
FAR void *handle; /* Handle used for upper-half callback */
|
||||
void *handle; /* Handle used for upper-half callback */
|
||||
#endif
|
||||
};
|
||||
|
||||
|
|
@ -105,42 +105,42 @@ static void pwm_putreg(struct efm32_pwmtimer_s *priv, int offset,
|
|||
uint32_t value);
|
||||
|
||||
#ifdef CONFIG_DEBUG_PWM_INFO
|
||||
static void pwm_dumpregs(struct efm32_pwmtimer_s *priv, FAR const char *msg);
|
||||
static void pwm_dumpregs(struct efm32_pwmtimer_s *priv, const char *msg);
|
||||
#else
|
||||
# define pwm_dumpregs(priv,msg)
|
||||
#endif
|
||||
|
||||
/* Timer management */
|
||||
|
||||
static int pwm_timer(FAR struct efm32_pwmtimer_s *priv,
|
||||
FAR const struct pwm_info_s *info);
|
||||
static int pwm_timer(struct efm32_pwmtimer_s *priv,
|
||||
const struct pwm_info_s *info);
|
||||
|
||||
#if defined(CONFIG_PWM_PULSECOUNT) && (defined(CONFIG_EFM32_TIMER0_PWM) || \
|
||||
defined(CONFIG_EFM32_TIMER1_PWM) || \
|
||||
defined(CONFIG_EFM32_TIMER2_PWM) || \
|
||||
defined(CONFIG_EFM32_TIMER3_PWM) \
|
||||
)
|
||||
static int pwm_interrupt(int irq, void *context, FAR void *arg);
|
||||
static int pwm_interrupt(int irq, void *context, void *arg);
|
||||
static uint8_t pwm_pulsecount(uint32_t count);
|
||||
|
||||
#endif
|
||||
|
||||
/* PWM driver methods */
|
||||
|
||||
static int pwm_setup(FAR struct pwm_lowerhalf_s *dev);
|
||||
static int pwm_shutdown(FAR struct pwm_lowerhalf_s *dev);
|
||||
static int pwm_setup(struct pwm_lowerhalf_s *dev);
|
||||
static int pwm_shutdown(struct pwm_lowerhalf_s *dev);
|
||||
|
||||
#ifdef CONFIG_PWM_PULSECOUNT
|
||||
static int pwm_start(FAR struct pwm_lowerhalf_s *dev,
|
||||
FAR const struct pwm_info_s *info,
|
||||
FAR void *handle);
|
||||
static int pwm_start(struct pwm_lowerhalf_s *dev,
|
||||
const struct pwm_info_s *info,
|
||||
void *handle);
|
||||
#else
|
||||
static int pwm_start(FAR struct pwm_lowerhalf_s *dev,
|
||||
FAR const struct pwm_info_s *info);
|
||||
static int pwm_start(struct pwm_lowerhalf_s *dev,
|
||||
const struct pwm_info_s *info);
|
||||
#endif
|
||||
|
||||
static int pwm_stop(FAR struct pwm_lowerhalf_s *dev);
|
||||
static int pwm_ioctl(FAR struct pwm_lowerhalf_s *dev,
|
||||
static int pwm_stop(struct pwm_lowerhalf_s *dev);
|
||||
static int pwm_ioctl(struct pwm_lowerhalf_s *dev,
|
||||
int cmd, unsigned long arg);
|
||||
|
||||
/****************************************************************************
|
||||
|
|
@ -284,7 +284,7 @@ static void pwm_putreg(struct efm32_pwmtimer_s *priv,
|
|||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_DEBUG_PWM_INFO
|
||||
static void pwm_dumpregs(struct efm32_pwmtimer_s *priv, FAR const char *msg)
|
||||
static void pwm_dumpregs(struct efm32_pwmtimer_s *priv, const char *msg)
|
||||
{
|
||||
/* TODO debug pwm_dumpregs */
|
||||
|
||||
|
|
@ -345,8 +345,8 @@ static void pwm_dumpregs(struct efm32_pwmtimer_s *priv, FAR const char *msg)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int pwm_timer(FAR struct efm32_pwmtimer_s *priv,
|
||||
FAR const struct pwm_info_s *info)
|
||||
static int pwm_timer(struct efm32_pwmtimer_s *priv,
|
||||
const struct pwm_info_s *info)
|
||||
{
|
||||
/* Register contents */
|
||||
|
||||
|
|
@ -439,7 +439,7 @@ static int pwm_timer(FAR struct efm32_pwmtimer_s *priv,
|
|||
defined(CONFIG_EFM32_TIMER3_PWM) \
|
||||
)
|
||||
#warning "not yet implemented"
|
||||
static int pwm_interrupt(int irq, void *context, FAR void *arg)
|
||||
static int pwm_interrupt(int irq, void *context, void *arg)
|
||||
{
|
||||
/* TODO pwm_interrupt */
|
||||
#if 0
|
||||
|
|
@ -473,7 +473,7 @@ static int pwm_interrupt(int irq, void *context, FAR void *arg)
|
|||
|
||||
/* Disable first interrupts, stop and reset the timer */
|
||||
|
||||
pwm_stop((FAR struct pwm_lowerhalf_s *)priv);
|
||||
pwm_stop((struct pwm_lowerhalf_s *)priv);
|
||||
|
||||
/* Then perform the callback into the upper half driver */
|
||||
|
||||
|
|
@ -588,9 +588,9 @@ static uint8_t pwm_pulsecount(uint32_t count)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int pwm_setup(FAR struct pwm_lowerhalf_s *dev)
|
||||
static int pwm_setup(struct pwm_lowerhalf_s *dev)
|
||||
{
|
||||
FAR struct efm32_pwmtimer_s *priv = (FAR struct efm32_pwmtimer_s *)dev;
|
||||
struct efm32_pwmtimer_s *priv = (struct efm32_pwmtimer_s *)dev;
|
||||
|
||||
pwminfo("TIMER%d pincfg: %08x\n", priv->timid, priv->pincfg);
|
||||
pwm_dumpregs(priv, "Initially");
|
||||
|
|
@ -644,9 +644,9 @@ static int pwm_setup(FAR struct pwm_lowerhalf_s *dev)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int pwm_shutdown(FAR struct pwm_lowerhalf_s *dev)
|
||||
static int pwm_shutdown(struct pwm_lowerhalf_s *dev)
|
||||
{
|
||||
FAR struct efm32_pwmtimer_s *priv = (FAR struct efm32_pwmtimer_s *)dev;
|
||||
struct efm32_pwmtimer_s *priv = (struct efm32_pwmtimer_s *)dev;
|
||||
uint32_t pincfg;
|
||||
|
||||
pwminfo("TIMER%d pincfg: %08x\n", priv->timid, priv->pincfg);
|
||||
|
|
@ -681,11 +681,11 @@ static int pwm_shutdown(FAR struct pwm_lowerhalf_s *dev)
|
|||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_PWM_PULSECOUNT
|
||||
static int pwm_start(FAR struct pwm_lowerhalf_s *dev,
|
||||
FAR const struct pwm_info_s *info,
|
||||
FAR void *handle)
|
||||
static int pwm_start(struct pwm_lowerhalf_s *dev,
|
||||
const struct pwm_info_s *info,
|
||||
void *handle)
|
||||
{
|
||||
FAR struct efm32_pwmtimer_s *priv = (FAR struct efm32_pwmtimer_s *)dev;
|
||||
struct efm32_pwmtimer_s *priv = (struct efm32_pwmtimer_s *)dev;
|
||||
|
||||
/* Save the handle */
|
||||
|
||||
|
|
@ -696,10 +696,10 @@ static int pwm_start(FAR struct pwm_lowerhalf_s *dev,
|
|||
return pwm_timer(priv, info);
|
||||
}
|
||||
#else
|
||||
static int pwm_start(FAR struct pwm_lowerhalf_s *dev,
|
||||
FAR const struct pwm_info_s *info)
|
||||
static int pwm_start(struct pwm_lowerhalf_s *dev,
|
||||
const struct pwm_info_s *info)
|
||||
{
|
||||
FAR struct efm32_pwmtimer_s *priv = (FAR struct efm32_pwmtimer_s *)dev;
|
||||
struct efm32_pwmtimer_s *priv = (struct efm32_pwmtimer_s *)dev;
|
||||
return pwm_timer(priv, info);
|
||||
}
|
||||
#endif
|
||||
|
|
@ -723,9 +723,9 @@ static int pwm_start(FAR struct pwm_lowerhalf_s *dev,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int pwm_stop(FAR struct pwm_lowerhalf_s *dev)
|
||||
static int pwm_stop(struct pwm_lowerhalf_s *dev)
|
||||
{
|
||||
FAR struct efm32_pwmtimer_s *priv = (FAR struct efm32_pwmtimer_s *)dev;
|
||||
struct efm32_pwmtimer_s *priv = (struct efm32_pwmtimer_s *)dev;
|
||||
irqstate_t flags;
|
||||
|
||||
pwminfo("TIMER%d\n", priv->timid);
|
||||
|
|
@ -764,11 +764,11 @@ static int pwm_stop(FAR struct pwm_lowerhalf_s *dev)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int pwm_ioctl(FAR struct pwm_lowerhalf_s *dev,
|
||||
static int pwm_ioctl(struct pwm_lowerhalf_s *dev,
|
||||
int cmd, unsigned long arg)
|
||||
{
|
||||
#ifdef CONFIG_DEBUG_PWM_INFO
|
||||
FAR struct efm32_pwmtimer_s *priv = (FAR struct efm32_pwmtimer_s *)dev;
|
||||
struct efm32_pwmtimer_s *priv = (struct efm32_pwmtimer_s *)dev;
|
||||
|
||||
/* There are no platform-specific ioctl commands */
|
||||
|
||||
|
|
@ -798,9 +798,9 @@ static int pwm_ioctl(FAR struct pwm_lowerhalf_s *dev,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
FAR struct pwm_lowerhalf_s *efm32_pwminitialize(int timer)
|
||||
struct pwm_lowerhalf_s *efm32_pwminitialize(int timer)
|
||||
{
|
||||
FAR struct efm32_pwmtimer_s *lower;
|
||||
struct efm32_pwmtimer_s *lower;
|
||||
|
||||
pwminfo("TIMER%d\n", timer);
|
||||
|
||||
|
|
@ -840,7 +840,7 @@ FAR struct pwm_lowerhalf_s *efm32_pwminitialize(int timer)
|
|||
up_disable_irq(lower->irq);
|
||||
#endif
|
||||
|
||||
return (FAR struct pwm_lowerhalf_s *)lower;
|
||||
return (struct pwm_lowerhalf_s *)lower;
|
||||
}
|
||||
|
||||
#endif /* CONFIG_EFM32_TIMn_PWM, n = 0,..,3 */
|
||||
|
|
|
|||
|
|
@ -129,7 +129,7 @@ extern "C"
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
FAR struct pwm_lowerhalf_s *efm32_pwminitialize(int timer);
|
||||
struct pwm_lowerhalf_s *efm32_pwminitialize(int timer);
|
||||
|
||||
#undef EXTERN
|
||||
#if defined(__cplusplus)
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ typedef void (*alarmcb_t)(void);
|
|||
|
||||
#ifdef CONFIG_RTC_ALARM
|
||||
struct timespec;
|
||||
int efm32_rtc_setalarm(FAR const struct timespec *tp, alarmcb_t callback);
|
||||
int efm32_rtc_setalarm(const struct timespec *tp, alarmcb_t callback);
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
|
|
|
|||
|
|
@ -160,7 +160,7 @@ volatile bool g_rtc_enabled = false;
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int efm32_rtc_burtc_interrupt(int irq, void *context, FAR void *arg)
|
||||
static int efm32_rtc_burtc_interrupt(int irq, void *context, void *arg)
|
||||
{
|
||||
uint32_t source = getreg32(EFM32_BURTC_IF);
|
||||
|
||||
|
|
@ -417,7 +417,7 @@ time_t up_rtc_time(void)
|
|||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_RTC_HIRES
|
||||
int up_rtc_gettime(FAR struct timespec *tp)
|
||||
int up_rtc_gettime(struct timespec *tp)
|
||||
{
|
||||
uint64_t val;
|
||||
|
||||
|
|
@ -450,7 +450,7 @@ int up_rtc_gettime(FAR struct timespec *tp)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
int up_rtc_settime(FAR const struct timespec *tp)
|
||||
int up_rtc_settime(const struct timespec *tp)
|
||||
{
|
||||
uint32_t cnt_carry;
|
||||
uint32_t cnt;
|
||||
|
|
@ -506,7 +506,7 @@ int up_rtc_settime(FAR const struct timespec *tp)
|
|||
|
||||
#ifdef CONFIG_RTC_ALARM
|
||||
#error "Sorry ! not yet implemented, just copied from STM32"
|
||||
int efm32_rtc_setalarm(FAR const struct timespec *tp, alarmcb_t callback)
|
||||
int efm32_rtc_setalarm(const struct timespec *tp, alarmcb_t callback)
|
||||
{
|
||||
struct rtc_regvals_s regvals;
|
||||
irqstate_t flags;
|
||||
|
|
|
|||
|
|
@ -156,8 +156,8 @@ static void spi_dmarxsetup(struct efm32_spidev_s *priv,
|
|||
static void spi_dmatxsetup(struct efm32_spidev_s *priv,
|
||||
const void *txbuffer, const void *txdummy,
|
||||
size_t nwords);
|
||||
static inline void spi_dmarxstart(FAR struct efm32_spidev_s *priv);
|
||||
static inline void spi_dmatxstart(FAR struct efm32_spidev_s *priv);
|
||||
static inline void spi_dmarxstart(struct efm32_spidev_s *priv);
|
||||
static inline void spi_dmatxstart(struct efm32_spidev_s *priv);
|
||||
#endif
|
||||
|
||||
/* SPI methods */
|
||||
|
|
@ -170,7 +170,7 @@ static uint32_t spi_setfrequency(struct spi_dev_s *dev,
|
|||
static void spi_setmode(struct spi_dev_s *dev, enum spi_mode_e mode);
|
||||
static void spi_setbits(struct spi_dev_s *dev, int nbits);
|
||||
#ifdef CONFIG_SPI_HWFEATURES
|
||||
static int spi_hwfeatures(FAR struct spi_dev_s *dev,
|
||||
static int spi_hwfeatures(struct spi_dev_s *dev,
|
||||
spi_hwfeatures_t features);
|
||||
#endif
|
||||
static uint8_t spi_status(struct spi_dev_s *dev, uint32_t devid);
|
||||
|
|
@ -667,7 +667,7 @@ static void spi_dmatxsetup(struct efm32_spidev_s *priv, const void *txbuffer,
|
|||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_EFM32_SPI_DMA
|
||||
static void spi_dmarxstart(FAR struct efm32_spidev_s *priv)
|
||||
static void spi_dmarxstart(struct efm32_spidev_s *priv)
|
||||
{
|
||||
priv->rxresult = EINPROGRESS;
|
||||
efm32_dmastart(priv->rxdmach, spi_dmarxcallback, priv);
|
||||
|
|
@ -683,7 +683,7 @@ static void spi_dmarxstart(FAR struct efm32_spidev_s *priv)
|
|||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_EFM32_SPI_DMA
|
||||
static inline void spi_dmatxstart(FAR struct efm32_spidev_s *priv)
|
||||
static inline void spi_dmatxstart(struct efm32_spidev_s *priv)
|
||||
{
|
||||
priv->txresult = EINPROGRESS;
|
||||
efm32_dmastart(priv->txdmach, spi_dmatxcallback, priv);
|
||||
|
|
@ -1050,7 +1050,7 @@ static void spi_setbits(struct spi_dev_s *dev, int nbits)
|
|||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_SPI_HWFEATURES
|
||||
static int spi_hwfeatures(FAR struct spi_dev_s *dev,
|
||||
static int spi_hwfeatures(struct spi_dev_s *dev,
|
||||
spi_hwfeatures_t features)
|
||||
{
|
||||
#ifdef CONFIG_SPI_BITORDER
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
void efm32_timer_dumpregs(uintptr_t base, FAR const char *msg)
|
||||
void efm32_timer_dumpregs(uintptr_t base, const char *msg)
|
||||
{
|
||||
#ifdef CONFIG_DEBUG_TIMER_INFO
|
||||
int i;
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue