Commit Graph

4222 Commits

Author SHA1 Message Date
Alin Jerpelea
ef4ba8cb6c drivers: lcd: update licenses to Apache
Gregory Nutt is the copyright holder for those files and he has submitted the
SGA as a result we can migrate the licenses to Apache.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2021-08-17 19:52:31 -07:00
Alin Jerpelea
50976fef14 Uniquix Ltda: update licenses to Apache
Uniquix Ltda has submitted the SGA
as a result we can migrate the licenses to Apache.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2021-08-17 19:52:31 -07:00
Alin Jerpelea
9cb132e797 drivers: video: ov2640: add GPL build barrier
Exclude the ov2640 driver from build unless the license is set to
allow GPL code in the build.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2021-08-17 19:48:45 -07:00
liuhaitao
0c0a43c47b mtd: include nuttx/fs/fs.h explicitly
To fix struct partition_info_s undefined type issue.

Signed-off-by: liuhaitao <liuhaitao@xiaomi.com>
Change-Id: I7c67d0e2f84f4251574a13c22f3bd917742975ea
2021-08-17 00:10:14 -07:00
Xiang Xiao
71269811ca mtd: Implement BIOC_PARTINFO for all drivers
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-08-16 10:08:26 -03:00
Xiang Xiao
6b6c11f0ad mtd: Replace MTDIOC_XIPBASE with BIOC_XIPBASE
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-08-12 08:01:29 -03:00
Xiang Xiao
177e1ced3f Revert "mtd: Add MTDIOC_FLUSH IOCTL like MTDIOC_XIPBASE"
to simplify flt and partion layer implementation

This reverts commit 2e49e1bc5c.
2021-08-12 08:01:29 -03:00
Xiang Xiao
f4addbd640 mtd: Replace MTDIOC_PARTINFO with BIOC_PARTINFO
to simplify flt and partion layer implementation

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-08-12 08:01:29 -03:00
Xiang Xiao
d1687418db mtd: Remove the empty MTDIOC_XIPBASE implmentation
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-08-11 09:50:51 -03:00
Xiang Xiao
76904371a1 fs: Remove endsector from partition_info_s
since it can be computed from startsector and numsectors simply

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-08-11 09:26:43 -03:00
Gustavo Henrique Nihei
62fa4b0018 mtd: Translate BIOC_PARTINFO into MTDIOC_PARTINFO on FTL driver
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2021-08-10 19:45:14 -07:00
Gustavo Henrique Nihei
cddd9c9c38 mtd: Enable retrieval of MTD partition information
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2021-08-10 19:45:14 -07:00
Alan C. Assis
f3d1b6342c mkrd: Fix error: variable 'ret' is uninitialized 2021-08-10 09:08:25 -07:00
Alan C. Assis
e809c80f07 mtd/smartfs: Fix implicit conversion from 'int' to 'short' 2021-08-10 09:08:25 -07:00
raiden00pl
dca8c65331 drivers/qencoder: add command to set the maximum encoder position 2021-08-10 11:19:05 -03:00
Alan C. Assis
c4742c2197 mtd/smartfs: Fix compilation warning 2021-08-09 20:33:05 -03:00
Kenneth Thompson
50c49da078 bch/bchlib_cache.c: Fix error handling 2021-08-09 10:52:08 -07:00
Kenneth Thompson
9d29d4bef5 drivers/bch: Handle return value of bchlib_readsector() 2021-08-09 10:52:08 -07:00
Fotis Panagiotopoulos
59b9a30592 Compile fixes in MCP23X17 driver. 2021-08-09 08:42:53 -03:00
Michal Lenc
87c5cc1a5d adc: add IOCTL commands ANIOC_RESET_FIFO and ANIOC_SAMPLES_ON_READ
This commit adds two new IOCTL commnands for ADC driver. Command
ANIOC_RESET_FIFO resets FIFO head and tail which causes the driver
to wait for the new data to be received. Calling this command before
reading ADC data in user space ensures that the read data are newly
sampled.

Command ANIOC_SAMPLES_ON_READ return the number of read channels in
the buffer. This can be useful in nonblocking mode when the application
needs to get the samples received before the app was started.

