Lines Matching +full:haptic +full:- +full:driver

1 // SPDX-License-Identifier: GPL-2.0
3 // CS40L50 Advanced Haptic Driver with waveform memory,
4 // integrated DSP, and closed-loop algorithms
74 return -EINVAL; in cs40l50_get_clk_config()
84 ret = cs40l50_get_clk_config(codec->bclk_ratio * codec->rate, &cfg); in cs40l50_swap_ext_clk()
92 return -EINVAL; in cs40l50_swap_ext_clk()
95 ret = regmap_update_bits(codec->regmap, CS40L50_REFCLK_INPUT, in cs40l50_swap_ext_clk()
102 ret = regmap_update_bits(codec->regmap, CS40L50_REFCLK_INPUT, in cs40l50_swap_ext_clk()
109 return regmap_update_bits(codec->regmap, CS40L50_REFCLK_INPUT, in cs40l50_swap_ext_clk()
119 struct snd_soc_component *comp = snd_soc_dapm_to_component(w->dapm); in cs40l50_clk_en()
125 ret = cs40l50_dsp_write(codec->dev, codec->regmap, CS40L50_STOP_PLAYBACK); in cs40l50_clk_en()
129 ret = cs40l50_dsp_write(codec->dev, codec->regmap, CS40L50_START_I2S); in cs40l50_clk_en()
143 return -EINVAL; in cs40l50_clk_en()
168 struct cs40l50_codec *codec = snd_soc_component_get_drvdata(codec_dai->component); in cs40l50_set_dai_fmt()
171 return -EINVAL; in cs40l50_set_dai_fmt()
175 codec->daifmt = 0; in cs40l50_set_dai_fmt()
178 codec->daifmt = CS40L50_ASP_FSYNC_INV_MASK; in cs40l50_set_dai_fmt()
181 codec->daifmt = CS40L50_ASP_BCLK_INV_MASK; in cs40l50_set_dai_fmt()
184 codec->daifmt = CS40L50_ASP_FSYNC_INV_MASK | CS40L50_ASP_BCLK_INV_MASK; in cs40l50_set_dai_fmt()
187 dev_err(codec->dev, "Invalid clock invert\n"); in cs40l50_set_dai_fmt()
188 return -EINVAL; in cs40l50_set_dai_fmt()
193 codec->daifmt |= FIELD_PREP(CS40L50_ASP_FMT_MASK, CS40L50_ASP_FMT_I2S); in cs40l50_set_dai_fmt()
196 dev_err(codec->dev, "Unsupported DAI format\n"); in cs40l50_set_dai_fmt()
197 return -EINVAL; in cs40l50_set_dai_fmt()
207 struct cs40l50_codec *codec = snd_soc_component_get_drvdata(dai->component); in cs40l50_hw_params()
211 codec->rate = params_rate(params); in cs40l50_hw_params()
213 ret = regmap_update_bits(codec->regmap, CS40L50_ASP_DATA_CONTROL5, in cs40l50_hw_params()
218 codec->daifmt |= (asp_rx_wl << CS40L50_ASP_RX_WIDTH_SHIFT); in cs40l50_hw_params()
220 return regmap_update_bits(codec->regmap, CS40L50_ASP_CONTROL2, in cs40l50_hw_params()
224 CS40L50_ASP_RX_WIDTH_MASK, codec->daifmt); in cs40l50_hw_params()
229 struct cs40l50_codec *codec = snd_soc_component_get_drvdata(dai->component); in cs40l50_set_dai_bclk_ratio()
231 codec->bclk_ratio = ratio; in cs40l50_set_dai_bclk_ratio()
244 .name = "cs40l50-pcm",
261 codec->bclk_ratio = CS40L50_BCLK_RATIO_DEFAULT; in cs40l50_codec_probe()
276 struct cs40l50 *cs40l50 = dev_get_drvdata(pdev->dev.parent); in cs40l50_codec_driver_probe()
279 codec = devm_kzalloc(&pdev->dev, sizeof(*codec), GFP_KERNEL); in cs40l50_codec_driver_probe()
281 return -ENOMEM; in cs40l50_codec_driver_probe()
283 codec->regmap = cs40l50->regmap; in cs40l50_codec_driver_probe()
284 codec->dev = &pdev->dev; in cs40l50_codec_driver_probe()
286 return devm_snd_soc_register_component(&pdev->dev, &soc_codec_dev_cs40l50, in cs40l50_codec_driver_probe()
291 { "cs40l50-codec", },
299 .driver = {
300 .name = "cs40l50-codec",
305 MODULE_DESCRIPTION("ASoC CS40L50 driver");