Loading asoc/codecs/wcd937x/internal.h +2 −0 Original line number Diff line number Diff line Loading @@ -82,6 +82,8 @@ struct wcd937x_priv { /* Entry for version info */ struct snd_info_entry *entry; struct snd_info_entry *version_entry; /*Entry for Variant info*/ struct snd_info_entry *variant_entry; int ear_rx_path; int ana_clk_count; struct mutex ana_tx_clk_lock; Loading asoc/codecs/wcd937x/wcd937x.c +56 −1 Original line number Diff line number Diff line Loading @@ -29,6 +29,7 @@ #define WCD9370_VARIANT 0 #define WCD9375_VARIANT 5 #define WCD937X_VARIANT_ENTRY_SIZE 32 #define NUM_SWRS_DT_PARAMS 5 Loading Loading @@ -2200,12 +2201,46 @@ static struct snd_info_entry_ops wcd937x_info_ops = { .read = wcd937x_version_read, }; static ssize_t wcd937x_variant_read(struct snd_info_entry *entry, void *file_private_data, struct file *file, char __user *buf, size_t count, loff_t pos) { struct wcd937x_priv *priv; char buffer[WCD937X_VARIANT_ENTRY_SIZE]; int len = 0; priv = (struct wcd937x_priv *) entry->private_data; if (!priv) { pr_err("%s: wcd937x priv is null\n", __func__); return -EINVAL; } switch (priv->variant) { case WCD9370_VARIANT: len = snprintf(buffer, sizeof(buffer), "WCD9370\n"); break; case WCD9375_VARIANT: len = snprintf(buffer, sizeof(buffer), "WCD9375\n"); break; default: len = snprintf(buffer, sizeof(buffer), "VER_UNDEFINED\n"); } return simple_read_from_buffer(buf, count, &pos, buffer, len); } static struct snd_info_entry_ops wcd937x_variant_ops = { .read = wcd937x_variant_read, }; /* * wcd937x_info_create_codec_entry - creates wcd937x module * @codec_root: The parent directory * @component: component instance * * Creates wcd937x module and version entry under the given * Creates wcd937x module, variant and version entry under the given * parent directory. * * Return: 0 on success or negative error code on failure. Loading @@ -2214,6 +2249,7 @@ int wcd937x_info_create_codec_entry(struct snd_info_entry *codec_root, struct snd_soc_component *component) { struct snd_info_entry *version_entry; struct snd_info_entry *variant_entry; struct wcd937x_priv *priv; struct snd_soc_card *card; Loading Loading @@ -2254,6 +2290,25 @@ int wcd937x_info_create_codec_entry(struct snd_info_entry *codec_root, } priv->version_entry = version_entry; variant_entry = snd_info_create_card_entry(card->snd_card, "variant", priv->entry); if (!variant_entry) { dev_dbg(codec->dev, "%s: failed to create wcd937x variant entry\n", __func__); return -ENOMEM; } variant_entry->private_data = priv; variant_entry->size = WCD937X_VARIANT_ENTRY_SIZE; variant_entry->content = SNDRV_INFO_CONTENT_DATA; variant_entry->c.ops = &wcd937x_variant_ops; if (snd_info_register(variant_entry) < 0) { snd_info_free_entry(variant_entry); return -ENOMEM; } priv->variant_entry = variant_entry; return 0; } EXPORT_SYMBOL(wcd937x_info_create_codec_entry); Loading asoc/codecs/wcd938x/internal.h +1 −0 Original line number Diff line number Diff line Loading @@ -94,6 +94,7 @@ struct wcd938x_priv { /* Entry for version info */ struct snd_info_entry *entry; struct snd_info_entry *version_entry; struct snd_info_entry *variant_entry; int flyback_cur_det_disable; int ear_rx_path; }; Loading asoc/codecs/wcd938x/wcd938x.c +57 −1 Original line number Diff line number Diff line Loading @@ -26,6 +26,7 @@ #define WCD938X_DRV_NAME "wcd938x_codec" #define NUM_SWRS_DT_PARAMS 5 #define WCD938X_VARIANT_ENTRY_SIZE 32 #define WCD938X_VERSION_1_0 1 #define WCD938X_VERSION_ENTRY_SIZE 32 Loading Loading @@ -2546,12 +2547,46 @@ static struct snd_info_entry_ops wcd938x_info_ops = { .read = wcd938x_version_read, }; static ssize_t wcd938x_variant_read(struct snd_info_entry *entry, void *file_private_data, struct file *file, char __user *buf, size_t count, loff_t pos) { struct wcd938x_priv *priv; char buffer[WCD938X_VARIANT_ENTRY_SIZE]; int len = 0; priv = (struct wcd938x_priv *) entry->private_data; if (!priv) { pr_err("%s: wcd938x priv is null\n", __func__); return -EINVAL; } switch (priv->variant) { case WCD9380: len = snprintf(buffer, sizeof(buffer), "WCD9380\n"); break; case WCD9385: len = snprintf(buffer, sizeof(buffer), "WCD9385\n"); break; default: len = snprintf(buffer, sizeof(buffer), "VER_UNDEFINED\n"); } return simple_read_from_buffer(buf, count, &pos, buffer, len); } static struct snd_info_entry_ops wcd938x_variant_ops = { .read = wcd938x_variant_read, }; /* * wcd938x_info_create_codec_entry - creates wcd938x module * @codec_root: The parent directory * @component: component instance * * Creates wcd938x module and version entry under the given * Creates wcd938x module, variant and version entry under the given * parent directory. * * Return: 0 on success or negative error code on failure. Loading @@ -2560,6 +2595,7 @@ int wcd938x_info_create_codec_entry(struct snd_info_entry *codec_root, struct snd_soc_component *component) { struct snd_info_entry *version_entry; struct snd_info_entry *variant_entry; struct wcd938x_priv *priv; struct snd_soc_card *card; Loading Loading @@ -2600,6 +2636,26 @@ int wcd938x_info_create_codec_entry(struct snd_info_entry *codec_root, } priv->version_entry = version_entry; variant_entry = snd_info_create_card_entry(card->snd_card, "variant", priv->entry); if (!variant_entry) { dev_dbg(component->dev, "%s: failed to create wcd938x variant entry\n", __func__); return -ENOMEM; } variant_entry->private_data = priv; variant_entry->size = WCD938X_VARIANT_ENTRY_SIZE; variant_entry->content = SNDRV_INFO_CONTENT_DATA; variant_entry->c.ops = &wcd938x_variant_ops; if (snd_info_register(variant_entry) < 0) { snd_info_free_entry(variant_entry); return -ENOMEM; } priv->variant_entry = variant_entry; return 0; } EXPORT_SYMBOL(wcd938x_info_create_codec_entry); Loading Loading
asoc/codecs/wcd937x/internal.h +2 −0 Original line number Diff line number Diff line Loading @@ -82,6 +82,8 @@ struct wcd937x_priv { /* Entry for version info */ struct snd_info_entry *entry; struct snd_info_entry *version_entry; /*Entry for Variant info*/ struct snd_info_entry *variant_entry; int ear_rx_path; int ana_clk_count; struct mutex ana_tx_clk_lock; Loading
asoc/codecs/wcd937x/wcd937x.c +56 −1 Original line number Diff line number Diff line Loading @@ -29,6 +29,7 @@ #define WCD9370_VARIANT 0 #define WCD9375_VARIANT 5 #define WCD937X_VARIANT_ENTRY_SIZE 32 #define NUM_SWRS_DT_PARAMS 5 Loading Loading @@ -2200,12 +2201,46 @@ static struct snd_info_entry_ops wcd937x_info_ops = { .read = wcd937x_version_read, }; static ssize_t wcd937x_variant_read(struct snd_info_entry *entry, void *file_private_data, struct file *file, char __user *buf, size_t count, loff_t pos) { struct wcd937x_priv *priv; char buffer[WCD937X_VARIANT_ENTRY_SIZE]; int len = 0; priv = (struct wcd937x_priv *) entry->private_data; if (!priv) { pr_err("%s: wcd937x priv is null\n", __func__); return -EINVAL; } switch (priv->variant) { case WCD9370_VARIANT: len = snprintf(buffer, sizeof(buffer), "WCD9370\n"); break; case WCD9375_VARIANT: len = snprintf(buffer, sizeof(buffer), "WCD9375\n"); break; default: len = snprintf(buffer, sizeof(buffer), "VER_UNDEFINED\n"); } return simple_read_from_buffer(buf, count, &pos, buffer, len); } static struct snd_info_entry_ops wcd937x_variant_ops = { .read = wcd937x_variant_read, }; /* * wcd937x_info_create_codec_entry - creates wcd937x module * @codec_root: The parent directory * @component: component instance * * Creates wcd937x module and version entry under the given * Creates wcd937x module, variant and version entry under the given * parent directory. * * Return: 0 on success or negative error code on failure. Loading @@ -2214,6 +2249,7 @@ int wcd937x_info_create_codec_entry(struct snd_info_entry *codec_root, struct snd_soc_component *component) { struct snd_info_entry *version_entry; struct snd_info_entry *variant_entry; struct wcd937x_priv *priv; struct snd_soc_card *card; Loading Loading @@ -2254,6 +2290,25 @@ int wcd937x_info_create_codec_entry(struct snd_info_entry *codec_root, } priv->version_entry = version_entry; variant_entry = snd_info_create_card_entry(card->snd_card, "variant", priv->entry); if (!variant_entry) { dev_dbg(codec->dev, "%s: failed to create wcd937x variant entry\n", __func__); return -ENOMEM; } variant_entry->private_data = priv; variant_entry->size = WCD937X_VARIANT_ENTRY_SIZE; variant_entry->content = SNDRV_INFO_CONTENT_DATA; variant_entry->c.ops = &wcd937x_variant_ops; if (snd_info_register(variant_entry) < 0) { snd_info_free_entry(variant_entry); return -ENOMEM; } priv->variant_entry = variant_entry; return 0; } EXPORT_SYMBOL(wcd937x_info_create_codec_entry); Loading
asoc/codecs/wcd938x/internal.h +1 −0 Original line number Diff line number Diff line Loading @@ -94,6 +94,7 @@ struct wcd938x_priv { /* Entry for version info */ struct snd_info_entry *entry; struct snd_info_entry *version_entry; struct snd_info_entry *variant_entry; int flyback_cur_det_disable; int ear_rx_path; }; Loading
asoc/codecs/wcd938x/wcd938x.c +57 −1 Original line number Diff line number Diff line Loading @@ -26,6 +26,7 @@ #define WCD938X_DRV_NAME "wcd938x_codec" #define NUM_SWRS_DT_PARAMS 5 #define WCD938X_VARIANT_ENTRY_SIZE 32 #define WCD938X_VERSION_1_0 1 #define WCD938X_VERSION_ENTRY_SIZE 32 Loading Loading @@ -2546,12 +2547,46 @@ static struct snd_info_entry_ops wcd938x_info_ops = { .read = wcd938x_version_read, }; static ssize_t wcd938x_variant_read(struct snd_info_entry *entry, void *file_private_data, struct file *file, char __user *buf, size_t count, loff_t pos) { struct wcd938x_priv *priv; char buffer[WCD938X_VARIANT_ENTRY_SIZE]; int len = 0; priv = (struct wcd938x_priv *) entry->private_data; if (!priv) { pr_err("%s: wcd938x priv is null\n", __func__); return -EINVAL; } switch (priv->variant) { case WCD9380: len = snprintf(buffer, sizeof(buffer), "WCD9380\n"); break; case WCD9385: len = snprintf(buffer, sizeof(buffer), "WCD9385\n"); break; default: len = snprintf(buffer, sizeof(buffer), "VER_UNDEFINED\n"); } return simple_read_from_buffer(buf, count, &pos, buffer, len); } static struct snd_info_entry_ops wcd938x_variant_ops = { .read = wcd938x_variant_read, }; /* * wcd938x_info_create_codec_entry - creates wcd938x module * @codec_root: The parent directory * @component: component instance * * Creates wcd938x module and version entry under the given * Creates wcd938x module, variant and version entry under the given * parent directory. * * Return: 0 on success or negative error code on failure. Loading @@ -2560,6 +2595,7 @@ int wcd938x_info_create_codec_entry(struct snd_info_entry *codec_root, struct snd_soc_component *component) { struct snd_info_entry *version_entry; struct snd_info_entry *variant_entry; struct wcd938x_priv *priv; struct snd_soc_card *card; Loading Loading @@ -2600,6 +2636,26 @@ int wcd938x_info_create_codec_entry(struct snd_info_entry *codec_root, } priv->version_entry = version_entry; variant_entry = snd_info_create_card_entry(card->snd_card, "variant", priv->entry); if (!variant_entry) { dev_dbg(component->dev, "%s: failed to create wcd938x variant entry\n", __func__); return -ENOMEM; } variant_entry->private_data = priv; variant_entry->size = WCD938X_VARIANT_ENTRY_SIZE; variant_entry->content = SNDRV_INFO_CONTENT_DATA; variant_entry->c.ops = &wcd938x_variant_ops; if (snd_info_register(variant_entry) < 0) { snd_info_free_entry(variant_entry); return -ENOMEM; } priv->variant_entry = variant_entry; return 0; } EXPORT_SYMBOL(wcd938x_info_create_codec_entry); Loading