fix(llcc68): align spi binding with zephyr
Add a module-local .gitignore entry for macOS .DS_Store artifacts so generated Finder metadata does not dirty the submodule. Declare the SPI chip-select delay binding properties as integers so Zephyr devicetree validation accepts the custom LLCC68 binding. Pass the configured setup delay into SPI_DT_SPEC_INST_GET using the Zephyr 4 three-argument API, converting the nanosecond devicetree value to the microsecond spi_cs_control delay field.
This commit is contained in:
@@ -0,0 +1 @@
|
||||
.DS_Store
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
#include <errno.h>
|
||||
#include <zephyr/devicetree.h>
|
||||
#include <zephyr/sys_clock.h>
|
||||
#include <zephyr/sys/util.h>
|
||||
|
||||
#define DT_DRV_COMPAT semtech_llcc68_weihua
|
||||
@@ -25,6 +26,9 @@
|
||||
#define LLCC68_RF_SWITCH_MODE(inst) \
|
||||
DT_ENUM_IDX_OR(DT_DRV_INST(inst), rf_switch_mode, LLCC68_DEFAULT_RF_SWITCH_MODE(inst))
|
||||
|
||||
#define LLCC68_SPI_CS_DELAY_US(inst) \
|
||||
DIV_ROUND_UP(DT_INST_PROP(inst, spi_cs_setup_delay_ns), NSEC_PER_USEC)
|
||||
|
||||
static void dio1_irq_trampoline(const struct device *port, struct gpio_callback *cb, uint32_t pins) {
|
||||
ARG_UNUSED(port);
|
||||
|
||||
@@ -82,7 +86,8 @@ int llcc68_init(const struct device *dev) {
|
||||
static struct llcc68_data llcc68_data_##inst; \
|
||||
static const struct llcc68_config llcc68_config_##inst = \
|
||||
{ \
|
||||
.spi = SPI_DT_SPEC_INST_GET(inst, SPI_WORD_SET(8) | SPI_TRANSFER_MSB), \
|
||||
.spi = SPI_DT_SPEC_INST_GET( \
|
||||
inst, SPI_WORD_SET(8) | SPI_TRANSFER_MSB, LLCC68_SPI_CS_DELAY_US(inst)), \
|
||||
.reset_gpio = GPIO_DT_SPEC_INST_GET(inst, reset_gpios), \
|
||||
.busy_gpio = GPIO_DT_SPEC_INST_GET(inst, busy_gpios), \
|
||||
.dio1_gpio = GPIO_DT_SPEC_INST_GET(inst, dio1_gpios), \
|
||||
|
||||
@@ -71,7 +71,9 @@ properties:
|
||||
which the driver holds active. This mode must not use tx-enable-gpios.
|
||||
|
||||
spi-cs-setup-delay-ns:
|
||||
type: int
|
||||
default: 100000
|
||||
|
||||
spi-cs-hold-delay-ns:
|
||||
type: int
|
||||
default: 100000
|
||||
|
||||
Reference in New Issue
Block a user