drivers/pinctrl/sophgo/pinctrl-cv1800b.c
Source file repositories/reference/linux-study-clean/drivers/pinctrl/sophgo/pinctrl-cv1800b.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/pinctrl/sophgo/pinctrl-cv1800b.c- Extension
.c- Size
- 14791 bytes
- Lines
- 472
- Domain
- Driver Families
- Bucket
- drivers/pinctrl
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/module.hlinux/platform_device.hlinux/of.hlinux/pinctrl/pinctrl.hlinux/pinctrl/pinmux.hdt-bindings/pinctrl/pinctrl-cv1800b.hpinctrl-cv18xx.h
Detected Declarations
enum CV1800B_POWER_DOMAINfunction cv1800b_get_pull_upfunction cv1800b_get_pull_downfunction cv1800b_get_oc_mapfunction cv1800b_get_schmitt_map
Annotated Snippet
if (pstate == PIN_POWER_STATE_1V8) {
*map = cv1800b_18od33_1v8_oc_map;
return ARRAY_SIZE(cv1800b_18od33_1v8_oc_map);
} else if (pstate == PIN_POWER_STATE_3V3) {
*map = cv1800b_18od33_3v3_oc_map;
return ARRAY_SIZE(cv1800b_18od33_3v3_oc_map);
}
}
if (type == IO_TYPE_ETH) {
*map = cv1800b_eth_oc_map;
return ARRAY_SIZE(cv1800b_eth_oc_map);
}
return -ENOTSUPP;
}
static const u32 cv1800b_1v8_schmitt_map[] = {
0,
970000,
1040000
};
static const u32 cv1800b_18od33_1v8_schmitt_map[] = {
0,
1070000
};
static const u32 cv1800b_18od33_3v3_schmitt_map[] = {
0,
1100000
};
static int cv1800b_get_schmitt_map(const struct sophgo_pin *sp, const u32 *psmap,
const u32 **map)
{
const struct cv1800_pin *pin = sophgo_to_cv1800_pin(sp);
enum cv1800_pin_io_type type = cv1800_pin_io_type(pin);
u32 pstate = psmap[pin->power_domain];
if (type == IO_TYPE_1V8_ONLY) {
*map = cv1800b_1v8_schmitt_map;
return ARRAY_SIZE(cv1800b_1v8_schmitt_map);
}
if (type == IO_TYPE_1V8_OR_3V3) {
if (pstate == PIN_POWER_STATE_1V8) {
*map = cv1800b_18od33_1v8_schmitt_map;
return ARRAY_SIZE(cv1800b_18od33_1v8_schmitt_map);
} else if (pstate == PIN_POWER_STATE_3V3) {
*map = cv1800b_18od33_3v3_schmitt_map;
return ARRAY_SIZE(cv1800b_18od33_3v3_schmitt_map);
}
}
return -ENOTSUPP;
}
static const struct sophgo_vddio_cfg_ops cv1800b_vddio_cfg_ops = {
.get_pull_up = cv1800b_get_pull_up,
.get_pull_down = cv1800b_get_pull_down,
.get_oc_map = cv1800b_get_oc_map,
.get_schmitt_map = cv1800b_get_schmitt_map,
};
static const struct pinctrl_pin_desc cv1800b_pins[] = {
PINCTRL_PIN(PIN_AUD_AOUTR, "AUD_AOUTR"),
PINCTRL_PIN(PIN_SD0_CLK, "SD0_CLK"),
PINCTRL_PIN(PIN_SD0_CMD, "SD0_CMD"),
PINCTRL_PIN(PIN_SD0_D0, "SD0_D0"),
PINCTRL_PIN(PIN_SD0_D1, "SD0_D1"),
PINCTRL_PIN(PIN_SD0_D2, "SD0_D2"),
PINCTRL_PIN(PIN_SD0_D3, "SD0_D3"),
PINCTRL_PIN(PIN_SD0_CD, "SD0_CD"),
PINCTRL_PIN(PIN_SD0_PWR_EN, "SD0_PWR_EN"),
PINCTRL_PIN(PIN_SPK_EN, "SPK_EN"),
PINCTRL_PIN(PIN_UART0_TX, "UART0_TX"),
PINCTRL_PIN(PIN_UART0_RX, "UART0_RX"),
PINCTRL_PIN(PIN_SPINOR_HOLD_X, "SPINOR_HOLD_X"),
PINCTRL_PIN(PIN_SPINOR_SCK, "SPINOR_SCK"),
PINCTRL_PIN(PIN_SPINOR_MOSI, "SPINOR_MOSI"),
PINCTRL_PIN(PIN_SPINOR_WP_X, "SPINOR_WP_X"),
PINCTRL_PIN(PIN_SPINOR_MISO, "SPINOR_MISO"),
PINCTRL_PIN(PIN_SPINOR_CS_X, "SPINOR_CS_X"),
PINCTRL_PIN(PIN_IIC0_SCL, "IIC0_SCL"),
PINCTRL_PIN(PIN_IIC0_SDA, "IIC0_SDA"),
PINCTRL_PIN(PIN_AUX0, "AUX0"),
PINCTRL_PIN(PIN_PWR_VBAT_DET, "PWR_VBAT_DET"),
PINCTRL_PIN(PIN_PWR_SEQ2, "PWR_SEQ2"),
PINCTRL_PIN(PIN_XTAL_XIN, "XTAL_XIN"),
Annotation
- Immediate include surface: `linux/module.h`, `linux/platform_device.h`, `linux/of.h`, `linux/pinctrl/pinctrl.h`, `linux/pinctrl/pinmux.h`, `dt-bindings/pinctrl/pinctrl-cv1800b.h`, `pinctrl-cv18xx.h`.
- Detected declarations: `enum CV1800B_POWER_DOMAIN`, `function cv1800b_get_pull_up`, `function cv1800b_get_pull_down`, `function cv1800b_get_oc_map`, `function cv1800b_get_schmitt_map`.
- Atlas domain: Driver Families / drivers/pinctrl.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.