Commit Graph

41 Commits

Author SHA1 Message Date
dongjiuzhu1 1bad603fe7 drivers/gpio: save memory if dont support signal
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-09-15 11:29:55 +08:00
dongjiuzhu1 28815fb7c5 drivers/gpio: add poll function for gpio device
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-09-15 11:29:55 +08:00
guoshichao 599d41d806 greenhills: fix the pointless comparison build warning
"ioexpander/gpio.c", line 529: warning #186-D: pointless comparison of
          unsigned integer with zero
            if (pintype < GPIO_INPUT_PIN || pintype >= GPIO_NPINTYPES)
                        ^

Signed-off-by: guoshichao <guoshichao@xiaomi.com>
2024-08-27 07:33:09 -04:00
Petro Karashchenko 5d17e4795a drivers/ioexpander: remove 'FAR' from non-pointer types
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2024-08-25 19:22:15 +08:00
guoshichao b150722efb greenhills: fix enumerated type mixed using build warning
CC:  irq/irq_initialize.c "ioexpander/gpio.c", line 386: warning #188-D: enumerated type mixed with
          another type
            *ptr = dev->gp_pintype;
                 ^

Signed-off-by: guoshichao <guoshichao@xiaomi.com>
2024-08-24 20:43:53 +08:00
chao an 7aa45305b7 fs/inode: remove all unnecessary check for filep/inode
Since VFS layer already contains sanity checks, so remove unnecessary lower half checks

Signed-off-by: chao an <anchao@xiaomi.com>
2023-08-29 09:47:11 +08:00
Xiang Xiao a2190aeb35 Fix error: '%s' directive output may be truncated
writing up to 31 bytes into a region of size 27 [-Werror=format-truncation=]

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-03-03 04:08:22 -08:00
David Sidrane ac50b3a473 ioexpander/gpio:Add gpio_pin_register_byname 2023-02-11 18:31:40 +08:00
chao an 4c8d244fae sched/getpid: replace syscall getpid/tid/ppid() to kernel version
NuttX kernel should not use the syscall functions, especially after
enabling CONFIG_SCHED_INSTRUMENTATION_SYSCALL, all system functions
will be traced to backend, which will impact system performance.

Signed-off-by: chao an <anchao@xiaomi.com>
2023-02-02 10:33:01 +08:00
Xiang Xiao 779a610ca3 Remove the unnecessary NULL fields in global instance definition of file_operations
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-01-04 00:32:13 +02:00
Petro Karashchenko 09b3fb25ab drivers: remove unimplemented open/close/ioctl interfaces
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-04-15 16:56:25 +08:00
Jari van Ewijk 2e47ef32cf GPIO driver: register all pintypes as generic /dev/gpioN 2021-12-09 23:55:12 -06:00
Xiang Xiao 7183009400 ioexpander/gpio: Remove the hardcode 100 limitation
it's very easy to have more than 100 GPIOs on the modern SoC

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-10-20 10:10:50 -07: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
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
Alin Jerpelea e5b6305f4a drivers: Author Gregory Nutt: update 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-03-04 18:32:27 -08:00
Gustavo Henrique Nihei 55d66f60a3 drivers: Fix typos reported by codespell 2021-02-25 18:57:18 -08:00
Masayuki Ishikawa d87f350831 arch, boards, drivers, include, sched, wireless: Change spinlock APIs.
Summary:
- This commit changes spinlock APIs (spin_lock_irqsave/spin_unlock_irqrestore)
- In the previous implementation, the global spinlock (i.e. g_irq_spin) was used.
- This commit allows to use caller specific spinlock but also supports to use
  g_irq_spin for backword compatibility (In this case, NULL must be specified)

Impact:
- None

