drivers/dpll/zl3073x/prop.c
Source file repositories/reference/linux-study-clean/drivers/dpll/zl3073x/prop.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/dpll/zl3073x/prop.c- Extension
.c- Size
- 10413 bytes
- Lines
- 382
- Domain
- Driver Families
- Bucket
- drivers/dpll
- 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.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/array_size.hlinux/dev_printk.hlinux/err.hlinux/errno.hlinux/fwnode.hlinux/property.hlinux/slab.hlinux/string.hcore.hprop.h
Detected Declarations
function zl3073x_pin_check_freqfunction zl3073x_prop_pin_package_label_setfunction zl3073x_prop_pin_fwnode_getfunction firmwarefunction zl3073x_pin_props_putfunction zl3073x_prop_dpll_type_get
Annotated Snippet
if (zl3073x_pin_check_freq(zldev, dir, index, freqs[i])) {
ranges[j] = freq;
j++;
}
}
/* Save number of freq ranges and pointer to them into pin properties */
props->dpll_props.freq_supported = ranges;
props->dpll_props.freq_supported_num = j;
/* Free temporary array */
kfree(freqs);
return props;
err_alloc_ranges:
kfree(freqs);
err_alloc_freqs:
fwnode_handle_put(props->fwnode);
kfree(props);
return ERR_PTR(rc);
}
/**
* zl3073x_pin_props_put - release pin properties
* @props: pin properties to free
*
* The function deallocates given pin properties structure.
*/
void zl3073x_pin_props_put(struct zl3073x_pin_props *props)
{
/* Free supported frequency ranges list if it is present */
kfree(props->dpll_props.freq_supported);
/* Put firmware handle if it is present */
if (props->fwnode)
fwnode_handle_put(props->fwnode);
kfree(props);
}
/**
* zl3073x_prop_dpll_type_get - get DPLL channel type
* @zldev: pointer to zl3073x device
* @index: DPLL channel index
*
* Return: DPLL type for given DPLL channel
*/
enum dpll_type
zl3073x_prop_dpll_type_get(struct zl3073x_dev *zldev, u8 index)
{
const char *types[ZL3073X_MAX_CHANNELS];
int count;
/* Read dpll types property from firmware */
count = device_property_read_string_array(zldev->dev, "dpll-types",
types, ARRAY_SIZE(types));
/* Return default if property or entry for given channel is missing */
if (index >= count)
return DPLL_TYPE_PPS;
if (!strcmp(types[index], "pps"))
return DPLL_TYPE_PPS;
else if (!strcmp(types[index], "eec"))
return DPLL_TYPE_EEC;
dev_info(zldev->dev, "Unknown DPLL type '%s', using default\n",
types[index]);
return DPLL_TYPE_PPS; /* Default */
}
Annotation
- Immediate include surface: `linux/array_size.h`, `linux/dev_printk.h`, `linux/err.h`, `linux/errno.h`, `linux/fwnode.h`, `linux/property.h`, `linux/slab.h`, `linux/string.h`.
- Detected declarations: `function zl3073x_pin_check_freq`, `function zl3073x_prop_pin_package_label_set`, `function zl3073x_prop_pin_fwnode_get`, `function firmware`, `function zl3073x_pin_props_put`, `function zl3073x_prop_dpll_type_get`.
- Atlas domain: Driver Families / drivers/dpll.
- 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.