drivers/pinctrl/sophgo/pinctrl-sophgo.h
Source file repositories/reference/linux-study-clean/drivers/pinctrl/sophgo/pinctrl-sophgo.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/pinctrl/sophgo/pinctrl-sophgo.h- Extension
.h- Size
- 4645 bytes
- Lines
- 137
- 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/device.hlinux/mutex.hlinux/pinctrl/pinctrl.hlinux/platform_device.hlinux/spinlock.h../core.h
Detected Declarations
struct sophgo_pinctrlstruct sophgo_pinstruct sophgo_pin_mux_configstruct sophgo_cfg_opsstruct sophgo_vddio_cfg_opsstruct sophgo_pinctrl_datastruct sophgo_pinctrl
Annotated Snippet
struct sophgo_pin {
u16 id;
u16 flags;
};
struct sophgo_pin_mux_config {
const struct sophgo_pin *pin;
u32 config;
};
/**
* struct sophgo_cfg_ops - pin configuration operations
*
* @pctrl_init: soc specific init callback
* @verify_pinmux_config: verify the pinmux config for a pin
* @verify_pin_group: verify the whole pinmux group
* @dt_node_to_map_post: post init for the pinmux config map
* @compute_pinconf_config: compute pinconf config
* @set_pinconf_config: set pinconf config (the caller holds lock)
* @set_pinmux_config: set mux config (the caller holds lock)
*/
struct sophgo_cfg_ops {
int (*pctrl_init)(struct platform_device *pdev,
struct sophgo_pinctrl *pctrl);
int (*verify_pinmux_config)(const struct sophgo_pin_mux_config *config);
int (*verify_pin_group)(const struct sophgo_pin_mux_config *pinmuxs,
unsigned int npins);
int (*dt_node_to_map_post)(struct device_node *cur,
struct sophgo_pinctrl *pctrl,
struct sophgo_pin_mux_config *pinmuxs,
unsigned int npins);
int (*compute_pinconf_config)(struct sophgo_pinctrl *pctrl,
const struct sophgo_pin *sp,
unsigned long *configs,
unsigned int num_configs,
u32 *value, u32 *mask);
int (*set_pinconf_config)(struct sophgo_pinctrl *pctrl,
const struct sophgo_pin *sp,
u32 value, u32 mask);
void (*set_pinmux_config)(struct sophgo_pinctrl *pctrl,
const struct sophgo_pin *sp, u32 config);
};
/**
* struct sophgo_vddio_cfg_ops - pin vddio operations
*
* @get_pull_up: get resistorĀ for pull up;
* @get_pull_down: get resistorĀ for pull down.
* @get_oc_map: get mapping for typical low level output current value to
* register value map.
* @get_schmitt_map: get mapping for register value to typical schmitt
* threshold.
*/
struct sophgo_vddio_cfg_ops {
int (*get_pull_up)(const struct sophgo_pin *pin, const u32 *psmap);
int (*get_pull_down)(const struct sophgo_pin *pin, const u32 *psmap);
int (*get_oc_map)(const struct sophgo_pin *pin, const u32 *psmap,
const u32 **map);
int (*get_schmitt_map)(const struct sophgo_pin *pin, const u32 *psmap,
const u32 **map);
};
struct sophgo_pinctrl_data {
const struct pinctrl_pin_desc *pins;
const void *pindata;
const char * const *pdnames;
const struct sophgo_vddio_cfg_ops *vddio_ops;
const struct sophgo_cfg_ops *cfg_ops;
const struct pinctrl_ops *pctl_ops;
const struct pinmux_ops *pmx_ops;
const struct pinconf_ops *pconf_ops;
u16 npins;
u16 npds;
u16 pinsize;
};
struct sophgo_pinctrl {
struct device *dev;
struct pinctrl_dev *pctrl_dev;
const struct sophgo_pinctrl_data *data;
struct pinctrl_desc pdesc;
struct mutex mutex;
raw_spinlock_t lock;
void *priv_ctrl;
};
const struct sophgo_pin *sophgo_get_pin(struct sophgo_pinctrl *pctrl,
unsigned long pin_id);
int sophgo_pctrl_dt_node_to_map(struct pinctrl_dev *pctldev, struct device_node *np,
Annotation
- Immediate include surface: `linux/device.h`, `linux/mutex.h`, `linux/pinctrl/pinctrl.h`, `linux/platform_device.h`, `linux/spinlock.h`, `../core.h`.
- Detected declarations: `struct sophgo_pinctrl`, `struct sophgo_pin`, `struct sophgo_pin_mux_config`, `struct sophgo_cfg_ops`, `struct sophgo_vddio_cfg_ops`, `struct sophgo_pinctrl_data`, `struct sophgo_pinctrl`.
- 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.