Donny9 opened a new pull request, #18233:
URL: https://github.com/apache/nuttx/pull/18233

   ## Summary
   
   This PR includes a collection of driver improvements and bug fixes across 
multiple subsystems: PCI, SPI, I2C slave, and PWM drivers. Each commit 
addresses a specific issue or adds new functionality to enhance driver 
capabilities.
   
   ### Changes Overview:
   
   #### 1. PCI Driver Fix (drivers/pci)
   **Issue**: Incorrect list member name causing compilation error or incorrect 
behavior
   **Fix**: Use correct member name 'bus_list' instead of 'node' in device 
lookup function
   
   #### 2. SPI Driver Enhancement (drivers/spi)
   **Feature**: Add hardware-assisted chip select control capabilities
   **Details**: 
   - HWFEAT_AUTO_CS_CONTROL: Hardware automatic CS management with programmable 
timings
   - HWFEAT_INVERT_CS_LEVEL: Support for active-high CS polarity
   
   #### 3. I2C Slave Driver Fix (drivers/i2c-slave)
   **Issue**: Mutex used in ISR context causing potential crash
   **Fix**: Replace mutex with spinlock for interrupt-safe synchronization
   
   #### 4. PWM Driver Enhancement (drivers/pwm)
   **Feature**: Fixed-point frequency support for sub-Hz precision
   **Details**: Add CONFIG_PWM_FREQUENCY_FIXED option using ub32_t type for 
fractional Hz frequencies
   
   ### Why These Changes:
   
   These changes improve driver robustness, add support for modern hardware 
features, and fix critical bugs that could cause system crashes or incorrect 
behavior. Each change is independent and addresses a specific need in the 
respective driver subsystem.
   
   ## Impact
   
   ### Stability:
   - **Critical Fix (I2C slave)**: Prevents crash when ISR calls callback with 
mutex
   - **Bug Fix (PCI)**: Fixes incorrect device lookup that could cause errors
   - **Positive (SPI)**: Better hardware support reduces software overhead
   - **Positive (PWM)**: More precise frequency control for specialized 
applications
   
   ### Compatibility:
   - **No breaking changes**: All changes maintain existing API compatibility
   - **Backward compatible**: New features are opt-in via Kconfig or hardware 
capabilities
   - **PCI fix**: Corrects existing bug without changing behavior
   - **I2C slave**: Maintains same functionality with safer implementation
   - **SPI**: New flags are additive, existing code unaffected
   - **PWM**: Fixed-point support is optional via CONFIG_PWM_FREQUENCY_FIXED
   
   ### Code Quality:
   - **Improved**: Correct member names in PCI driver
   - **Improved**: Interrupt-safe synchronization in I2C slave driver
   - **Enhanced**: Better hardware feature support in SPI driver
   - **Enhanced**: More flexible frequency control in PWM driver
   
   ## Testing
   
   exampls/pwm is OK
   other feature just add feature and bug fix
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to