Can't enable BCM2835 PCM clocks at boot up

Open
#3,564 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Tech stack
c, linux

Research direction

Start with the BCM2835 I2S/PCM clock implementation and the device-tree overlay shown in the issue, then trace the devm_clk_get, clk_set_rate, and clk_prepare_enable calls used for the mclk. Determine whether boot-time PCM clock enablement is supported and define a reproducible test for confirming a continuous clock; the issue is complete only when that behavior works or a documented limitation is established.

Written by the indexing model from the issue text.

Description

Hi,

As for now there is no continuous I2S/PCM clock support on the I2S BCM2835 driver I'm trying to enable the clocks manually (without any succes until now) in the following way:

  • Define the clock in the device tree as:
    fragment@4 {
    target = <&sound>;
    overlay {
    compatible = "merus,merus-amp";
    i2s-controller = <&i2s>;
    status = "okay";
    pinctrl-names = "default";
    pinctrl-0 = <&gpio4_clk_pin>;
    clocks = <&clocks BCM2835_CLOCK_PCM >; /* BCM2835_CLOCK_GP0 */
    clock-names = "mclk";
    mute_gp-gpios = <&gpio 15 GPIO_ACTIVE_HIGH>;
    };
    };
  • Enable the clock (and parent if neccesary) as:
    priv_data->mclk = devm_clk_get(&pdev->dev, "mclk");
    clk_set_rate(priv_data->mclk, 2822400); //Trying an example frequency
    ret = clk_prepare_enable(priv_data->mclk2);

Altough I have no errors in the log the clock is never enabled. The only way I succed is using a general purpose clock, but not with the PCM clocks.

Is there any way to make this possible?

Best,
Ariel

Dominant language
C
Stars
13.2k
Forks
5.5k
Avg merge
2d 21h
Merged PRs (30d)
21

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from raspberrypi/linux

All issues in raspberrypi/linux

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.