Commit Graph

134 Commits

Author SHA1 Message Date
Gregory Nutt 5b74974919 Check return from nxsem_wait_initialize()
Resolution of Issue 619 will require multiple steps, this part of the first step in that resolution:  Every call to nxsem_wait_uninterruptible() must handle the return value from nxsem_wait_uninterruptible properly.  This commit is only for those files under drivers/audio, drivers/net, and drivers/lcd.
2020-03-31 20:12:21 +01:00
Xiang Xiao cde88cabcc Run codespell -w with the latest dictonary again
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-02-23 22:27:46 +01:00
Xiang Xiao bd4e8e19d3 Run codespell -w against all files
and fix the wrong correction
2020-02-22 14:45:07 -06:00
Gregory Nutt 21aef0dd68 drivers/*/Kconfig: Consolidate driver Kconfig Files.
This commit does two things:

1. First, it reorganizes the driver Kconfig files so that each is self contained.  Before, a part of the driver configuration was in drivers/Kconfig and the rest was in in drivers/xyz/Konfig.  Now, all of the driver configuration is consolitated in the latter.

2. Second, this commit correct numerous serious errors introduced in a previous reorganization of the driver Kconfig files.  This was first noted by Nicholas Chin in PR270 for the case of the drivers/i2c/Kconfig but some examination indicates that the error was introduced into several other Kconfig files as well.

The nature of the introduced error was basically this:

- Nothing must intervene between the menuconfig selection and the following conditional configuration otpions.
- A previous PR erroneously introduced unconditional options between the menuconfig and the following confditional logic, thus corrupting the driver menus.

This error was easy to make because the driver Kconfig files were not well modularized.  Making them fully self-contained should eliminate this kind of error in the future.
2020-02-15 15:19:11 +01:00
Xiang Xiao 3cb259daa6 drivers/Kconfig: Move if/endif to subfolder Kconfig
Move if/endif to subfolder Kconfig and make ARCH_HAVE_XXX option always selectable by moving out of if/endif
2020-02-08 08:04:05 -06:00
Xiang Xiao 5c80b94820 Replace #include <semaphore.h> to #include <nuttx/semaphore.h>
Since the kernel side should call nxsem_xxx instead and remove the unused inclusion
2020-02-01 08:27:30 -06:00
Xiang Xiao 80277d1630
Refine the preprocessor conditional guard style (#190) 2020-01-31 19:07:39 +01:00
Xiang Xiao 68951e8d72 Remove exra whitespace from files (#189)
* Remove multiple newlines at the end of files
* Remove the whitespace from the end of lines
2020-01-31 09:24:49 -06:00
Xiang Xiao 6a3c2aded6 Fix wait loop and void cast (#24)
* Simplify EINTR/ECANCEL error handling

1. Add semaphore uninterruptible wait function
2 .Replace semaphore wait loop with a single uninterruptible wait
3. Replace all sem_xxx to nxsem_xxx

* Unify the void cast usage

1. Remove void cast for function because many place ignore the returned value witout cast
2. Replace void cast for variable with UNUSED macro
2020-01-02 10:54:43 -06:00
Xiang Xiao 3bc62f1ccc Change space to tab and help to ---help--- in Kconfig files. 2019-10-05 21:39:12 -06:00
Juha Niskanen e8b5dd4528 Fix use of undefined pp-token #errror, other typos. 2019-09-19 18:19:18 -06:00
Augusto Fraga Giachero 68bbc8438c drivers/timers/pwm.c: Move the pwm/pwm.c driver to timers/pwm.c, The drivers/pwm contained only one .c file (pwm.c), so to avoid the proliferation of sub-directories inside drivers/ is better to move the pwm.c driver to drivers/timers. The pwm.h header was moved to include/nuttx/timers to keep consistency, so all files referencing it need to be updated. 2019-09-02 07:57:10 -06:00
Gregory Nutt b49be4bb20 Squashed commit of the following:
arch/:  Removed all references to CONFIG_DISABLE_POLL.  The standard POSIX poll() can not longer be disabled.
    sched/ audio/ crypto/:  Removed all references to CONFIG_DISABLE_POLL.  The standard POSIX poll() can not longer be disabled.
    Documentation/:  Removed all references to CONFIG_DISABLE_POLL.  The standard POSIX poll() can not longer be disabled.
    fs/:  Removed all references to CONFIG_DISABLE_POLL.  The standard POSIX poll() can not longer be disabled.
    graphics/:  Removed all references to CONFIG_DISABLE_POLL.  The standard POSIX poll() can not longer be disabled.
    net/:  Removed all references to CONFIG_DISABLE_POLL.  The standard POSIX poll() can not longer be disabled.
    drivers/:  Removed all references to CONFIG_DISABLE_POLL.  The standard POSIX poll() can not longer be disabled.
    include/, syscall/, wireless/:  Removed all references to CONFIG_DISABLE_POLL.  The standard POSIX poll() can not longer be disabled.
    configs/:  Remove all references to CONFIG_DISABLE_POLL.  Standard POSIX poll can no longer be disabled.
2019-05-21 18:57:54 -06:00
Michał Łyszczek 626afb015b nuttx/sched/mqueue: Change 'int prio' to 'unsigned int prio'. According to open group specification, priority field in mq_* functions should have unsigned type: http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/mqueue.h.html 2019-02-15 19:18:55 -06:00
Gregory Nutt 0cd5a232ea Fix a few typos. 2018-12-27 08:45:26 -06:00
Juha Niskanen 827d316dce drivers/audio/audio_i2s.c: Fix bad NULL pointer check 2018-08-29 06:19:19 -06:00
ZhongAn 85a993999e drivers/audio/audio_i2s.c: Add audio_i2s device driver. 2018-08-27 08:52:08 -06:00
Xiang Xiao eb02b28428 drivers/audio: Move the I2S character driver to a dedicated folder. 2018-08-27 07:26:22 -06:00
Gregory Nutt 056d704cf9 This commit brings in a fragmentary, experimental implementation of NETLINK sockets. There is not too much to that socket support on this initial commit, just the netlink socketer framework. However, I decided to bring it into master because there is a enough that I would not want to lose what is in place. And since it is dependent on CONFIG_EXPERIMENATL, its presence on master should be innocuous.
Squashed commit of the following:

    net/netlink:  Mark netlink support as EXPERIMENTAL.
    net/netlink/netlink_sockif.c:  Add netlink_getpeername to the socket interface.
    net:  Add getpeeername() support for netlink sockets.
    include/netpacket/netlink.h:  Add a few more definitions and structures used at the NetLink interface.  Still missing many.
    net/netlink:  Add basic framework for Netlink socket support.
    include/:  Add basic Netlink definitions.
2018-08-03 13:22:36 -06:00
Masayuki Ishikawa 50347a1068 Merged in masayuki2009/nuttx.nuttx/fix_i2schar (pull request #681)
drivers/audio: Fix compile error in i2schar.c (CONFIG_DEBUG_ASSERTIONS=y)

Signed-off-by: Masayuki Ishikawa <masayuki.ishikawa@gmail.com>

Approved-by: GregoryN <gnutt@nuttx.org>
2018-07-13 11:53:37 +00:00
Alan Carvalho de Assis 283b73edc5 Fix lots of typos in C comments and Kconfig help text 2018-07-08 18:24:45 -06:00
Gregory Nutt 691676ac6b Eliminate some new warnings found in build testing. 2018-06-17 15:26:18 -06:00
Juha Niskanen 083c1ae639 drivers/audio: Fix some DEBUGASSERTs and compile failures. 2018-06-11 07:00:27 -06:00
Masayuki Ishikawa fb07bd7e27 Adds loopback test for digital MIC on lc823450 via i2schar driver.
Squashed commit of:

  configs/lc823450-xgevk: Enable DMDIN0 (Digital MIC)
  I2S: Add ioctl interface to i2s_ops_s and i2schar driver
  arch/arm/src/lc823450: Add DGMIC in lc823450_i2s.c
  configs/lc823450-xgevk: Add i2schar driver to lc823450_wm8776.c
  configs/lc824350-xgevk: Enable AUDIO_I2SCHAR in audio/defconfig
  configs/lc823450-xgevk: Update README.txt
2018-06-05 10:34:22 -06:00
Masayuki Ishikawa 97ca4ef956 Merged in masayuki2009/nuttx.nuttx/change_copyright (pull request #621)
Change all Sony related copyright to conform with our company's internal rules.

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>

Approved-by: Gregory Nutt <gnutt@nuttx.org>
2018-04-04 12:35:47 +00:00
Gregory Nutt 15d033e32b drivers/wireless/bluetooth: Add a NULL device to support some very low level testing on the Simulator. 2018-04-03 09:00:18 -06:00
Gregory Nutt 1567b82429 Make sure that labeling is used consistently in all function headers (part 2). 2018-02-01 12:03:55 -06:00
Gregory Nutt 7cf88d7dbd Make sure that labeling is used consistently in all function headers. 2018-02-01 10:00:02 -06:00
Gregory Nutt 30f2927101 binfmt/, drivers/, graphics/: Fix several inappropriate accesses to get_errno() that were missed in previous changes (some going back to nuttx-.23). 2018-01-30 17:23:10 -06:00
Masayuki Ishikawa ab96e3fdc7 Merged in masayuki2009/nuttx.nuttx/lc823450_smp_improvement (pull request #554)
lc823450 smp improvement

* arch/arm/src/common: Apply irq_spin APIs to modifyregXX

    Replace enter_critical_section with spin_lock_irqsave.
    Replace leave_critical_section with spin_unlock_irqrestore.

    Please see 6150299f54 as well.

    Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>

* arch/arm/src/lc823450: Do not use modifyreg32() to enable Mutex.

    Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>

* arch/arm/src/lc823450: Modify IRQ control for i2s

    Interrupt will be handled on CPU0 with this change.

    Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>

* arch/arm/src/lc823450: Apply irq_spin APIs to dma/syscontrol/usbdev.

    Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>

* configs/lc823450-xgevk: Assign CPU1 to lpwork

    This change will improve load balancing for networking with RNDIS.

    Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>

* drivers/audio/wm8776.c: Improve stability in SMP mode

    Apply irq_spin APIs to improbe performance.
    Repeat to process a message to avoid deadlock.

    Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>

* configs/lc823450-xgevk: Enable SPINLOCK_IRQ and NXPLAYER in rndis

    Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>

Approved-by: Gregory Nutt <gnutt@nuttx.org>
2017-12-08 12:31:34 +00:00
Gregory Nutt 349b513978 Very trivial changes from review of last PR 2017-11-08 06:34:23 -06:00
Masayuki Ishikawa 51b19d5f38 Merged in masayuki2009/nuttx.nuttx/lc823450 (pull request #531)
lc823450-xgevk audio support

* arch/arm/src/lc823450: Add IPL2 support

    Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>

* configs/lc823450-xgevk: Add IPL2 support

    Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>

* libc/audio: Fix compilation error in lib_buffer.c

    Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>

* drivers/audio: Add WM8774 support

    Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>

* arch/arm/src/lc823450: Add I2S support

    Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>

* configs/lc823450-xgevk: Add WM8774 support

    Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>

Approved-by: Gregory Nutt <gnutt@nuttx.org>
2017-11-08 12:25:13 +00:00
Gregory Nutt e11e3b2607 Squashed commit of the following:
Change all calls to mq_receive() and mq_timedreceive() in the OS to calls to nxmq_receive() and nxmq_timedreceive(), making appropriate changes for differences in return values.

    sched/mqueue:  Add nxmq_receive() and mxmq_timedreceive() which are functionally equivalent to the standard mq_receive and mq_timedreceive() except that (1) they do not create cancellation points, and (2) the do not modify the application's errno variable.
2017-10-10 09:57:40 -06:00
Gregory Nutt fca07be1df Squashed commit of the following:
Change all calls to mq_send() and mq_timedsend() in the OS to calls to nxmq_send() and nxmq_timedsend(), making appropriate changes for differences in return values.

    sched/mqueue:  Add internal function nxmq_send() and nxmq_timedsend() that are equivalent to mq_send() and mq_timedsend() except that they do not create cancellation points and do to not modify the errno variable.
2017-10-10 08:44:12 -06:00
Gregory Nutt 936df1bcb5 Adds new OS internal functions nxsig_sleep() and nxsig_usleep. These differ from the standard sleep() and usleep() in that (1) they don't cause cancellation points, and (2) don't set the errno variable (if applicable). All calls to sleep() and usleep() changed to calls to nxsig_sleep() and nxsig_usleep().
Squashed commit of the following:

    Change all calls to usleep() in the OS proper to calls to nxsig_usleep()

    sched/signal:  Add a new OS internal function nxsig_usleep() that is functionally equivalent to usleep() but does not cause a cancellaption point and does not modify the errno variable.

    sched/signal:  Add a new OS internal function nxsig_sleep() that is functionally equivalent to sleep() but does not cause a cancellaption point.
2017-10-06 10:15:01 -06:00
Gregory Nutt 9568600ab1 Squashed commit of the following:
This commit backs out most of commit b4747286b1.  That change was added because sem_wait() would sometimes cause cancellation points inappropriated.  But with these recent changes, nxsem_wait() is used instead and it is not a cancellation point.

    In the OS, all calls to sem_wait() changed to nxsem_wait().  nxsem_wait() does not return errors via errno so each place where nxsem_wait() is now called must not examine the errno variable.

    In all OS functions (not libraries), change sem_wait() to nxsem_wait().  This will prevent the OS from creating bogus cancellation points and from modifying the per-task errno variable.

    sched/semaphore:  Add the function nxsem_wait().  This is a new internal OS interface.  It is functionally equivalent to sem_wait() except that (1) it is not a cancellation point, and (2) it does not set the per-thread errno value on return.
2017-10-04 15:22:27 -06:00
Gregory Nutt 42a0796615 Squashed commit of the following:
sched/semaphore:  Add nxsem_post() which is identical to sem_post() except that it never modifies the errno variable.  Changed all references to sem_post in the OS to nxsem_post().

    sched/semaphore:  Add nxsem_destroy() which is identical to sem_destroy() except that it never modifies the errno variable.  Changed all references to sem_destroy() in the OS to nxsem_destroy().

    libc/semaphore and sched/semaphore:  Add nxsem_getprotocol() and nxsem_setprotocola which are identical to sem_getprotocol() and set_setprotocol() except that they never modifies the errno variable.  Changed all references to sem_setprotocol in the OS to nxsem_setprotocol().  sem_getprotocol() was not used in the OS
2017-10-03 15:35:24 -06:00
Gregory Nutt 83cdb0c552 Squashed commit of the following:
libc/semaphore:  Add nxsem_getvalue() which is identical to sem_getvalue() except that it never modifies the errno variable.  Changed all references to sem_getvalue in the OS to nxsem_getvalue().

    sched/semaphore:  Rename all internal private functions from sem_xyz to nxsem_xyz.  The sem_ prefix is (will be) reserved only for the application semaphore interfaces.

    libc/semaphore:  Add nxsem_init() which is identical to sem_init() except that it never modifies the errno variable.  Changed all references to sem_init in the OS to nxsem_init().

    sched/semaphore:  Rename sem_tickwait() to nxsem_tickwait() so that it is clear this is an internal OS function.

    sched/semaphoate:  Rename sem_reset() to nxsem_reset() so that it is clear this is an internal OS function.
2017-10-03 12:52:31 -06:00
Gregory Nutt 9b2a8e8c0e Rename CONFIG_AUDIO_DEVICES to CONFIG_DRIVERS_AUDIO to conform better to the evolving configuration naming standard. 2017-09-12 14:10:15 -06:00
Gregory Nutt e341c74f06 drivers/audio: Fix naming of configurations to be compliant for vs1053 audio driver. One file was not saved before last commit. 2017-08-24 11:12:10 -06:00
Gregory Nutt 53ef64aae6 drivers/audio: Fix naming of configurations to be compliant for vs1053 audio driver. 2017-08-24 11:11:06 -06:00
Taras Drozdovsky 4ab2a3661e STM32F4: add cs43l22 audio driver and i2s driver 2017-05-21 14:14:09 -06:00
Juha Niskanen b9a769d65d drivers: fix some bad NULL checks 2017-05-15 07:20:32 -06:00
Gregory Nutt e9a5477506 Add an instance argument to the SPIDEV definitions. 2017-04-29 12:26:52 -06:00
Gregory Nutt 3872055daa drivers/audio/wm8904: WM8904 has same problem as that fixed by Juha Niskanen in the MaxTouch driver. 2017-03-21 07:20:45 -06:00
Gregory Nutt b4ff7391f8 Convert more drivers to use use irq_attach with argument. 2017-02-27 10:44:13 -06:00
Gregory Nutt 5e09de3703 drivers/tone.c: 50% duty needs to be expressed a a fixed precision number 2017-02-22 06:35:20 -06:00
Gregory Nutt ae86d7a8c8 Fix mismatched function prototype. 2017-02-21 07:48:00 -06:00
Gregory Nutt c776407f64 This should resolve issue #30: Audio Tone Generator and PWM Multiple Output Channel options. I don't actually have a setup to verify it, however. 2017-02-20 17:26:56 -06:00
Gregory Nutt a92a865be6 TABs instead of spaces in Kconfig 2017-02-20 14:29:56 -06:00