cdce 294 drivers/clk/clk-cdce706.c struct cdce706_dev_data *cdce = hwd->dev_data; cdce 310 drivers/clk/clk-cdce706.c struct clk *gp_clk = cdce->clkin_clk[cdce->clkin[0].parent]; cdce 446 drivers/clk/clk-cdce706.c static int cdce706_register_hw(struct cdce706_dev_data *cdce, cdce 456 drivers/clk/clk-cdce706.c hw->dev_data = cdce; cdce 459 drivers/clk/clk-cdce706.c ret = devm_clk_hw_register(&cdce->client->dev, cdce 462 drivers/clk/clk-cdce706.c dev_err(&cdce->client->dev, "Failed to register %s\n", cdce 470 drivers/clk/clk-cdce706.c static int cdce706_register_clkin(struct cdce706_dev_data *cdce) cdce 474 drivers/clk/clk-cdce706.c .parent_names = cdce->clkin_name, cdce 475 drivers/clk/clk-cdce706.c .num_parents = ARRAY_SIZE(cdce->clkin_name), cdce 481 drivers/clk/clk-cdce706.c for (i = 0; i < ARRAY_SIZE(cdce->clkin_name); ++i) { cdce 482 drivers/clk/clk-cdce706.c struct clk *parent = devm_clk_get(&cdce->client->dev, cdce 486 drivers/clk/clk-cdce706.c cdce->clkin_name[i] = cdce706_source_name[i]; cdce 488 drivers/clk/clk-cdce706.c cdce->clkin_name[i] = __clk_get_name(parent); cdce 489 drivers/clk/clk-cdce706.c cdce->clkin_clk[i] = parent; cdce 493 drivers/clk/clk-cdce706.c ret = cdce706_reg_read(cdce, CDCE706_CLKIN_SOURCE, &source); cdce 498 drivers/clk/clk-cdce706.c ret = cdce706_reg_read(cdce, CDCE706_CLKIN_CLOCK, &clock); cdce 501 drivers/clk/clk-cdce706.c cdce->clkin[0].parent = !!(clock & CDCE706_CLKIN_CLOCK_MASK); cdce 504 drivers/clk/clk-cdce706.c ret = cdce706_register_hw(cdce, cdce->clkin, cdce 505 drivers/clk/clk-cdce706.c ARRAY_SIZE(cdce->clkin), cdce 510 drivers/clk/clk-cdce706.c static int cdce706_register_plls(struct cdce706_dev_data *cdce) cdce 521 drivers/clk/clk-cdce706.c ret = cdce706_reg_read(cdce, CDCE706_PLL_MUX, &mux); cdce 525 drivers/clk/clk-cdce706.c for (i = 0; i < ARRAY_SIZE(cdce->pll); ++i) { cdce 528 drivers/clk/clk-cdce706.c ret = cdce706_reg_read(cdce, CDCE706_PLL_M_LOW(i), &m); cdce 531 drivers/clk/clk-cdce706.c ret = cdce706_reg_read(cdce, CDCE706_PLL_N_LOW(i), &n); cdce 534 drivers/clk/clk-cdce706.c ret = cdce706_reg_read(cdce, CDCE706_PLL_HI(i), &v); cdce 537 drivers/clk/clk-cdce706.c cdce->pll[i].div = m | ((v & CDCE706_PLL_HI_M_MASK) << 8); cdce 538 drivers/clk/clk-cdce706.c cdce->pll[i].mul = n | ((v & CDCE706_PLL_HI_N_MASK) << cdce 540 drivers/clk/clk-cdce706.c cdce->pll[i].mux = mux & CDCE706_PLL_MUX_MASK(i); cdce 541 drivers/clk/clk-cdce706.c dev_dbg(&cdce->client->dev, cdce 543 drivers/clk/clk-cdce706.c cdce->pll[i].div, cdce->pll[i].mul, cdce->pll[i].mux); cdce 546 drivers/clk/clk-cdce706.c ret = cdce706_register_hw(cdce, cdce->pll, cdce 547 drivers/clk/clk-cdce706.c ARRAY_SIZE(cdce->pll), cdce 552 drivers/clk/clk-cdce706.c static int cdce706_register_dividers(struct cdce706_dev_data *cdce) cdce 563 drivers/clk/clk-cdce706.c for (i = 0; i < ARRAY_SIZE(cdce->divider); ++i) { cdce 566 drivers/clk/clk-cdce706.c ret = cdce706_reg_read(cdce, CDCE706_DIVIDER_PLL(i), &val); cdce 569 drivers/clk/clk-cdce706.c cdce->divider[i].parent = cdce 573 drivers/clk/clk-cdce706.c ret = cdce706_reg_read(cdce, CDCE706_DIVIDER(i), &val); cdce 576 drivers/clk/clk-cdce706.c cdce->divider[i].div = val & CDCE706_DIVIDER_DIVIDER_MASK; cdce 577 drivers/clk/clk-cdce706.c dev_dbg(&cdce->client->dev, cdce 579 drivers/clk/clk-cdce706.c cdce->divider[i].parent, cdce->divider[i].div); cdce 582 drivers/clk/clk-cdce706.c ret = cdce706_register_hw(cdce, cdce->divider, cdce 583 drivers/clk/clk-cdce706.c ARRAY_SIZE(cdce->divider), cdce 588 drivers/clk/clk-cdce706.c static int cdce706_register_clkouts(struct cdce706_dev_data *cdce) cdce 599 drivers/clk/clk-cdce706.c for (i = 0; i < ARRAY_SIZE(cdce->clkout); ++i) { cdce 602 drivers/clk/clk-cdce706.c ret = cdce706_reg_read(cdce, CDCE706_CLKOUT(i), &val); cdce 605 drivers/clk/clk-cdce706.c cdce->clkout[i].parent = val & CDCE706_CLKOUT_DIVIDER_MASK; cdce 606 drivers/clk/clk-cdce706.c dev_dbg(&cdce->client->dev, cdce 608 drivers/clk/clk-cdce706.c cdce->clkout[i].parent); cdce 611 drivers/clk/clk-cdce706.c return cdce706_register_hw(cdce, cdce->clkout, cdce 612 drivers/clk/clk-cdce706.c ARRAY_SIZE(cdce->clkout), cdce 619 drivers/clk/clk-cdce706.c struct cdce706_dev_data *cdce = data; cdce 622 drivers/clk/clk-cdce706.c if (idx >= ARRAY_SIZE(cdce->clkout)) { cdce 627 drivers/clk/clk-cdce706.c return &cdce->clkout[idx].hw; cdce 634 drivers/clk/clk-cdce706.c struct cdce706_dev_data *cdce; cdce 640 drivers/clk/clk-cdce706.c cdce = devm_kzalloc(&client->dev, sizeof(*cdce), GFP_KERNEL); cdce 641 drivers/clk/clk-cdce706.c if (!cdce) cdce 644 drivers/clk/clk-cdce706.c cdce->client = client; cdce 645 drivers/clk/clk-cdce706.c cdce->regmap = devm_regmap_init_i2c(client, &cdce706_regmap_config); cdce 646 drivers/clk/clk-cdce706.c if (IS_ERR(cdce->regmap)) { cdce 651 drivers/clk/clk-cdce706.c i2c_set_clientdata(client, cdce); cdce 653 drivers/clk/clk-cdce706.c ret = cdce706_register_clkin(cdce); cdce 656 drivers/clk/clk-cdce706.c ret = cdce706_register_plls(cdce); cdce 659 drivers/clk/clk-cdce706.c ret = cdce706_register_dividers(cdce); cdce 662 drivers/clk/clk-cdce706.c ret = cdce706_register_clkouts(cdce); cdce 666 drivers/clk/clk-cdce706.c cdce);