drivers/pinctrl/sophgo/pinctrl-cv1812h.c
Source file repositories/reference/linux-study-clean/drivers/pinctrl/sophgo/pinctrl-cv1812h.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/pinctrl/sophgo/pinctrl-cv1812h.c- Extension
.c- Size
- 26069 bytes
- Lines
- 781
- 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-cv1812h.hpinctrl-cv18xx.h
Detected Declarations
enum CV1812H_POWER_DOMAINfunction cv1812h_get_pull_upfunction cv1812h_get_pull_downfunction cv1812h_get_oc_mapfunction cv1812h_get_schmitt_map
Annotated Snippet
if (pstate == PIN_POWER_STATE_1V8) {
*map = cv1812h_18od33_1v8_oc_map;
return ARRAY_SIZE(cv1812h_18od33_1v8_oc_map);
} else if (pstate == PIN_POWER_STATE_3V3) {
*map = cv1812h_18od33_3v3_oc_map;
return ARRAY_SIZE(cv1812h_18od33_3v3_oc_map);
}
}
if (type == IO_TYPE_ETH) {
*map = cv1812h_eth_oc_map;
return ARRAY_SIZE(cv1812h_eth_oc_map);
}
return -ENOTSUPP;
}
static const u32 cv1812h_1v8_schmitt_map[] = {
0,
970000,
1040000
};
static const u32 cv1812h_18od33_1v8_schmitt_map[] = {
0,
1070000
};
static const u32 cv1812h_18od33_3v3_schmitt_map[] = {
0,
1100000
};
static int cv1812h_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 = cv1812h_1v8_schmitt_map;
return ARRAY_SIZE(cv1812h_1v8_schmitt_map);
}
if (type == IO_TYPE_1V8_OR_3V3) {
if (pstate == PIN_POWER_STATE_1V8) {
*map = cv1812h_18od33_1v8_schmitt_map;
return ARRAY_SIZE(cv1812h_18od33_1v8_schmitt_map);
} else if (pstate == PIN_POWER_STATE_3V3) {
*map = cv1812h_18od33_3v3_schmitt_map;
return ARRAY_SIZE(cv1812h_18od33_3v3_schmitt_map);
}
}
return -ENOTSUPP;
}
static const struct sophgo_vddio_cfg_ops cv1812h_vddio_cfg_ops = {
.get_pull_up = cv1812h_get_pull_up,
.get_pull_down = cv1812h_get_pull_down,
.get_oc_map = cv1812h_get_oc_map,
.get_schmitt_map = cv1812h_get_schmitt_map,
};
static const struct pinctrl_pin_desc cv1812h_pins[] = {
PINCTRL_PIN(PIN_MIPI_TXM4, "MIPI_TXM4"),
PINCTRL_PIN(PIN_MIPIRX0N, "MIPIRX0N"),
PINCTRL_PIN(PIN_MIPIRX3P, "MIPIRX3P"),
PINCTRL_PIN(PIN_MIPIRX4P, "MIPIRX4P"),
PINCTRL_PIN(PIN_VIVO_D2, "VIVO_D2"),
PINCTRL_PIN(PIN_VIVO_D3, "VIVO_D3"),
PINCTRL_PIN(PIN_VIVO_D10, "VIVO_D10"),
PINCTRL_PIN(PIN_USB_VBUS_DET, "USB_VBUS_DET"),
PINCTRL_PIN(PIN_MIPI_TXP3, "MIPI_TXP3"),
PINCTRL_PIN(PIN_MIPI_TXM3, "MIPI_TXM3"),
PINCTRL_PIN(PIN_MIPI_TXP4, "MIPI_TXP4"),
PINCTRL_PIN(PIN_MIPIRX0P, "MIPIRX0P"),
PINCTRL_PIN(PIN_MIPIRX1N, "MIPIRX1N"),
PINCTRL_PIN(PIN_MIPIRX2N, "MIPIRX2N"),
PINCTRL_PIN(PIN_MIPIRX4N, "MIPIRX4N"),
PINCTRL_PIN(PIN_MIPIRX5N, "MIPIRX5N"),
PINCTRL_PIN(PIN_VIVO_D1, "VIVO_D1"),
PINCTRL_PIN(PIN_VIVO_D5, "VIVO_D5"),
PINCTRL_PIN(PIN_VIVO_D7, "VIVO_D7"),
PINCTRL_PIN(PIN_VIVO_D9, "VIVO_D9"),
PINCTRL_PIN(PIN_USB_ID, "USB_ID"),
PINCTRL_PIN(PIN_ETH_RXM, "ETH_RXM"),
PINCTRL_PIN(PIN_MIPI_TXP2, "MIPI_TXP2"),
PINCTRL_PIN(PIN_MIPI_TXM2, "MIPI_TXM2"),
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-cv1812h.h`, `pinctrl-cv18xx.h`.
- Detected declarations: `enum CV1812H_POWER_DOMAIN`, `function cv1812h_get_pull_up`, `function cv1812h_get_pull_down`, `function cv1812h_get_oc_map`, `function cv1812h_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.