sma1303.c (30cf002579969120ce926dffa3630afbb2ae899f) sma1303.c (1edc70c3a4c2b07dceac3ab7d564a283549a2534)
1// SPDX-License-Identifier: GPL-2.0-or-later
2//
3// sma1303.c -- sma1303 ALSA SoC Audio driver
4//
5// Copyright 2023 Iron Device Corporation
6//
7// Auther: Gyuhwa Park <gyuhwa.park@irondevice.com>
8// Kiseok Jo <kiseok.jo@irondevice.com>

--- 1607 unchanged lines hidden (view full) ---

1616 ret = PTR_ERR(sma1303->regmap);
1617 dev_err(&client->dev,
1618 "Failed to allocate register map: %d\n", ret);
1619
1620 return ret;
1621 }
1622
1623 if (np) {
1// SPDX-License-Identifier: GPL-2.0-or-later
2//
3// sma1303.c -- sma1303 ALSA SoC Audio driver
4//
5// Copyright 2023 Iron Device Corporation
6//
7// Auther: Gyuhwa Park <gyuhwa.park@irondevice.com>
8// Kiseok Jo <kiseok.jo@irondevice.com>

--- 1607 unchanged lines hidden (view full) ---

1616 ret = PTR_ERR(sma1303->regmap);
1617 dev_err(&client->dev,
1618 "Failed to allocate register map: %d\n", ret);
1619
1620 return ret;
1621 }
1622
1623 if (np) {
1624 if (!of_property_read_u32(np, "i2c-retry", &value)) {
1625 if (value > 50 || value <= 0) {
1626 sma1303->retry_cnt = SMA1303_I2C_RETRY_COUNT;
1627 dev_dbg(&client->dev, "%s : %s\n", __func__,
1628 "i2c-retry out of range (up to 50)");
1629 } else {
1630 sma1303->retry_cnt = value;
1631 dev_dbg(&client->dev, "%s : %s = %u\n",
1632 __func__, "i2c-retry count", value);
1633 }
1634 } else {
1635 dev_dbg(&client->dev, "%s : %s = %d\n", __func__,
1636 "i2c-retry count", SMA1303_I2C_RETRY_COUNT);
1637 sma1303->retry_cnt = SMA1303_I2C_RETRY_COUNT;
1638 }
1639 if (!of_property_read_u32(np, "tdm-slot-rx", &value)) {
1640 dev_dbg(&client->dev,
1641 "tdm slot rx is '%d' from DT\n", value);
1642 sma1303->tdm_slot_rx = value;
1643 } else {
1644 dev_dbg(&client->dev,
1645 "Default setting of tdm slot rx is '0'\n");
1646 sma1303->tdm_slot_rx = 0;

--- 81 unchanged lines hidden (view full) ---

1728 sma1303->check_fault_status = true;
1729 sma1303->force_mute_status = false;
1730 sma1303->init_vol = 0x31;
1731 sma1303->cur_vol = sma1303->init_vol;
1732 sma1303->last_bclk = 0;
1733 sma1303->last_ocp_val = 0x08;
1734 sma1303->last_over_temp = 0xC0;
1735 sma1303->tsdw_cnt = 0;
1624 if (!of_property_read_u32(np, "tdm-slot-rx", &value)) {
1625 dev_dbg(&client->dev,
1626 "tdm slot rx is '%d' from DT\n", value);
1627 sma1303->tdm_slot_rx = value;
1628 } else {
1629 dev_dbg(&client->dev,
1630 "Default setting of tdm slot rx is '0'\n");
1631 sma1303->tdm_slot_rx = 0;

--- 81 unchanged lines hidden (view full) ---

1713 sma1303->check_fault_status = true;
1714 sma1303->force_mute_status = false;
1715 sma1303->init_vol = 0x31;
1716 sma1303->cur_vol = sma1303->init_vol;
1717 sma1303->last_bclk = 0;
1718 sma1303->last_ocp_val = 0x08;
1719 sma1303->last_over_temp = 0xC0;
1720 sma1303->tsdw_cnt = 0;
1721 sma1303->retry_cnt = SMA1303_I2C_RETRY_COUNT;
1736
1737 sma1303->dev = &client->dev;
1738 sma1303->kobj = &client->dev.kobj;
1739
1740 INIT_DELAYED_WORK(&sma1303->check_fault_work,
1741 sma1303_check_fault_worker);
1742
1743 i2c_set_clientdata(client, sma1303);

--- 60 unchanged lines hidden ---
1722
1723 sma1303->dev = &client->dev;
1724 sma1303->kobj = &client->dev.kobj;
1725
1726 INIT_DELAYED_WORK(&sma1303->check_fault_work,
1727 sma1303_check_fault_worker);
1728
1729 i2c_set_clientdata(client, sma1303);

--- 60 unchanged lines hidden ---