Testing:
- Tested with the following configurations
- spresnse:wifi, spresense:wifi_smp
- esp32-devkitc:smp (QEMU), sabre6-quad:smp (QEMU)
- maxi-bit:smp (QEMU), sim:smp
- stm32f4discovery:wifi

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2021-02-07 21:28:56 -08:00
Beat Küng a349595316 gpio: extend gpio_pintype_e for pulldown/up and opendrain
- fix code style
- fix bool conversion when calling go_read()
2020-07-07 08:34:25 -05: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
ligd ead2c26be8 drivers/ioexpander/gpio_lower_half.c: Remove limitation when pintype > GPIO_INTERRUPT_PIN. 2019-09-09 07:36:17 -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
Valmantas Paliksa 5bfa7a8df4 drivers/ioexpander/gpio.c: Return EINVAL if written value is not 0 nor 1. 2019-03-22 07:12:10 -06:00
Valmantas Paliksa 90ee863abe drivers/ioexpander/gpio.c: support reading and writing gpio pins using cat and echo. 2019-03-21 08:43:48 -06:00
Xiang Xiao fb63c0a293 sched/signal and related changes to other OS subsystems. 2019-01-27 09:28:59 -06:00
Xiang Xiao 71a6244198 drivers/ioexpander: Support multiple registrations of GPIO signal events. 2018-11-08 08:29:22 -06:00
zhuyanlin 459d9f2851 Squashed commit of the following:
driver/ioexpander:  Add gpio_pin_unregister function to GPIO driver
  driver/ioexpander:  Add pinset struct to GPIO driver for interrupt pins larger than 64
  driver/ioexpander:  Initialize pintype/inttype when registering ioexpander device
  driver/ioexpander:  Add SETPINTYPE ioctl command to the GPIO driver
2018-08-27 09:25:11 -06:00
Gregory Nutt 9e25d89223 Squashed commit of the following:
Replace all usage kill() in the OS proper with nxsig_kill().

    sched/signal:  Add nxsig_kill() which is functionally equivalent to kill() except that it does not modify the errno variable.
2017-10-07 08:22:18 -06:00
Marc Rechté 58c2cd2843 drivers/ioexpander: Add some debug output. 2016-11-08 07:46:25 -06:00
Gregory Nutt 9685fd8c99 GPIO driver: Add an IOCTL to unregister a signal handler 2016-08-01 13:52:27 -06:00
Gregory Nutt 0f9fb09a53 GPIO driver: Add an IOCTL command to get the pin type 2016-08-01 12:09:00 -06:00
Gregory Nutt 6090f69bfd Add a GPIO lower-half driver that can be used to register a GPIO character driver for accessing pins on an I/O expander. 2016-08-01 08:43:10 -06:00
Gregory Nutt 5f9ee79298 I/O Expander: Remove hard-coded PCA9555 fields from ioexpander.h definitons. Add support for an attach() method that may be used when any subset of pin interrupts occur.
PCA9555 Driver:  Replace the signalling logic with a simple callback using the new definitons of ioexpander.h.  This repartitioning of functionality is necessary because (1) the I/O expander driver is the lower-lower part of any driver that uses GPIOs (include the GPIO driver itself) and should not be interacting directly with the much higher level application layer.  And (2) in order to be compatible with the GPIO driver (and any arbitrary upper half driver), the PCA9555 should not directly signal, but should call back into the upper half.  The upper half driver that interacts directly with the application is the appropriate place to be generating signal.
2016-07-31 11:09:47 -06:00
Gregory Nutt eb94cc5419 Update some comments 2016-07-24 12:48:37 -06:00
Gregory Nutt 2d92bffdcc Trivial change left in editor 2016-07-23 13:53:37 -06:00
Gregory Nutt a932578e76 GPIO driver: Add support for receiving signals from interrupt pins. 2016-07-23 13:53:06 -06:00
Paul A. Patience 0690391d42 ioexpander/gpio: Add missing argument to gpin_read and gpout_read 2016-07-05 15:55:16 -04:00
Gregory Nutt b16fdaf155 Some small improvements to GPIO driver 2016-06-26 11:24:35 -06:00
Gregory Nutt db50f13511 Correct some typos in DEBUGASSERT statements 2016-06-24 14:34:21 -06:00
Gregory Nutt 20708c7c5e GPIO driver: Fix inconsistency in naming; beef up a debug assertion. 2016-06-24 11:32:24 -06:00
Gregory Nutt ae19ca45e0 drivrs/ioexpander: Add support for a very simple GPIO drivers. It supports only pre-conrigured input and output pins and only basic input and output operations. 2016-06-24 09:43:49 -06:00