Both IOCTL commands are used only in generic driver section only and do
not have any effect on existing architecture specific drivers.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2021-08-06 21:10:59 -07:00
Xiang Xiao
5025fbef8d Rename LIB_ to LIBC_ for all libc Kconfig
follow other libc component naming convention

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-08-05 19:45:24 +02:00
Xiang Xiao
6a396eb224 Fix the printf warning after off_t change
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Id46daa2ee690a73d3187b479f0e7ab0e2e361764
2021-08-04 06:48:30 -07:00
Kenneth Thompson
5588bc4ef6 mtd/ramtron.c: Reassert CS between commands 2021-08-03 10:11:53 -07:00
Xiang Xiao
b3f9ffbe72 Replace all __attribute__((aligned(x)) with aligned_data(x)
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-07-29 21:55:21 -03:00
raiden00pl
919008c51e add upper-half CORDIC driver 2021-07-28 14:23:13 -03:00
Alexander Lunev
ff2dd12c3c bcm43xxx: fixed issues with unaligned buffers for DMA transfers.
This fixes the following errors:
- "stm32_dmacapable: stm32_dmacapable: burst crosses 1KiB
up_assert: Assertion failed at file:chip/stm32_sdio.c line: 2890 task: init"

- "stm32_dmacapable: stm32_dmacapable: burst crosses 1KiB
up_assert: Assertion failed at file:chip/stm32_sdio.c line: 2808 task: bcmf"

bcm43xxx: replaced all occurrences of "__attribute__((packed))" by
compiler independent "begin_packed_struct / end_packed_struct".
2021-07-28 13:47:04 -03:00
anjianjun
2866c27c19 drivers/mmcsd:Send cmd0 just once for Increased compatibility
Signed-off-by: anjianjun <anjianjun@xiaomi.com>
2021-07-28 08:34:09 -03:00
anjianjun
3c393d6dfc drivers/mmcsd:fix build error of debug
Signed-off-by: anjianjun <anjianjun@xiaomi.com>
2021-07-27 20:12:27 -07:00
Xiang Xiao
068353bba7 drivers/rptun: Start/stop remote processor in the background thread
to avoid blocking the main thread initialization process

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Ib8ab2a661ee9540bb03d9d4d851a8d8ee212404e
2021-07-26 19:38:07 -07:00
Masayuki Ishikawa
b63fe511bb drivers: wireless: Fix to set the address family for recvfrom() in gs2200m.c
Summary:
- I noticed that the ntpclient does not work with gs2200m
- Finally, I found that the address family for recvfrom() is not
  set correctly
- This commit fixes this issue

Impact:
- None

Testing:
- Tested with ntpclient

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2021-07-26 07:32:42 -07:00
Jiuzhu Dong
7837a21e4e sensor: directly return -ENOTSUP without the set_interval or batch
implementation for lowerhalf driver.

Change-Id: I7b02e0331e5f8b89b39896049a9e24ce30116f8a
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-07-25 23:29:55 -07:00
Jiuzhu Dong
19cea67f3e syslog: reslove crash because vmov.i32 instruction is not ready when system boot
So avoid to use vmov.i32 instruction before FPU is ready.

Before modification:
3c03b35c <nx_vsyslog>:
3c03b35c:	f2c00010 	vmov.i32	d16, #0	; 0x00000000
3c03b360:	f2c02050 	vmov.i32	q9, #0	; 0x00000000
3c03b364:	e92d40f0 	push	{r4, r5, r6, r7, lr}
3c03b368:	e24dd08c 	sub	sp, sp, #140	; 0x8c
3c03b36c:	e28d301c 	add	r3, sp, #28
3c03b370:	e2505000 	subs	r5, r0, #0
3c03b374:	edcd0b0f 	vstr	d16, [sp, #60]	; 0x3c
3c03b378:	edcd0b01 	vstr	d16, [sp, #4]

After modification:
3c03b35c <nx_vsyslog>:
3c03b35c:       e92d40f0        push    {r4, r5, r6, r7, lr}
3c03b360:       e2505000        subs    r5, r0, #0
3c03b364:       e24dd08c        sub     sp, sp, #140    ; 0x8c
3c03b368:       e1a06001        mov     r6, r1
3c03b36c:       e1a07002        mov     r7, r2
3c03b370:       e28d000c        add     r0, sp, #12
3c03b374:       1a00003a        bne     3c03b464 <nx_vsyslog+0x108>

Change-Id: I643c19f5416c94a529764fdaa81f3088fcf95355
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-07-25 23:02:04 -07:00
Alan C. Assis
5500dcdf64 Fix typo on HT16K33 name 2021-07-25 09:00:39 -07:00
jordi
f3af6edf93 Kconfig: add quotes in source to clean warnings from setconfig
To avoid the setconfig warning "style: quotes recommended around xxx in
source xxx"
2021-07-23 02:32:19 -07:00
Nathan Hartman
609ee6b54b Fix typos in comments and identifiers 2021-07-19 22:55:30 -03:00
Jiuzhu Dong
3834e7e2c9 serial: use Ctrl+? composite key to force panic"
N/A

Change-Id: I249312538107266d343e326b9c966012678e6a00
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-07-19 04:24:37 -07:00
Alin Jerpelea
7689392528 author: Zilogic Systems: update licenses to Apache
Gregory Nutt has submitted the SGA

Zilogic Systems has submitted the SGA

Uniquix Tecnologia has submitted the SGA

Michael Jung has submitted the ICLA

Alan Carvalho de Assis has submitted the ICLA

as a result we can migrate the licenses to Apache.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2021-07-19 03:08:00 -07:00
Gustavo Henrique Nihei
882a0964b3 drivers/mtd: Implement MTDIOC_ERASESTATE for MTD drivers
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2021-07-17 09:00:41 -07:00
buyuer
0d36b2d889 Fakesensor: support gps by read nema csv.
Currently, can only analyze GGA statement.

Signed-off-by: buyuer <dingddding@163.com>
2021-07-15 02:25:32 -07:00
David Sidrane
3e4b3ada5e syslog:syslog_channel:Fix compiler warnings
syslog_channel.c:98:8: error: unknown type name 'sem_t'
   syslog/syslog_channel.c:99:14: error: 'g_syslog_default_sem'
   defined but not used
2021-07-14 17:38:30 -07:00
ligd
136662f5f9 serial: add ctrl+@ to force crash system for debugging
Change-Id: Iee65ac6c94ff298cfadf4429936b3744c16b8698
Signed-off-by: ligd <liguiding1@xiaomi.com>
2021-07-13 14:45:09 -03:00
chao.an
80bfe13b54 drivers/rptun: replace the notification mech from signal to semaphore
Change-Id: Ic06b945effa876f5aff2f8ddc1fe5775c75f77b1
Signed-off-by: chao.an <anchao@xiaomi.com>
(cherry picked from commit 8df58e5675cab032da16e371c4686929a19ee897)
2021-07-13 09:44:00 -03:00
Jiuzhu Dong
0c3cb0cb66 syslog: optimize init logic for early buffer initialize
N/A

Change-Id: I3295803977fa51e8ed8dedf7f0966b9604f8204d
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-07-10 11:10:13 -07:00
Jiuzhu Dong
4bb48892d0 ramlog: init head and tail when buffer is empty on boot
N/A

Change-Id: I6963ef6256c3a93ac7a63115c303033ceafa321f
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-07-10 11:10:13 -07:00
Jiuzhu Dong
c8ce33c634 syslog/intbuf: output log when syslog interrupt buffer is full
N/A
instead of adding overrun memssage:"[truncated]\n" to the end.

Change-Id: Ie27cdf0ca902d9ba203619a95162f01222e371c5
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-07-10 11:08:59 -07:00
Alexander Lunev
9e27888938 bcm43xxx: supported IW_AUTH_CIPHER_NONE mode 2021-07-09 21:34:05 -07:00
Alexander Lunev
ace43936c1 bcm43xxx: nxstyle fixes ("error: Mixed case identifier found") 2021-07-09 21:34:05 -07:00
Gustavo Henrique Nihei
d12619c85f drivers/syslog: Avoid prepending process name when no TCB is available
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2021-07-08 21:13:36 -05:00
Xiang Xiao
8fe701c8ae note/notelog: Implement more sched_note callback
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-07-04 18:52:32 -03:00
Xiang Xiao
0941bad877 note: Move up_schednote.c to drivers/note folder
since it is general enough to work on other target

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-07-04 18:52:32 -03:00
Nathan Hartman
ce20211357 Fix various typos in comments and documentation
Fix typos in these files:
    * Documentation/components/drivers/character/foc.rst
    * Documentation/guides/cpp_cmake.rst
    * Kconfig
    * arch/arm/src/imxrt/imxrt_lpspi.c
    * arch/arm/src/kinetis/kinetis_spi.c
    * arch/arm/src/kl/kl_spi.c
    * arch/arm/src/lpc31xx/lpc31_spi.c
    * arch/arm/src/nrf52/nrf52_radio.h
    * arch/arm/src/s32k1xx/s32k1xx_lpspi.c
    * arch/arm/src/stm32/Kconfig
    * arch/arm/src/stm32/stm32_adc.c
    * arch/arm/src/stm32/stm32_foc.c
    * arch/arm/src/stm32/stm32_foc.h
    * arch/arm/src/stm32/stm32_pwm.c
    * arch/arm/src/stm32/stm32_spi.c
    * arch/arm/src/stm32f0l0g0/stm32_spi.c
    * arch/arm/src/stm32f7/Kconfig
    * arch/arm/src/stm32f7/stm32_spi.c
    * arch/arm/src/stm32h7/Kconfig
    * arch/arm/src/stm32h7/stm32_allocateheap.c
    * arch/arm/src/stm32h7/stm32_fmc.c
    * arch/arm/src/stm32h7/stm32_fmc.h
    * arch/arm/src/stm32h7/stm32_pwm.c
    * arch/arm/src/stm32h7/stm32_qspi.c
    * arch/arm/src/stm32h7/stm32_spi.c
    * arch/arm/src/stm32l4/stm32l4_pwm.c
    * arch/arm/src/stm32l4/stm32l4_spi.c
    * arch/arm/src/stm32l5/Kconfig
    * arch/arm/src/stm32l5/stm32l5_spi.c
    * arch/renesas/src/rx65n/rx65n_dtc.c
    * arch/renesas/src/rx65n/rx65n_usbdev.c
    * arch/risc-v/src/rv32m1/rv32m1_serial.c
    * boards/arm/stm32/b-g431b-esc1/src/stm32_foc.c
    * boards/arm/stm32/nucleo-f103rb/src/stm32_foc_ihm07m1.c
    * boards/arm/stm32/nucleo-f302r8/src/stm32_foc_ihm07m1.c
    * boards/arm/stm32h7/nucleo-h743zi2/README.txt
    * boards/risc-v/rv32m1/rv32m1-vega/README.txt
    * boards/sim/sim/sim/scripts/Make.defs
    * drivers/1wire/1wire.c
    * drivers/1wire/1wire_internal.h
    * drivers/lcd/Kconfig
    * drivers/syslog/ramlog.c
    * fs/fat/Kconfig
    * libs/libc/debug/Kconfig
    * libs/libc/machine/Kconfig
    * libs/libc/stdio/lib_libvsprintf.c
    * libs/libc/stdlib/lib_div.c
    * libs/libc/stdlib/lib_ldiv.c
    * libs/libc/stdlib/lib_lldiv.c
    * libs/libdsp/lib_observer.c
2021-07-04 11:23:26 -05:00
Jiuzhu Dong
817259ec2d syslog/ramlog_channel: fix log confusion when multi task writing together
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-07-03 11:24:21 -05:00
Jiuzhu Dong
7fa69e4173 syslog/ramlog: get ramlog size by ioctl
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-07-03 11:24:21 -05:00
Jiuzhu Dong
b30bf4ff06 syslog/default_channel: fix log confusion when multi task writing together
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-07-03 11:24:21 -05:00
Peter Bee
23746d171f Add putarea() method for st7789
add st7789_putarea()

Signed-off-by: Peter Bee <bijunda1@xiaomi.com>
2021-07-02 10:08:26 -05:00
ligd
b86bcff2eb serial: add ioctl TIOCNOTTY
Change-Id: I14ab1304d6330578423e0775f42faa8e19886fef
Signed-off-by: ligd <liguiding1@xiaomi.com>
2021-07-02 07:20:42 -05:00
Jiuzhu Dong
a75b712e77 syslog: fix crash when print localtime by syslog
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-07-02 04:57:11 -05:00
ligd
5de150160f syslog: add CPU id to system when open CONFIG_SMP
Change-Id: Ie8aaf44583ff4146b79b1392d1410b31806a81e8
Signed-off-by: ligd <liguiding1@xiaomi.com>
2021-07-02 08:45:43 +09:00
Nathan Hartman
ee81b5a1d5 drivers/sensors/hyt271: Fix typos in comments and identifier
drivers/sensors/hyt271.c:

    * struct hyt271_dev_s: Identifier "lock_measure_cylce" was
      misspelled. Fix to "lock_measure_cycle" and update all instances
      in the file.

    * hyt271_mr(), hyt271_cmd(), hyt271_change_addr(),
      hyt271_measure_read(), hyt271_thread(): Update instances of the
      renamed "lock_measure_cycle" variable and fix various typos in
      comments.
2021-07-01 12:43:18 -05:00
buyuer
82f57bd3f9 driver/fakesensor: fix bugs.
1.fix crash casued by closing the handle during the reading.
2.fix set_interval fail sometime:When fakesensor was activated, csv file is not opened timely, so
the sensor->interval that set_interval() seted will be coverd by
interval form csv file.

Signed-off-by: buyuer <dingddding@163.com>
2021-07-01 01:34:45 -05:00
Masayuki Ishikawa
c89c11a078 drivers: wireless: Fix error handling in gs2200m_ioctl_send()
Summary:
- I noticed that NFS over TCP does not work correctly when
  it tried to reconnect to the NFS server.
- This commit fixes this issue

Impact:
- gs2200m only

Testing:
- Tested with spresense:wifi_smp
- NOTE: need to update gs2200m_main.c

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2021-06-28 21:48:47 -05:00
Xiang Xiao
ae9b5fd306 Replace mktime with timegm in rtc and fs driver
since kernel component should use UTC instead local time

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Icf939e1ab0af8e577105f539d2553bc67b3b3d10
2021-06-23 13:43:32 -03:00
Juha Niskanen
2f15fd2464 drivers/ioexpander/gpio_lower_half.c: add missing debug.h
Signed-off-by: Juha Niskanen <juha.niskanen@haltian.com>
2021-06-23 11:07:47 -05:00
Alexander Lunev
f7c8875fd7 sdio,stm32h7: fixed an issue with not starting IDMA data transfer in case of IO_RW_EXTENDED command (CMD53);
corrected setting SDMMC_DCTRL.DTMODE field for block data transfers ending on block count
and for block data transfers ending with STOP_TRANSMISSION command;
stm32_sdio: added more debug messages
2021-06-21 02:47:46 -05:00
Fotis Panagiotopoulos
b16de69e56 syslog: Added channel close callback. 2021-06-18 00:47:09 -05:00
Xiang Xiao
80157b8782 syslog/ramlog: Remove the duplication of \n->\r\n conversion
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I5497f3ab40a55c5c08ba893e1186b93915cef03a
2021-06-17 06:22:28 -07:00
retogaeh
d54b2126a0 Update drivers/analog/adc.c
Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com>
2021-06-16 04:58:06 -07:00
GAEHWILER Reto
b9fba3edae stm32h7 fix adc port to handle overrun and the DR's fifo, adapt adc driver
* port didn't know about data-register fifo
* port didn't handle overrun condition
* driver could get stuck if interrupts were skipped due to saturation
2021-06-16 04:58:06 -07:00
Xiang Xiao
2e49e1bc5c mtd: Add MTDIOC_FLUSH IOCTL like MTDIOC_XIPBASE
since the old design reuse BIOC_FLUSH for
MTD device which make some confusion

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-06-15 13:26:45 -03:00
Yuichi Nakamura
8d722709cd usbmsc: Add USBMSC_NOT_STALL_BULKEP for RP2040 workaround
The new configuration CONFIG_USBMSC_NOT_STALL_BULKEP avoids to go into
stall state when :
- Receiving SCSI_CMD_INQUIRY with flags or pagecode != 0
- Receiving SCSI_CMD_MODESENSE6 and return the result data shorter than
  the requested data size.
Instead of stall, it just ignores the error condition.

Originally the usb driver goes into the stall under the conditions
mentioned above to inform to the USB host that the requested SCSI feature
is not supported, or the result data is shorter than the requested data
size.
But, at this moment, RP2040 USB device driver cannot handle entering and
leaving stall state of the bulk endpoints well.  Once stalls, the host -
device communication stops and cannot be resumed.

I have investigated to solve the issue and found that the existing
RP2040 USB device driver implementation, TinyUSB
(https://github.com/hathach/tinyusb) mass-storage class driver doesn't
enter the stall state like the treatment of this patch.

So, I introduce this new configuration as the RP2040 workaround.
In the future, when the RP2040 USB device driver is fixed and can handle
the bulk endpoint stall correctly, this patch should be reverted.
2021-06-14 09:05:19 -03:00
chao.an
50f415d529 net/telnet: fix a potential busyloop if rxbuffer writes faster than read
Signed-off-by: chao.an <anchao@xiaomi.com>
2021-06-13 05:06:54 -05:00
Xiang Xiao
7ff6aac43a serial/pty: Initialize the terminal setting as a console
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Ie80a22b7a074d048435524d86f0ca7fc7a20e756
2021-06-12 09:52:05 +09:00
Xiang Xiao
4e038c1724 serial/pty: Don't return -NOSYS if pollfd::events equals 0
since the caller is free not to monitor any event

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Ib957be1b1b5a686faea0196bc9069e0908a492eb
2021-06-11 08:22:41 -07:00
Fotis Panagiotopoulos
b73dc0f166 syslog: Added separator in file logs. 2021-06-09 10:09:04 -05:00
Xiang Xiao
5b2a17b892 Include assert.h in necessary place
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-06-08 13:06:08 -07:00
Fotis Panagiotopoulos
37ec290a11 Syslog file rotations number is configurable. 2021-06-08 04:12:48 -05:00
Alan C. Assis
3859031a6b Fix ht16k33 driver to support multi-modules 2021-06-07 01:08:11 -05:00
Xiang Xiao
f7c0d46ed8 serial: Remove the unnecessary err_out label 2021-06-07 07:55:14 +09:00
Masayuki Ishikawa
3ccef09b4e drivers: serial: Remove an unnecessary critical section (cs) for SMP
Summary:
- I thought this cs is needed to avoid data corruption
- For example, while executing uart_xmitchar() in the interrupt
  handler on CPU0, an application running on CPU1 can call
  uart_putxmitchar() via write()->uart_write().
- In this case, taking xmit.sem in uart_write() will wait for CPU0
  to finish uart_xmitchar() because CPU0 has already taken a cs
  in uart_xmitchar() then nxsem_wait() on CPU0 takes a new cs
  inside (and release the cs when returning but it's OK)
- Then uart_write() on CPU1 disables UART TX, so uart_xmitchar()
  on CPU0 will not be called while executing uart_write() on CPU1.
- So this critical section in uart_putxmitchar() can be removed.

Impact:
- None

Testing:
- Tested with spresense:wifi_smp, esp32-devkitc:smp

Reported-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2021-06-05 22:33:09 -05:00
Alan C. Assis
54134507ff lcd: Add support to Holtek HT16K33 as 14-segment display controller 2021-06-05 20:32:04 -05:00
Gustavo Henrique Nihei
0b3c2c7603 spi: Refactor SPI Slave interface prefix to sync with I2C Slave 2021-06-05 04:50:34 -07:00
Gustavo Henrique Nihei
91b1de4a67 drivers/spi: Include missing assert.h header 2021-06-05 04:50:34 -07:00
Fotis Panagiotopoulos
216194d31b Added automatic log rotation, when log file is opened. 2021-06-03 15:57:28 -03:00
Xiang Xiao
2e54df0f35 Don't include assert.h from public header file
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-06-03 08:36:03 -07:00
Fotis Panagiotopoulos
e189d83e11 SYSLOG channel add functions return handle to the channel. 2021-06-03 08:36:15 -05:00
Masayuki Ishikawa
822002d347 drivers: audio: Apply CXD56_PHYSADDR to cxd56.c
Summary:
- This commit converts data to the physical address for DMA transfer.

Impact:
- cxd56.c only

Testing
- Tested with nxplayer and nxrecorder

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2021-06-02 22:13:10 -05:00
Xiang Xiao
81e63e3a63 serial: Remove the unnecessary critical section in uart_pollnotify
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-06-02 15:46:53 -07:00
Jiuzhu Dong
ed6b257fa4 syslog: support ramlog, up_putc, rpmsg_syslog coexist
N/A

Change-Id: Ia58c7e195da7ad48f3018a131a78b2f01f94e741
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-06-02 08:45:20 -05:00
Jiuzhu Dong
01ff3604b0 syslog/Kconfig: support config multi syslog channel
delete choice for select syslog log device

Change-Id: Ifc02e687526506afac46febec375062949869356
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-06-02 08:45:20 -05:00
Jiuzhu Dong
e21fddbb34 syslog/emerg: fix bug about printing LOG_EMERG log from iob buffer
The patch is related to: commit 5f7c98b6e1

Author: Xiang Xiao <xiaoxiang@xiaomi.com>
Date:   Mon May 17 22:38:22 2021 +0800

    drivers/syslog: Remove emergstream implementation and caller

    since emergstream always call syslog_force, but syslog_force is designed
    for the interrupt context, and then doesn't mean any emergency thing.
    On the other hand, emergstream has other bad side effect:
    1.Can't output to file or dev channel
    2.Can't work well with the interrupt buffer

    Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>

Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-06-02 10:25:19 -03:00
Jiuzhu Dong
aeb7ed8c53 syslog/ramlog: initialize g_sysdev based on the current ramlog buffer
by ramlog_initbuf();
Algorithm: Scan the entire ramlog buffer, the position of the head
is the first byte is not empty and second byte is empty. The position
of the tail is the first byte is empty and second byte is not empty.

Change-Id: Ieb9161bd670481cd335e9a901287cd5e589f0849
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-06-01 15:16:45 -03:00
Jiuzhu Dong
ec38d0ce98 syslog/ramlog: save ramlog to fixed section
we can reload ramlog after hot reboot.

Change-Id: Iee7c105a2358075302121d6bf0047bc54d07e9a6
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-06-01 15:16:45 -03:00
Jiuzhu Dong
4ae6862bbe syslog: fix bug about syslog_default_write
Change-Id: I6d8b5bce8071f11b1903fe1fa0fe8dbc34bf3a09
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-06-01 12:44:17 -05:00
Masayuki Ishikawa
ab7ceb26e0 drivers: wireless: Remove ASSERT() in _check_pkt_q_empty() in gs2200m.c
Summary:
- During Wi-Fi stress test, sometimes ASSERT() happens in gs2200m.c
- This commit removes the ASSERT() but calls _remove_all_pkt()
  for a workaround.

Impact:
- None

Testing:
- Tested with spresense:wifi_smp

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2021-05-31 21:27:28 -05:00
Xiang Xiao
d7f96003cf Don't include debug.h from public header file
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-06-01 06:42:02 +09:00
Gustavo Henrique Nihei
8a41d849df drivers/spi: Change prefix to a more intuitive "spislave" 2021-05-31 07:54:08 -07:00
chao.an
99bfd355c7 serial/uart/h4: add bt h4 uart serial driver
Signed-off-by: chao.an <anchao@xiaomi.com>
2021-05-31 09:50:54 -03:00
chao.an
6c69b12000 wireless/bluetooth: decoupling bt_driver_s and bt_buf_s
Signed-off-by: chao.an <anchao@xiaomi.com>
2021-05-31 09:50:54 -03:00
Alin Jerpelea
13e4f9b6b2 drivers: update licenses to Apache
Gregory Nutt is the copyright holder for those files and he has submitted the
SGA as a result we can migrate the licenses to Apache.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2021-05-31 02:58:08 -05:00
Jiuzhu Dong
c06bc9eebd sim_addrenv: support add addrenv dynamically multiple times.
N/A

Change-Id: Ie34f6c59bc16fb147c7103978253dbe9403990d3
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-05-30 23:28:40 -05:00
Gustavo Henrique Nihei
57723eaedf drivers/spi: Add SPI Slave character device driver 2021-05-27 12:13:48 -03:00
Masayuki Ishikawa
59ab8151cc drivers: serial: Remove unnecessary DEBUGASSERT in serial.c
Summary:
- This commit removes unnecessary DEBUGASSERT in serial.c

Impact:
- None

Testing:
- Tested with sabre-6quad (QEMU) and sim

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2021-05-26 23:20:29 -03:00
Sebastien Lorquet
a35f0675e1 user correct printf specifiers
fix long line
2021-05-26 09:30:05 -03:00
me@me.net
85b0faed21 fix typo in pca9555 2021-05-25 16:13:48 +01:00
Xiang Xiao
001e7c3e76 sched: Don't include nuttx/sched.h inside sched.h
But let nuttx/sched.h include sched.h instead to
avoid expose nuttx kernel API to userspace.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-05-24 12:11:53 +09:00
SPRESENSE
139f1f1548 drivers/modem/altair: Fix behavior when a reset packet conflicts with a send packet
Even in the case of a conflict between a reset packet
and a send packet, the send size is compared and the
larger size is sent as the payload.
2021-05-19 12:15:59 +02:00
SPRESENSE
4b1fddec8a drivers/mtd/smart.c: Recover the missing link of directory entry
When creating the next chain of directory entries, (1) add the position
of next entry to the current sector, and then (2) update the sector of
next entry. If the power is turned off between (1) and (2), the next
entry will not be found, and the chain of directory entries will break.
It causes the SmartFS file system corruption, and we will not be able
to add files.

To avoid this issue, in checking the filesystem by smart_fsck_directory,
if the sector of next entry does not exist, update the sector of
directory entry to invalidate the field of next entry.
2021-05-19 11:02:50 +02:00
Xiang Xiao
5f7c98b6e1 drivers/syslog: Remove emergstream implementation and caller
since emergstream always call syslog_force, but syslog_force is designed
for the interrupt context, and then doesn't mean any emergency thing.
On the other hand, emergstream has other bad side effect:
1.Can't output to file or dev channel
2.Can't work well with the interrupt buffer

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-05-18 09:26:28 -03:00
Alan C. Assis
4c74f46afe Add basic support for MCP23017 I/O Expander 2021-05-16 12:48:52 -05:00
Jiuzhu Dong
73cc1f8884 driver/rtc: add config CONFIG_RTC_RPMSG_SERVER to
N/A
select rtc rpmsg role.

Change-Id: I7f9053b070593573caa5d988c6a2e13593da6bc5
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-05-15 14:33:52 -03:00
Jiuzhu Dong
f082893b9a driver/rtc: add config RTC_RPMSG_SERVER_NAME to
specified the name of remote proc(rpmsg server)

Change-Id: I0086bb43727a2bbb5e68f88907b5e4608182ef9c
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-05-15 14:33:52 -03:00
Jiuzhu Dong
018cf26605 lirc: fix bug about lirc_raw_event
N/A

Change-Id: If00d0a7e4e4f9a0d9119b6a170cffd993f23f71a
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-05-15 09:47:28 -07:00
Jiuzhu Dong
ff567124d3 driver/syslog: add config SYSLOG_RPMSG_SERVER_NAME to
N/A

specified the name of remote proc(rpmsg server)

Change-Id: Ie270d651071e87a40a80ab489597ae18db9814f0
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-05-15 09:39:57 -03:00
Xiang Xiao
7169c7c5f8 drivers/rptun: Adapter to openamp 2020.10.0 release
change the callback implementation from mmap to get_mem

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-05-13 18:43:19 +01:00
Xiang Xiao
276fa2ff1c drivers/serial: Change the default value of SERIAL_NPOLLWAITERS to 4
since the console is normally opened three time as stdin, stdout and
stderr and remove the dependence on STANDARD_SERIAL because other type
of serial drivers also support the poll through the same codebase.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Ie68322c4647cc838b295491329969869d6ba310b
2021-05-11 16:45:22 +01:00
Diego Herranz
a1c4ba379f drivers/sensors/hdc1008: add missing break
It was not possible to use the HDC1008_MEAS_T_AND_RH
operation mode since it was running the default case too.
2021-05-07 21:19:14 -03:00
Julian Oes
644a0cd525 drivers/serial: fix Rx interrupt enable for cdcacm
This is addressing an issue where Rx interrupts were not restored for
cdcacm after the buffer had been filled (in a burst).
The Rx interrupts were only restored after the watchdog timeout of 200ms
fired.

This happened because CONFIG_SERIAL_RXDMA was set, however, for the
cdcacm driver this does not actually matter as it is relying on
uart_enablerxint to be called via the ops table.

This patch makes sure that uart_enablerxint and uart_disablerxint are
always called, independent of CONFIG_SERIAL_RXDMA, relying on the ops
table to be correct for the case where it should be only a no-op.
2021-05-06 06:49:07 -07:00
raiden00pl
a74ea51aae drivers/timers/pwm.c: fix compilation warnings 2021-05-05 09:32:58 -03:00
raiden00pl
3fb78a8299 drivers: move the generic upper-half motor driver from drivers/power to drivers/motor 2021-05-05 09:00:22 +02:00
Brennan Ashton
2c91805d8f boards/stm32f7: Add i2c and mpu60x0 support to nucleo-144 2021-05-04 10:17:44 -03:00
Brennan Ashton
e155af891a sensor: Fix bad bit mask macro in mpu60x0 2021-05-04 10:17:44 -03:00
David Sidrane
8f8befaa25 mtd:ramtron Use inttypes in printing macros 2021-05-03 16:58:47 -04:00
Nathan Hartman
8efec13ab0 drivers/motor - Fix CFLAGS path
* drivers/motor/Make.defs b/drivers/motor/Make.defs:
  Fix typo in MOTOR_CFLAGS path (motr -> motor)
2021-05-03 12:23:54 -07:00
Masayuki Ishikawa
97e6d35c3a drivers: wireless: Fix AT command response handling in gs2200m.c
Summary:
- When sending an AT command during receiving a bulk packet,
  the bulk packet might be put in the AT command response.
- To handle such the case, gs2200m_send_cmd2() is newly
  introduced instead of using gs2200m_send_cmd(dev, cmd, NULL)

Impact:
- All use cases that send an AT command in gs2200m.c

Testing:
- Tested with renew and nxplayer with spresense:wifi

Reported-by: Masatoshi Ueno <Masatoshi.Ueno@sony.com>
Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2021-04-15 21:28:25 -05:00
Marco Krahl
05b889457e 1wire: Removes duplicate device information
Removes the family identifier from the device configuration, since the device
family is already part of the rom code and the underlying logic does know how
to extract this information.

include/nuttx/1wire drivers/sensors

stm32f103-minimim

Signed-off-by: Marco Krahl <ocram.lhark@gmail.com>
2021-04-15 02:28:42 -05:00
Marco Krahl
9f9d266f68 drivers/sensors: Adds new driver for ds18b20 sensore module
Signed-off-by: Marco Krahl <ocram.lhark@gmail.com>
2021-04-14 02:49:28 -05:00
Marco Krahl
624a60f456 drivers/1wire: Adds some improvents
The following changes where added.
- Removes dependency to slave structure. Selecting a device on the bus only
  requires the unique romcode.

- Make search operation mutual exclusive on the bus. This is necessary to
  prevent another driver instance from making a transition on the bus at
  the same time.

- Skip also rom when only 1 slave is expected on the bus. Physical
  connected devuce should be indicated by the maxslave paramter during
  initializing, not the reigstered slaves.

- Fixes some compiler warnings in existing ds28e17 driver.

Signed-off-by: Marco Krahl <ocram.lhark@gmail.com>
2021-04-14 02:49:28 -05:00
Marco Krahl
8456f3615e drivers/1wire: Moves header and adjusts include paths
Moves header to 1wire include sub directory.
Moves over common crc definitions to new interface.

Signed-off-by: Marco Krahl <ocram.lhark@gmail.com>
2021-04-14 02:49:28 -05:00
Marco Krahl
c726dac605 nuttx/1wire: Adds 1wire master interface
This implements a new master interface to handle the 1-wire transition in an
atomic sense.

Signed-off-by: Marco Krahl <ocram.lhark@gmail.com>
2021-04-14 02:49:28 -05:00
Anthony Merlino
9c8c2b0db2 Separate CLOCK_TIMEKEEPING and SCHED_TICKLESS. 2021-04-13 11:42:31 -05:00
Masayuki Ishikawa
fa5daea3d9 drivers: wireless: Fix to receive a UDP packet partially in gs2200m.c
Summary:
- When receiving a UDP packet partially, the rest of the packet
  must be discarded.

Impact:
- None

Testing:
- Tested with a UDP sample program

Reported-by: Masatoshi Ueno <Masatoshi.Ueno@sony.com>
Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2021-04-13 10:37:15 -05:00
Xiang Xiao
3f9908f7d1 Remove the unnecessary math.h inclusion
or move from header file to source file since math.h doesn't always exist

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-04-12 22:58:23 -04:00
jturnsek
f57ff30545 Removing FLexSPI NOR driver 2021-04-12 17:22:14 -03:00
jturnsek
7453e76d98 FlexSPI NOR driver 2021-04-12 11:35:44 -03:00
Fotis Panagiotopoulos
3543ac95bf syslog_device: Device is re-opened in case of failure. 2021-04-10 06:47:44 -05:00
Alin Jerpelea
231b8518b7 NuttX: Ken Pettit: update licenses to Apache
Ken Pettit has submitted the ICLA and we can migrate the licenses
 to Apache.

Sebastien Lorquet has submitted the ICLA and we can migrate the licenses
 to Apache.

Gregory Nutt has submitted the SGA and we can migrate the licenses
 to Apache.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2021-04-10 06:42:19 -05:00
Michal Lenc
3f43a34d11 drivers/lcd/ili9225: fix nxstyle
Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2021-04-09 22:41:56 -03:00
Michal Lenc
cf7cfa682b drivers: added support for ili9225 controller
Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2021-04-09 22:41:56 -03:00
Fotis Panagiotopoulos
ee7276e7a7 syslog: syslog_device ops are handled internally by the driver. 2021-04-09 08:02:38 -05:00
Gustavo Henrique Nihei
ada84cacda drivers/input: Rename AJOYSTICK configs to INPUT_AJOYSTICK 2021-04-08 14:41:22 -03:00
Gustavo Henrique Nihei
3054237d2e drivers/input: Rename DJOYSTICK configs to INPUT_DJOYSTICK 2021-04-08 14:41:22 -03:00
Gustavo Henrique Nihei
2efae6928d drivers/input: Rename BUTTONS configs to INPUT_BUTTONS 2021-04-08 14:41:22 -03:00
Gustavo Henrique Nihei
5719dab8ec drivers/input: Rename MOUSE configs to INPUT_MOUSE 2021-04-08 14:41:22 -03:00
Gustavo Henrique Nihei
00e68bb38d drivers/input: Add TOUCHSCREEN config for touchscreen input devices 2021-04-08 09:17:58 -07:00
Marco Krahl
7e8424903a drivers/sensors: Adds driver for hyt271 sensore module
This adds a sensor driver for the hyt271, hyt221, and hyt939 sensor module from
vendor iST (Innovative Sensor Technology). This sensor type is connected via i2c
bus and allows the measurement of relative humidity and temperature.

Each driver instance supports two different character device for each type
(/dev/sensor/tempX and /dev/sensor/humiX).

This driver also supports changing the i2c address of one connected sensor on
the bus. This requires a callback to the platform-specific board logic which
must ensure a power-on reset.

Optional the driver allows setting up a read interval for fetching sensor data.
This is done by a worker thread and can be useful when watching several sensors
via poll() by the userspace application.

Signed-off-by: Marco Krahl <ocram.lhark@gmail.com>
2021-04-07 21:29:51 -05:00
Fotis Panagiotopoulos
ac7feda1bc syslog: Proper uninit of syslog_device. 2021-04-07 08:38:53 -05:00
Xiang Xiao
f1e821833b mtd/ftl: Don't call ferr if return value equals -ENOTTY
MIRTOS4BES-22

since -ENOTTY is an expected code to indicate IOCTL isn't supported

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I62cf58c514be696327ad769ab2f35099154bcb42
2021-04-06 22:36:09 +01:00
Alin Jerpelea
72041911ce NuttX: Marco Krahl: update licenses to Apache
Marco Krahl has submitted the ICLA and we can migrate the licenses
 to Apache.

Gregory Nutt, S.A has submitted the SGA and we can migrate the licenses
 to Apache.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2021-04-06 12:50:41 -05:00
Fotis Panagiotopoulos
c4a9a35fb9 syslog: Fix in syslog_intbuffer flushing. 2021-04-06 10:26:55 -05:00
Fotis Panagiotopoulos
1dee243e29 syslog: Added multi device support in syslog_device. 2021-04-06 07:32:23 -05:00