Hi
I was looking at the Zephyr for Greybus
<https://github.com/cfriedt/greybus-for-zephyr/> work, and realized that
the actual spec for greybus doesn't actually have support for ADC. My
usecase is to use the ADCs on an attached microcontroller as if they are
native ADCs on a Linux machine.
I understand this is more complicated than it looks - because unlike a
GPIO, or I2C, there's no such thing as a native ADC for the Linux side of
things. Have I understood that correctly?
I stumbled into the IIO subsystem for such requirements where there's some
analog sensor that would need to be read - but that would not work through
a microcontroller like my use case.
If one were to look at adding such support, what would they need? Is this
something that's been discussed before? Would love to understand this a bit
more, and potentially contribute.
Enforce int type on SNDRV_CTL_ELEM_IFACE_MIXER to fix sparse warning:
> warning: restricted snd_ctl_elem_iface_t degrades to integer
The iface field in the gb_audio_control struct is of type __u8, but the
values stored in it are of type int. So on conversion they are degraded.
Adding (__force int) will enforce them not to be degraded.
Signed-off-by: Rajat Asthana <thisisrast7(a)gmail.com>
---
drivers/staging/greybus/audio_topology.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/greybus/audio_topology.c b/drivers/staging/greybus/audio_topology.c
index 1fc7727ab7be..1e613d42d823 100644
--- a/drivers/staging/greybus/audio_topology.c
+++ b/drivers/staging/greybus/audio_topology.c
@@ -676,7 +676,7 @@ static int gbaudio_tplg_create_kcontrol(struct gbaudio_module_info *gb,
struct gbaudio_ctl_pvt *ctldata;
switch (ctl->iface) {
- case SNDRV_CTL_ELEM_IFACE_MIXER:
+ case (__force int)SNDRV_CTL_ELEM_IFACE_MIXER:
switch (ctl->info.type) {
case GB_AUDIO_CTL_ELEM_TYPE_ENUMERATED:
ret = gbaudio_tplg_create_enum_kctl(gb, kctl, ctl);
@@ -903,7 +903,7 @@ static int gbaudio_tplg_create_wcontrol(struct gbaudio_module_info *gb,
int ret;
switch (ctl->iface) {
- case SNDRV_CTL_ELEM_IFACE_MIXER:
+ case (__force int)SNDRV_CTL_ELEM_IFACE_MIXER:
switch (ctl->info.type) {
case GB_AUDIO_CTL_ELEM_TYPE_ENUMERATED:
ret = gbaudio_tplg_create_enum_ctl(gb, kctl, ctl);
--
2.31.1
This patch changes the typo "Atleast" -> "At least" as checkpatch.pl warned
Signed-off-by: Yusup Badiev <ybadiev(a)gmail.com>
---
drivers/staging/greybus/arche-apb-ctrl.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/greybus/arche-apb-ctrl.c b/drivers/staging/greybus/arche-apb-ctrl.c
index bbf3ba744fc4..45afa208d004 100644
--- a/drivers/staging/greybus/arche-apb-ctrl.c
+++ b/drivers/staging/greybus/arche-apb-ctrl.c
@@ -445,7 +445,7 @@ static int __maybe_unused arche_apb_ctrl_suspend(struct device *dev)
static int __maybe_unused arche_apb_ctrl_resume(struct device *dev)
{
/*
- * Atleast for ES2 we have to meet the delay requirement between
+ * At least for ES2 we have to meet the delay requirement between
* unipro switch and AP bridge init, depending on whether bridge is in
* OFF state or standby state.
*
--
2.25.1