linux-loongson/drivers/dpll/zl3073x/prop.h
Ivan Vecera a99a9f0ebd dpll: zl3073x: Read DPLL types and pin properties from system firmware
Add support for reading of DPLL types and optional pin properties from
the system firmware (DT, ACPI...).

The DPLL types are stored in property 'dpll-types' as string array and
possible values 'pps' and 'eec' are mapped to DPLL enums DPLL_TYPE_PPS
and DPLL_TYPE_EEC.

The pin properties are stored under 'input-pins' and 'output-pins'
sub-nodes and the following ones are supported:

* reg
    integer that specifies pin index
* label
    string that is used by driver as board label
* connection-type
    string that indicates pin connection type
* supported-frequencies-hz
    array of u64 values what frequencies are supported / allowed for
    given pin with respect to hardware wiring

Do not blindly trust system firmware and filter out frequencies that
cannot be configured/represented in device (input frequencies have to
be factorized by one of the base frequencies and output frequencies have
to divide configured synthesizer frequency).

Signed-off-by: Ivan Vecera <ivecera@redhat.com>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Link: https://patch.msgid.link/20250704182202.1641943-8-ivecera@redhat.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2025-07-09 19:08:53 -07:00

35 lines
817 B
C

/* SPDX-License-Identifier: GPL-2.0-only */
#ifndef _ZL3073X_PROP_H
#define _ZL3073X_PROP_H
#include <linux/dpll.h>
#include "core.h"
struct fwnode_handle;
/**
* struct zl3073x_pin_props - pin properties
* @fwnode: pin firmware node
* @dpll_props: DPLL core pin properties
* @package_label: pin package label
* @esync_control: embedded sync support
*/
struct zl3073x_pin_props {
struct fwnode_handle *fwnode;
struct dpll_pin_properties dpll_props;
char package_label[8];
bool esync_control;
};
enum dpll_type zl3073x_prop_dpll_type_get(struct zl3073x_dev *zldev, u8 index);
struct zl3073x_pin_props *zl3073x_pin_props_get(struct zl3073x_dev *zldev,
enum dpll_pin_direction dir,
u8 index);
void zl3073x_pin_props_put(struct zl3073x_pin_props *props);
#endif /* _ZL3073X_PROP_H */