drivers/dpll/zl3073x/core.c

Source file repositories/reference/linux-study-clean/drivers/dpll/zl3073x/core.c

File Facts

System
Linux kernel
Corpus path
drivers/dpll/zl3073x/core.c
Extension
.c
Size
27081 bytes
Lines
1068
Domain
Driver Families
Bucket
drivers/dpll
Inferred role
Driver Families: exported/initcall integration point
Status
integration 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.

Dependency Surface

Detected Declarations

Annotated Snippet

if (rc) {
			dev_err(zldev->dev,
				"Failed to fetch input state: %pe\n",
				ERR_PTR(rc));
			return rc;
		}
	}

	for (i = 0; i < ZL3073X_NUM_SYNTHS; i++) {
		rc = zl3073x_synth_state_fetch(zldev, i);
		if (rc) {
			dev_err(zldev->dev,
				"Failed to fetch synth state: %pe\n",
				ERR_PTR(rc));
			return rc;
		}
	}

	for (i = 0; i < ZL3073X_NUM_OUTS; i++) {
		rc = zl3073x_out_state_fetch(zldev, i);
		if (rc) {
			dev_err(zldev->dev,
				"Failed to fetch output state: %pe\n",
				ERR_PTR(rc));
			return rc;
		}
	}

	for (i = 0; i < zldev->info->num_channels; i++) {
		rc = zl3073x_chan_state_fetch(zldev, i);
		if (rc) {
			dev_err(zldev->dev,
				"Failed to fetch channel state: %pe\n",
				ERR_PTR(rc));
			return rc;
		}
	}

	return rc;
}

static void
zl3073x_dev_ref_states_update(struct zl3073x_dev *zldev)
{
	int i, rc;

	for (i = 0; i < ZL3073X_NUM_REFS; i++) {
		rc = zl3073x_ref_state_update(zldev, i);
		if (rc)
			dev_warn(zldev->dev,
				 "Failed to get REF%u status: %pe\n", i,
				 ERR_PTR(rc));
	}
}

static void
zl3073x_dev_chan_states_update(struct zl3073x_dev *zldev)
{
	int i, rc;

	for (i = 0; i < zldev->info->num_channels; i++) {
		rc = zl3073x_chan_state_update(zldev, i);
		if (rc)
			dev_warn(zldev->dev,
				 "Failed to get DPLL%u state: %pe\n", i,
				 ERR_PTR(rc));
	}
}

/**
 * zl3073x_ref_phase_offsets_update - update reference phase offsets
 * @zldev: pointer to zl3073x_dev structure
 * @channel: DPLL channel number or -1
 *
 * The function asks device to update phase offsets latch registers with
 * the latest measured values. There are 2 sets of latch registers:
 *
 * 1) Up to 5 DPLL-to-connected-ref registers that contain phase offset
 *    values between particular DPLL channel and its *connected* input
 *    reference.
 *
 * 2) 10 selected-DPLL-to-all-ref registers that contain phase offset values
 *    between selected DPLL channel and all input references.
 *
 * If the caller is interested in 2) then it has to pass DPLL channel number
 * in @channel parameter. If it is interested only in 1) then it should pass
 * @channel parameter with value of -1.
 *
 * Return: 0 on success, <0 on error
 */

Annotation

Implementation Notes