···1818Optional properties:19192020- realtek,pow-ldo2-gpio : The GPIO that controls the CODEC's POW_LDO2 pin.2121+- realtek,reset-gpio : The GPIO that controls the CODEC's RESET pin.21222223- realtek,in1-differential2324- realtek,in2-differential···71707271 realtek,pow-ldo2-gpio =7372 <&gpio TEGRA_GPIO(V, 3) GPIO_ACTIVE_HIGH>;7373+ realtek,reset-gpio = <&gpio TEGRA_GPIO(BB, 3) GPIO_ACTIVE_LOW>;7474 realtek,in1-differential = "true";7575 realtek,gpio-config = /bits/ 8 <0 0 0 0 0 2>; /* pull up GPIO6 */7676 realtek,jd2-gpio = <3>; /* Enables Jack detection for GPIO6 */
+30-2
sound/soc/codecs/rt5677.c
···47634763 regmap_write(rt5677->regmap, RT5677_RESET, 0x10ec);47644764 if (gpio_is_valid(rt5677->pow_ldo2))47654765 gpio_set_value_cansleep(rt5677->pow_ldo2, 0);47664766+ if (gpio_is_valid(rt5677->reset_pin))47674767+ gpio_set_value_cansleep(rt5677->reset_pin, 0);4766476847674769 return 0;47684770}···4780477847814779 if (gpio_is_valid(rt5677->pow_ldo2))47824780 gpio_set_value_cansleep(rt5677->pow_ldo2, 0);47814781+ if (gpio_is_valid(rt5677->reset_pin))47824782+ gpio_set_value_cansleep(rt5677->reset_pin, 0);47834783 }4784478447854785 return 0;···47924788 struct rt5677_priv *rt5677 = snd_soc_codec_get_drvdata(codec);4793478947944790 if (!rt5677->dsp_vad_en) {47954795- if (gpio_is_valid(rt5677->pow_ldo2)) {47914791+ if (gpio_is_valid(rt5677->pow_ldo2))47964792 gpio_set_value_cansleep(rt5677->pow_ldo2, 1);47934793+ if (gpio_is_valid(rt5677->reset_pin))47944794+ gpio_set_value_cansleep(rt5677->reset_pin, 1);47954795+ if (gpio_is_valid(rt5677->pow_ldo2) ||47964796+ gpio_is_valid(rt5677->reset_pin))47974797 msleep(10);47984798- }4799479848004799 regcache_cache_only(rt5677->regmap, false);48014800 regcache_sync(rt5677->regmap);···5036502950375030 rt5677->pow_ldo2 = of_get_named_gpio(np,50385031 "realtek,pow-ldo2-gpio", 0);50325032+ rt5677->reset_pin = of_get_named_gpio(np,50335033+ "realtek,reset-gpio", 0);5039503450405035 /*50415036 * POW_LDO2 is optional (it may be statically tied on the board).···50485039 if (!gpio_is_valid(rt5677->pow_ldo2) &&50495040 (rt5677->pow_ldo2 != -ENOENT))50505041 return rt5677->pow_ldo2;50425042+ if (!gpio_is_valid(rt5677->reset_pin) &&50435043+ (rt5677->reset_pin != -ENOENT))50445044+ return rt5677->reset_pin;5051504550525046 of_property_read_u8_array(np, "realtek,gpio-config",50535047 rt5677->pdata.gpio_config, RT5677_GPIO_NUM);···51525140 }51535141 } else {51545142 rt5677->pow_ldo2 = -EINVAL;51435143+ rt5677->reset_pin = -EINVAL;51555144 }5156514551575146 if (gpio_is_valid(rt5677->pow_ldo2)) {···51645151 rt5677->pow_ldo2, ret);51655152 return ret;51665153 }51545154+ }51555155+51565156+ if (gpio_is_valid(rt5677->reset_pin)) {51575157+ ret = devm_gpio_request_one(&i2c->dev, rt5677->reset_pin,51585158+ GPIOF_OUT_INIT_HIGH,51595159+ "RT5677 RESET");51605160+ if (ret < 0) {51615161+ dev_err(&i2c->dev, "Failed to request RESET %d: %d\n",51625162+ rt5677->reset_pin, ret);51635163+ return ret;51645164+ }51655165+ }51665166+51675167+ if (gpio_is_valid(rt5677->pow_ldo2) ||51685168+ gpio_is_valid(rt5677->reset_pin)) {51675169 /* Wait a while until I2C bus becomes available. The datasheet51685170 * does not specify the exact we should wait but startup51695171 * sequence mentiones at least a few milliseconds.
+1
sound/soc/codecs/rt5677.h
···17761776 int pll_in;17771777 int pll_out;17781778 int pow_ldo2; /* POW_LDO2 pin */17791779+ int reset_pin; /* RESET pin */17791780 enum rt5677_type type;17801781#ifdef CONFIG_GPIOLIB17811782 struct gpio_chip gpio_chip;