drivers: pinmux: intel_s1000: Convert to DT_INST
Convert driver to use new DT_INST macros throughout. This allows us to also remove dts_fixup.h that are no longer used. Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
This commit is contained in:
parent
c66bb21a35
commit
576033f858
2 changed files with 7 additions and 8 deletions
|
@ -4,11 +4,15 @@
|
|||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#define DT_DRV_COMPAT intel_s1000_pinmux
|
||||
|
||||
#include <kernel.h>
|
||||
#include <drivers/pinmux.h>
|
||||
#include <iomux.h>
|
||||
|
||||
static volatile u32_t *iomux_ctrl_regs = (volatile u32_t *)DT_PINMUX_BASE_ADDR;
|
||||
static volatile u32_t *iomux_ctrl_regs = (volatile u32_t *)DT_INST_REG_ADDR(0);
|
||||
|
||||
#define PINMUX_CTRL_REG_COUNT (DT_INST_REG_SIZE(0) / 4)
|
||||
|
||||
static int pinmux_set(struct device *dev, u32_t pin, u32_t func)
|
||||
{
|
||||
|
@ -27,7 +31,7 @@ static int pinmux_set(struct device *dev, u32_t pin, u32_t func)
|
|||
lsb = IOMUX_LSB(pin);
|
||||
msb = IOMUX_MSB(pin);
|
||||
|
||||
if ((index >= DT_PINMUX_CTRL_REG_COUNT) || (msb > 31) || (lsb > msb)) {
|
||||
if ((index >= PINMUX_CTRL_REG_COUNT) || (msb > 31) || (lsb > msb)) {
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
@ -55,7 +59,7 @@ static int pinmux_get(struct device *dev, u32_t pin, u32_t *func)
|
|||
lsb = IOMUX_LSB(pin);
|
||||
msb = IOMUX_MSB(pin);
|
||||
|
||||
if ((index >= DT_PINMUX_CTRL_REG_COUNT) || (msb > 31) || (lsb > msb) ||
|
||||
if ((index >= PINMUX_CTRL_REG_COUNT) || (msb > 31) || (lsb > msb) ||
|
||||
(func == NULL)) {
|
||||
return -EINVAL;
|
||||
}
|
||||
|
|
|
@ -27,9 +27,4 @@
|
|||
#define DT_CAVS_ICTL_3_IRQ_PRI DT_INTEL_CAVS_INTC_78830_IRQ_0_PRIORITY
|
||||
#define DT_CAVS_ICTL_3_IRQ_FLAGS DT_INTEL_CAVS_INTC_78830_IRQ_0_SENSE
|
||||
|
||||
#define DT_PINMUX_BASE_ADDR \
|
||||
DT_INTEL_S1000_PINMUX_81C30_BASE_ADDRESS
|
||||
#define DT_PINMUX_CTRL_REG_COUNT \
|
||||
(DT_INTEL_S1000_PINMUX_81C30_SIZE / 4)
|
||||
|
||||
/* End of SoC Level DTS fixup file */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue