Re: [PATCH v2] staging: wfx: Typo fix

2020-05-17 Thread Greg Kroah-Hartman
On Mon, May 18, 2020 at 07:47:29AM +0200, Mohamed Dawod wrote:
> Fixing some typo errors in traces.h file
> 
> Signed-off-by: Mohamed Dawod 
> ---
>  drivers/staging/wfx/traces.h | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)

What changed from v1?  Always put that below the --- line.

Please fix that up and send v3.

thanks,

greg k-h
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2] staging: wfx: Typo fix

2020-05-17 Thread Mohamed Dawod
Fixing some typo errors in traces.h file

Signed-off-by: Mohamed Dawod 
---
 drivers/staging/wfx/traces.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/wfx/traces.h b/drivers/staging/wfx/traces.h
index bb9f7e9..80e131c 100644
--- a/drivers/staging/wfx/traces.h
+++ b/drivers/staging/wfx/traces.h
@@ -32,16 +32,16 @@
  * xxx_name(XXX)   \
  * ...
  *
- *   3. Instanciate that list_names:
+ *   3. Instantiate that list_names:
  *
  *  list_names
  *
- *   4. Redefine xxx_name() as a entry of array for __print_symbolic()
+ *   4. Redefine xxx_name() as an entry of array for __print_symbolic()
  *
  *  #undef xxx_name
  *  #define xxx_name(msg) { msg, #msg },
  *
- *   5. list_name can now nearlu be used with __print_symbolic() but,
+ *   5. list_name can now nearly be used with __print_symbolic() but,
  *  __print_symbolic() dislike last comma of list. So we define a new list
  *  with a dummy element:
  *
-- 
2.7.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: qlge: unmap dma when lock failed

2020-05-17 Thread Benjamin Poirier
On 2020-05-17 13:46 +0800, Xiangyang Zhang wrote:
> DMA not unmapped when lock failed, this patch fixed it.
> 

Fixes: 4322c5bee85e ("qlge: Expand coverage of hw lock for config register.")

> Signed-off-by: Xiangyang Zhang 
> ---
>  drivers/staging/qlge/qlge_main.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: RTL8723BS driver doesn't work for,me but I can help testing

2020-05-17 Thread Martin Blumenstingl
Hi Tobias,

On Sun, May 17, 2020 at 11:05 PM Tobias Baumann
<017623705...@o2online.de> wrote:
>
> hi martin
>
> sorry for cc -problem it was my fault in thunderbird
>
> thanks for dtb file but this file has problem kernel stop with
>
> [6.122092] mmc0: new high speed SDIO card at address 0001
> [   35.804258] VCCK: disabling
> [   35.808781] platform pwmleds: deferred probe pending
> [   35.812625] platform sound: deferred probe pending
pwmleds was also there in your last dmesg
please ignore the sound part, I haven't tested it on that particular
board in a while


> [  215.804295] random: crng init done
>
> (last time deferred probe was gcc problem )
>
> please can you provide me with dts file and i complile at my linux box
> or maybe only the change line and i use the dtb from image and edit the
> lines like the usb patch
you can get all my patches from here: [0]
as always: some of them are not even in linux-next yet and there's a
reason for that ;-)
I have changed the GPIO_ACTIVE_* polarity for the two GPIOs in the
sdio_pwrseq node if you want to do that by yourself.


Best regards,
Martin


[0] https://github.com/xdarklight/linux/tree/meson-mx-integration-5.8-20200517
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: RTL8723BS driver doesn't work for,me but I can help testing

2020-05-17 Thread Tobias Baumann

hi martin

sorry for cc -problem it was my fault in thunderbird

thanks for dtb file but this file has problem kernel stop with

[    6.122092] mmc0: new high speed SDIO card at address 0001
[   35.804258] VCCK: disabling
[   35.808781] platform pwmleds: deferred probe pending
[   35.812625] platform sound: deferred probe pending

[  215.804295] random: crng init done

(last time deferred probe was gcc problem )

please can you provide me with dts file and i complile at my linux box 
or maybe only the change line and i use the dtb from image and edit the 
lines like the usb patch


thanks

Tobias

Am 17.05.2020 um 22:28 schrieb Martin Blumenstingl:

Hi Tobias,

(adding back the original Cc list since that got lost at some point.
please keep them included)

On Sun, May 17, 2020 at 9:57 PM Tobias Baumann <017623705...@o2online.de> wrote:

hi Martin


i know what you mean with many modules from Arduino sensor modules not
all datasheet are correct

ok i got into uboot env

i could not get GPIOA0 write because of unknowm pin number

GPIOAO_0 should work though (the underscore is important)


but GPIOX works

now my measurmant show that out high = signal high (3.3V) and out low
=singnal low (0.0V)

without any instruction the S812 pins show something betwen 0.2V and 0.8v

and that GPIOX_11 (old gpio-123 ; new gpio-402) the one to PIN12
WLAN-DIS of r8723bs modul

and like you saw on my kernel cat print it is set to low

I have updated the GPIOs polarity of GPIOAO_6 and GPIOX_11 (since both
are showing inverse polarity compared to the Android kernel).
since I don't know if you build mainline yourself or if you use builds
from other people: I attached the updated .dtb so you can use that if
you want to

Please let me know if that fixes wifi for you.



thanks for you uboot gset instruction thats helps

Am 17.05.2020 um 20:09 schrieb Martin Blumenstingl:

Hi Tobias,

On Sun, May 17, 2020 at 8:53 AM Tobias Baumann <017623705...@o2online.de> wrote:

hi Martin


yes i mean rtw_antsel=1 or rtw_ansel=2 with cold start

i got hands on pine64 rtl8723bs pdf file with datasheet i attached it there i 
found the pinout and found a hint that maybe help !!!

it *may* help. beware that there are *many* RTL8723BS modules out
there, which may or may not follow the same pattern.

Realtek only sells the RTL8723BS chip on it's own. But it needs some
extra components (crystals, resistors, capacitors, ...)
When changing some of these components you need to certify (FCC / CE /
some other regulatory) the wifi card again (to ensure it follows the
specification and does not interfere with other devices).
Thus there are manufacturers (for example FN-LINK) that sell certified
RTL8723BS modules.

Also one datasheet can describe the signal as "active low".
However, if there is a small transistor circuit on the module PCB (or
the main SoC PCB) then that can "flip" the signal, meaning: the SoC
outputs HIGH but the module gets LOW - or vice versa.
Thus we describe the GPIOs from the GPIO controller (in this case:
Amlogic SoC) perspective.


GPIOs 0-135:(from 3.10.99 Kernel )
   gpio-3   (gpio_key) in  hi
   gpio-6   (sdio_wifi   ) out hi ->

this one is GPIOAO_6 and called "gpio-382" in your 5.7 kernel GPIO dump


   gpio-14  (amlsd   ) in  lo
   gpio-15  (DWC_OTG ) out hi
   gpio-64  (amlsd   ) in  lo
   gpio-122 (sdio_wifi   ) out hi

this one is GPIOX_10. I don't know why the vendor kernel requests this as GPIO
because actually it is using the xtal_32k_out mux on the pin controller.
I assume this is what you have for pin24 below (32k/RTC clock/WLAN
clock), because it's output is 32.768kHz (or rounded: 32kHz)


   gpio-123 (sdio_wifi   ) out hi

this one is GPIOX_11 and called "gpio-402" in your 5.7 kernel GPIO dump


   gpio-132 (bt_rfkill   ) out hi -> pin 34 Bt_dis (Bluetooth disable)

this one is GPIOX_20 and not part of your 5.7 kernel GPIO dump
Linux 5.8 will gain RTL8723BS Bluetooth support -> with that the GPIO
will show up as well

do you know if this is related to the wifi part somehow?


   gpio-133 (sdio_wifi   ) in  hi

this one is GPIOX_21 and not part of your 5.7 kernel GPIO dump either.
It is the "wifi host wake" and should not be related to your issue.
the SDIO wifi card uses it to let the host know that data is available
and the host should resume from suspend.

[...]

GPIO Kernel 5.7

gpiochip1: GPIOs 376-390, parent: platform/c8100084.pinctrl, ao-bank:
   gpio-382 (|reset   ) out lo

gpiochip0: GPIOs 391-511, parent: platform/c1109880.pinctrl, cbus-banks:
   gpio-402 (|reset   ) out lo
   gpio-484 (|snps,reset  ) out hi ACTIVE LOW

you can ignore gpio-484 (snps,reset) for the current issue.
This is for the Ethernet PHY and has nothing to do with wifi.


   gpio-491 (|cd  ) in  lo ACTIVE LOW


i think i do not 

Re: [RFC PATCH] staging: rtl8192u: indicate_packets() can be static

2020-05-17 Thread Joe Perches
On Mon, 2020-05-18 at 04:22 +0800, kbuild test robot wrote:
> Signed-off-by: kbuild test robot 
> ---

This doesn't apply on Linus' tree or -next so perhaps the
robot should put what tree and branch patches like these
are meant to be applied on after the --- line

>  ieee80211_rx.c |2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c 
> b/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c
> index 3309f64be4c94..bceff1ba3d7d4 100644
> --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c
> +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c
> @@ -520,7 +520,7 @@ static bool AddReorderEntry(struct rx_ts_record *pTS, 
> struct rx_reorder_entry *p
>   return true;
>  }
>  
> -void indicate_packets(struct ieee80211_device *ieee, struct ieee80211_rxb 
> *rxb)
> +static void indicate_packets(struct ieee80211_device *ieee, struct 
> ieee80211_rxb *rxb)
>  {
>   struct net_device_stats *stats = >stats;
>   struct net_device *dev = ieee->dev;

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH V1 6/6] staging: greybus: audio: Enable GB codec, audio module compilation.

2020-05-17 Thread kbuild test robot
Hi Vaibhav,

I love your patch! Perhaps something to improve:

[auto build test WARNING on staging/staging-testing]
[also build test WARNING on v5.7-rc5 next-20200515]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:
https://github.com/0day-ci/linux/commits/Vaibhav-Agarwal/Enable-Greybus-Audio-codec-driver/20200518-012023
base:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git 
cef077e6aa4c7dbe2f23e1201cf705f9540ec467
config: i386-allyesconfig (attached as .config)
reproduce:
# apt-get install sparse
# sparse version: v0.6.1-193-gb8fad4bc-dirty
# save the attached .config to linux build tree
make C=1 ARCH=i386 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'

If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot 


sparse warnings: (new ones prefixed by >>)

>> drivers/staging/greybus/audio_codec.c:691:36: sparse: sparse: incorrect type 
>> in initializer (different base types) @@expected unsigned long long 
>> [usertype] formats @@got restricteunsigned long long [usertype] formats 
>> @@
>> drivers/staging/greybus/audio_codec.c:691:36: sparse:expected unsigned 
>> long long [usertype] formats
>> drivers/staging/greybus/audio_codec.c:691:36: sparse:got restricted 
>> snd_pcm_format_t [usertype]
   drivers/staging/greybus/audio_codec.c:701:36: sparse: sparse: incorrect type 
in initializer (different base types) @@expected unsigned long long 
[usertype] formats @@got restricteunsigned long long [usertype] formats @@
   drivers/staging/greybus/audio_codec.c:701:36: sparse:expected unsigned 
long long [usertype] formats
   drivers/staging/greybus/audio_codec.c:701:36: sparse:got restricted 
snd_pcm_format_t [usertype]
--
>> drivers/staging/greybus/audio_module.c:223:25: sparse: sparse: incorrect 
>> type in assignment (different base types) @@expected restricted __le16 
>> [usertype] data_cport @@got tricted __le16 [usertype] data_cport @@
>> drivers/staging/greybus/audio_module.c:223:25: sparse:expected 
>> restricted __le16 [usertype] data_cport
>> drivers/staging/greybus/audio_module.c:223:25: sparse:got unsigned short 
>> [usertype] intf_cport_id
--
>> drivers/staging/greybus/audio_topology.c:183:24: sparse: sparse: cast to 
>> restricted snd_ctl_elem_type_t
>> drivers/staging/greybus/audio_topology.c:460:40: sparse: sparse: restricted 
>> __le32 degrades to integer
>> drivers/staging/greybus/audio_topology.c:691:41: sparse: sparse: incorrect 
>> type in assignment (different base types) @@expected unsigned int access 
>> @@got restricted __le3unsigned int access @@
>> drivers/staging/greybus/audio_topology.c:691:41: sparse:expected 
>> unsigned int access
>> drivers/staging/greybus/audio_topology.c:691:41: sparse:got restricted 
>> __le32 [usertype] access
>> drivers/staging/greybus/audio_topology.c:678:14: sparse: sparse: restricted 
>> snd_ctl_elem_iface_t degrades to integer
>> drivers/staging/greybus/audio_topology.c:746:44: sparse: sparse: incorrect 
>> type in assignment (different base types) @@expected unsigned int @@
>> got restrunsigned int @@
>> drivers/staging/greybus/audio_topology.c:746:44: sparse:expected 
>> unsigned int
>> drivers/staging/greybus/audio_topology.c:746:44: sparse:got restricted 
>> __le32
   drivers/staging/greybus/audio_topology.c:748:52: sparse: sparse: incorrect 
type in assignment (different base types) @@expected unsigned int @@got 
restrunsigned int @@
   drivers/staging/greybus/audio_topology.c:748:52: sparse:expected 
unsigned int
   drivers/staging/greybus/audio_topology.c:748:52: sparse:got restricted 
__le32
   drivers/staging/greybus/audio_topology.c:803:42: sparse: sparse: restricted 
__le32 degrades to integer
>> drivers/staging/greybus/audio_topology.c:806:50: sparse: sparse: incorrect 
>> type in assignment (different base types) @@expected restricted __le32 
>> @@got icted __le32 @@
>> drivers/staging/greybus/audio_topology.c:806:50: sparse:expected 
>> restricted __le32
>> drivers/staging/greybus/audio_topology.c:806:50: sparse:got unsigned int
   drivers/staging/greybus/audio_topology.c:815:50: sparse: sparse: restricted 
__le32 degrades to integer
   drivers/staging/greybus/audio_topology.c:818:58: sparse: sparse: incorrect 
type in assignment (different base types) @@expected restricted __le32 @@   
 got icted __le32 @@
   drivers/staging/greybus/audio_topology.c:818:58: sparse:expected 
restricted __le32
   drivers/staging/greybus/audio_topology.c:818:58: sparse:got unsigned int
   drivers/staging/greybus/audio_topology.c:890:25: sparse: sparse: incorrect 
type in assignment (different base types) @@expected unsigned int access @@ 
   got 

Re: RTL8723BS driver doesn't work for,me but I can help testing

2020-05-17 Thread Martin Blumenstingl
Hi Tobias,

(adding back the original Cc list since that got lost at some point.
please keep them included)

On Sun, May 17, 2020 at 9:57 PM Tobias Baumann <017623705...@o2online.de> wrote:
>
> hi Martin
>
>
> i know what you mean with many modules from Arduino sensor modules not
> all datasheet are correct
>
> ok i got into uboot env
>
> i could not get GPIOA0 write because of unknowm pin number
GPIOAO_0 should work though (the underscore is important)

> but GPIOX works
>
> now my measurmant show that out high = signal high (3.3V) and out low
> =singnal low (0.0V)
>
> without any instruction the S812 pins show something betwen 0.2V and 0.8v
>
> and that GPIOX_11 (old gpio-123 ; new gpio-402) the one to PIN12
> WLAN-DIS of r8723bs modul
>
> and like you saw on my kernel cat print it is set to low
I have updated the GPIOs polarity of GPIOAO_6 and GPIOX_11 (since both
are showing inverse polarity compared to the Android kernel).
since I don't know if you build mainline yourself or if you use builds
from other people: I attached the updated .dtb so you can use that if
you want to

Please let me know if that fixes wifi for you.


> thanks for you uboot gset instruction thats helps
>
> Am 17.05.2020 um 20:09 schrieb Martin Blumenstingl:
> > Hi Tobias,
> >
> > On Sun, May 17, 2020 at 8:53 AM Tobias Baumann <017623705...@o2online.de> 
> > wrote:
> >> hi Martin
> >>
> >>
> >> yes i mean rtw_antsel=1 or rtw_ansel=2 with cold start
> >>
> >> i got hands on pine64 rtl8723bs pdf file with datasheet i attached it 
> >> there i found the pinout and found a hint that maybe help !!!
> > it *may* help. beware that there are *many* RTL8723BS modules out
> > there, which may or may not follow the same pattern.
> >
> > Realtek only sells the RTL8723BS chip on it's own. But it needs some
> > extra components (crystals, resistors, capacitors, ...)
> > When changing some of these components you need to certify (FCC / CE /
> > some other regulatory) the wifi card again (to ensure it follows the
> > specification and does not interfere with other devices).
> > Thus there are manufacturers (for example FN-LINK) that sell certified
> > RTL8723BS modules.
> >
> > Also one datasheet can describe the signal as "active low".
> > However, if there is a small transistor circuit on the module PCB (or
> > the main SoC PCB) then that can "flip" the signal, meaning: the SoC
> > outputs HIGH but the module gets LOW - or vice versa.
> > Thus we describe the GPIOs from the GPIO controller (in this case:
> > Amlogic SoC) perspective.
> >
> >> GPIOs 0-135:(from 3.10.99 Kernel )
> >>   gpio-3   (gpio_key) in  hi
> >>   gpio-6   (sdio_wifi   ) out hi ->
> > this one is GPIOAO_6 and called "gpio-382" in your 5.7 kernel GPIO dump
> >
> >>   gpio-14  (amlsd   ) in  lo
> >>   gpio-15  (DWC_OTG ) out hi
> >>   gpio-64  (amlsd   ) in  lo
> >>   gpio-122 (sdio_wifi   ) out hi
> > this one is GPIOX_10. I don't know why the vendor kernel requests this as 
> > GPIO
> > because actually it is using the xtal_32k_out mux on the pin controller.
> > I assume this is what you have for pin24 below (32k/RTC clock/WLAN
> > clock), because it's output is 32.768kHz (or rounded: 32kHz)
> >
> >>   gpio-123 (sdio_wifi   ) out hi
> > this one is GPIOX_11 and called "gpio-402" in your 5.7 kernel GPIO dump
> >
> >>   gpio-132 (bt_rfkill   ) out hi -> pin 34 Bt_dis (Bluetooth 
> >> disable)
> > this one is GPIOX_20 and not part of your 5.7 kernel GPIO dump
> > Linux 5.8 will gain RTL8723BS Bluetooth support -> with that the GPIO
> > will show up as well
> >
> > do you know if this is related to the wifi part somehow?
> >
> >>   gpio-133 (sdio_wifi   ) in  hi
> > this one is GPIOX_21 and not part of your 5.7 kernel GPIO dump either.
> > It is the "wifi host wake" and should not be related to your issue.
> > the SDIO wifi card uses it to let the host know that data is available
> > and the host should resume from suspend.
> >
> > [...]
> >> GPIO Kernel 5.7
> >>
> >> gpiochip1: GPIOs 376-390, parent: platform/c8100084.pinctrl, ao-bank:
> >>   gpio-382 (|reset   ) out lo
> >>
> >> gpiochip0: GPIOs 391-511, parent: platform/c1109880.pinctrl, cbus-banks:
> >>   gpio-402 (|reset   ) out lo
> >>   gpio-484 (|snps,reset  ) out hi ACTIVE LOW
> > you can ignore gpio-484 (snps,reset) for the current issue.
> > This is for the Ethernet PHY and has nothing to do with wifi.
> >
> >>   gpio-491 (|cd  ) in  lo ACTIVE LOW
> >>
> >>
> >> i think i do not have a pull down gpio pin i need the pins high state
> > which one do you mean exactly?
> >
> > since you are measuring with a multimeter anyways: can you please find
> > out the pin from the Amlogic SoC which is routed to the WLAN_DIS pin
> > of the WIFI module along with the polarity (high/low)?
> > in Amlogic's vendor u-boot you 

Re: [PATCH] staging: rtl8192u: Merge almost duplicate code

2020-05-17 Thread kbuild test robot
Hi Pascal,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on staging/staging-testing]
[also build test WARNING on v5.7-rc5 next-20200515]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:
https://github.com/0day-ci/linux/commits/Pascal-Terjan/staging-rtl8192u-Merge-almost-duplicate-code/20200518-005912
base:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git 
cef077e6aa4c7dbe2f23e1201cf705f9540ec467
config: i386-allyesconfig (attached as .config)
reproduce:
# apt-get install sparse
# sparse version: v0.6.1-193-gb8fad4bc-dirty
# save the attached .config to linux build tree
make C=1 ARCH=i386 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'

If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot 


sparse warnings: (new ones prefixed by >>)

   /usr/lib/gcc/x86_64-linux-gnu/7/include/stddef.h:417:9: sparse: sparse: 
preprocessor token offsetof redefined
   include/linux/stddef.h:17:9: sparse: this was the original definition
>> drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c:523:6: sparse: sparse: 
>> symbol 'indicate_packets' was not declared. Should it be static?

Please review and possibly fold the followup patch.

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-...@lists.01.org


.config.gz
Description: application/gzip
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[RFC PATCH] staging: rtl8192u: indicate_packets() can be static

2020-05-17 Thread kbuild test robot


Signed-off-by: kbuild test robot 
---
 ieee80211_rx.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c 
b/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c
index 3309f64be4c94..bceff1ba3d7d4 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c
@@ -520,7 +520,7 @@ static bool AddReorderEntry(struct rx_ts_record *pTS, 
struct rx_reorder_entry *p
return true;
 }
 
-void indicate_packets(struct ieee80211_device *ieee, struct ieee80211_rxb *rxb)
+static void indicate_packets(struct ieee80211_device *ieee, struct 
ieee80211_rxb *rxb)
 {
struct net_device_stats *stats = >stats;
struct net_device *dev = ieee->dev;
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH V1 5/6] staging: greybus: audio: Add helper APIs for dynamic audio modules

2020-05-17 Thread Alexandre Belloni
Hi,

On 17/05/2020 22:47:20+0530, Vaibhav Agarwal wrote:
> Greybus Codec driver allows modules to be dynamically added and removed,
> which further requires updating the DAPM configurations as well.
> 
> With current snd_soc architecture, dynamic audio modules is not yet
> supported. This patch provides helper APIs to update DAPM configurations
> in response to modules which are dynamically added or removed. The
> source is primarily based on snd_dapm.c
> 

I really think you should send this patch series to the ASoC
maintainers, especially this patch. The main goal shouldn't be to simply
fix compilation issues but to try to get the driver out of staging else,
the current situation will happen again.

> Signed-off-by: Vaibhav Agarwal 
> ---
>  drivers/staging/greybus/Makefile   |   2 +-
>  drivers/staging/greybus/audio_codec.c  |  13 ++-
>  drivers/staging/greybus/audio_helper.c | 197 
> +
>  drivers/staging/greybus/audio_helper.h |  17 +++
>  4 files changed, 224 insertions(+), 5 deletions(-)
>  create mode 100644 drivers/staging/greybus/audio_helper.c
>  create mode 100644 drivers/staging/greybus/audio_helper.h
> 
> diff --git a/drivers/staging/greybus/Makefile 
> b/drivers/staging/greybus/Makefile
> index 627e44f2a983..3b4b6cabff19 100644
> --- a/drivers/staging/greybus/Makefile
> +++ b/drivers/staging/greybus/Makefile
> @@ -28,7 +28,7 @@ obj-$(CONFIG_GREYBUS_VIBRATOR)  += gb-vibrator.o
>  
>  # Greybus Audio is a bunch of modules
>  gb-audio-module-y:= audio_module.o audio_topology.o
> -gb-audio-codec-y := audio_codec.o
> +gb-audio-codec-y := audio_codec.o audio_helper.o
>  gb-audio-gb-y:= audio_gb.o
>  gb-audio-apbridgea-y := audio_apbridgea.o
>  gb-audio-manager-y   := audio_manager.o audio_manager_module.o
> diff --git a/drivers/staging/greybus/audio_codec.c 
> b/drivers/staging/greybus/audio_codec.c
> index bbd072acda5c..866b3342515f 100644
> --- a/drivers/staging/greybus/audio_codec.c
> +++ b/drivers/staging/greybus/audio_codec.c
> @@ -14,6 +14,7 @@
>  #include "audio_codec.h"
>  #include "audio_apbridgea.h"
>  #include "audio_manager.h"
> +#include "audio_helper.h"
>  
>  static struct gbaudio_codec_info *gbcodec;
>  
> @@ -874,7 +875,7 @@ int gbaudio_register_module(struct gbaudio_module_info 
> *module)
>  
>   /* card already instantiated, create widgets here only */
>   if (component->card->instantiated) {
> - snd_soc_dapm_link_component_dai_widgets(component->card,
> + gbaudio_dapm_link_component_dai_widgets(component->card,
>   >dapm);
>  #ifdef CONFIG_SND_JACK
>   /*
> @@ -1004,19 +1005,23 @@ void gbaudio_unregister_module(struct 
> gbaudio_module_info *module)
>   if (module->dapm_routes) {
>   dev_dbg(component->dev, "Removing %d routes\n",
>   module->num_dapm_routes);
> + /* verify routes with controls are removed */
>   snd_soc_dapm_del_routes(>dapm, module->dapm_routes,
>   module->num_dapm_routes);
>   }
>   if (module->controls) {
>   dev_dbg(component->dev, "Removing %d controls\n",
>   module->num_controls);
> - snd_soc_remove_codec_controls(component, module->controls,
> -   module->num_controls);
> + /* release control semaphore */
> + up_write(>controls_rwsem);
> + gbaudio_remove_component_controls(component, module->controls,
> +   module->num_controls);
> + down_write(>controls_rwsem);
>   }
>   if (module->dapm_widgets) {
>   dev_dbg(component->dev, "Removing %d widgets\n",
>   module->num_dapm_widgets);
> - snd_soc_dapm_free_controls(>dapm,
> + gbaudio_dapm_free_controls(>dapm,
>  module->dapm_widgets,
>  module->num_dapm_widgets);
>   }
> diff --git a/drivers/staging/greybus/audio_helper.c 
> b/drivers/staging/greybus/audio_helper.c
> new file mode 100644
> index ..e2f113a811ee
> --- /dev/null
> +++ b/drivers/staging/greybus/audio_helper.c
> @@ -0,0 +1,197 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + * Greybus Audio Sound SoC helper APIs
> + */
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +#define gbaudio_dapm_for_each_direction(dir) \
> + for ((dir) = SND_SOC_DAPM_DIR_IN; (dir) <= SND_SOC_DAPM_DIR_OUT; \
> + (dir)++)
> +
> +static void gbaudio_dapm_link_dai_widget(struct snd_soc_dapm_widget *dai_w,
> +  struct snd_soc_card *card)
> +{
> + struct snd_soc_dapm_widget *w;
> + struct snd_soc_dapm_widget *src, *sink;
> + struct snd_soc_dai *dai = dai_w->priv;
> +
> + /* ...find all widgets 

[PATCH V1 6/6] staging: greybus: audio: Enable GB codec, audio module compilation.

2020-05-17 Thread Vaibhav Agarwal
Currently, GB codec and audio module is conditionally compiled based on
GREYBUS_AUDIO_MSM8994. However, audio module is not dependent on MSM8994
platform and can be used generically with any platform that follows
GB Audio class specification.

Also, GB codec driver corresponds to dummy codec represented by I2S port
available on Toshiba AP Bridge. Added config option for the same in
kconfig file and accordingly updated Makefile.

Signed-off-by: Vaibhav Agarwal 
---
 drivers/staging/greybus/Kconfig  | 14 +-
 drivers/staging/greybus/Makefile |  4 ++--
 2 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/greybus/Kconfig b/drivers/staging/greybus/Kconfig
index d4777f5a8b90..cbcfcbba239b 100644
--- a/drivers/staging/greybus/Kconfig
+++ b/drivers/staging/greybus/Kconfig
@@ -3,7 +3,7 @@ if GREYBUS
 
 config GREYBUS_AUDIO
tristate "Greybus Audio Class driver"
-   depends on SOUND
+   depends on SOUND && SND_SOC
---help---
  Select this option if you have a device that follows the
  Greybus Audio Class specification.
@@ -11,6 +11,18 @@ config GREYBUS_AUDIO
  To compile this code as a module, chose M here: the module
  will be called gb-audio.ko
 
+config GREYBUS_AUDIO_APB_CODEC
+   tristate "Greybus APBridge Audio codec driver"
+   depends on SND_SOC && GREYBUS_AUDIO
+   help
+ Select this option if you have a Toshiba APB device that has I2S
+  ports and acts as a Greybus "Dummy codec". This device is a
+  bridge from an APB-I2S port to a Unipro network.
+
+ To compile this code as a module, chose M here: the module
+ will be called gb-audio-codec.ko
+
+
 config GREYBUS_BOOTROM
tristate "Greybus Bootrom Class driver"
---help---
diff --git a/drivers/staging/greybus/Makefile b/drivers/staging/greybus/Makefile
index 3b4b6cabff19..7c5e89622334 100644
--- a/drivers/staging/greybus/Makefile
+++ b/drivers/staging/greybus/Makefile
@@ -40,8 +40,8 @@ gb-audio-manager-y:= audio_manager.o 
audio_manager_module.o
 #ccflags-y += -DGB_AUDIO_MANAGER_SYSFS
 #endif
 
-obj-$(CONFIG_GREYBUS_AUDIO_MSM8994)+= gb-audio-codec.o
-obj-$(CONFIG_GREYBUS_AUDIO_MSM8994)+= gb-audio-module.o
+obj-$(CONFIG_GREYBUS_AUDIO_APB_CODEC)  += gb-audio-codec.o
+obj-$(CONFIG_GREYBUS_AUDIO_APB_CODEC)  += gb-audio-module.o
 obj-$(CONFIG_GREYBUS_AUDIO)+= gb-audio-gb.o
 obj-$(CONFIG_GREYBUS_AUDIO)+= gb-audio-apbridgea.o
 obj-$(CONFIG_GREYBUS_AUDIO)+= gb-audio-manager.o
-- 
2.7.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH V1 5/6] staging: greybus: audio: Add helper APIs for dynamic audio modules

2020-05-17 Thread Vaibhav Agarwal
Greybus Codec driver allows modules to be dynamically added and removed,
which further requires updating the DAPM configurations as well.

With current snd_soc architecture, dynamic audio modules is not yet
supported. This patch provides helper APIs to update DAPM configurations
in response to modules which are dynamically added or removed. The
source is primarily based on snd_dapm.c

Signed-off-by: Vaibhav Agarwal 
---
 drivers/staging/greybus/Makefile   |   2 +-
 drivers/staging/greybus/audio_codec.c  |  13 ++-
 drivers/staging/greybus/audio_helper.c | 197 +
 drivers/staging/greybus/audio_helper.h |  17 +++
 4 files changed, 224 insertions(+), 5 deletions(-)
 create mode 100644 drivers/staging/greybus/audio_helper.c
 create mode 100644 drivers/staging/greybus/audio_helper.h

diff --git a/drivers/staging/greybus/Makefile b/drivers/staging/greybus/Makefile
index 627e44f2a983..3b4b6cabff19 100644
--- a/drivers/staging/greybus/Makefile
+++ b/drivers/staging/greybus/Makefile
@@ -28,7 +28,7 @@ obj-$(CONFIG_GREYBUS_VIBRATOR)+= gb-vibrator.o
 
 # Greybus Audio is a bunch of modules
 gb-audio-module-y  := audio_module.o audio_topology.o
-gb-audio-codec-y   := audio_codec.o
+gb-audio-codec-y   := audio_codec.o audio_helper.o
 gb-audio-gb-y  := audio_gb.o
 gb-audio-apbridgea-y   := audio_apbridgea.o
 gb-audio-manager-y := audio_manager.o audio_manager_module.o
diff --git a/drivers/staging/greybus/audio_codec.c 
b/drivers/staging/greybus/audio_codec.c
index bbd072acda5c..866b3342515f 100644
--- a/drivers/staging/greybus/audio_codec.c
+++ b/drivers/staging/greybus/audio_codec.c
@@ -14,6 +14,7 @@
 #include "audio_codec.h"
 #include "audio_apbridgea.h"
 #include "audio_manager.h"
+#include "audio_helper.h"
 
 static struct gbaudio_codec_info *gbcodec;
 
@@ -874,7 +875,7 @@ int gbaudio_register_module(struct gbaudio_module_info 
*module)
 
/* card already instantiated, create widgets here only */
if (component->card->instantiated) {
-   snd_soc_dapm_link_component_dai_widgets(component->card,
+   gbaudio_dapm_link_component_dai_widgets(component->card,
>dapm);
 #ifdef CONFIG_SND_JACK
/*
@@ -1004,19 +1005,23 @@ void gbaudio_unregister_module(struct 
gbaudio_module_info *module)
if (module->dapm_routes) {
dev_dbg(component->dev, "Removing %d routes\n",
module->num_dapm_routes);
+   /* verify routes with controls are removed */
snd_soc_dapm_del_routes(>dapm, module->dapm_routes,
module->num_dapm_routes);
}
if (module->controls) {
dev_dbg(component->dev, "Removing %d controls\n",
module->num_controls);
-   snd_soc_remove_codec_controls(component, module->controls,
- module->num_controls);
+   /* release control semaphore */
+   up_write(>controls_rwsem);
+   gbaudio_remove_component_controls(component, module->controls,
+ module->num_controls);
+   down_write(>controls_rwsem);
}
if (module->dapm_widgets) {
dev_dbg(component->dev, "Removing %d widgets\n",
module->num_dapm_widgets);
-   snd_soc_dapm_free_controls(>dapm,
+   gbaudio_dapm_free_controls(>dapm,
   module->dapm_widgets,
   module->num_dapm_widgets);
}
diff --git a/drivers/staging/greybus/audio_helper.c 
b/drivers/staging/greybus/audio_helper.c
new file mode 100644
index ..e2f113a811ee
--- /dev/null
+++ b/drivers/staging/greybus/audio_helper.c
@@ -0,0 +1,197 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Greybus Audio Sound SoC helper APIs
+ */
+
+#include 
+#include 
+#include 
+#include 
+
+#define gbaudio_dapm_for_each_direction(dir) \
+   for ((dir) = SND_SOC_DAPM_DIR_IN; (dir) <= SND_SOC_DAPM_DIR_OUT; \
+   (dir)++)
+
+static void gbaudio_dapm_link_dai_widget(struct snd_soc_dapm_widget *dai_w,
+struct snd_soc_card *card)
+{
+   struct snd_soc_dapm_widget *w;
+   struct snd_soc_dapm_widget *src, *sink;
+   struct snd_soc_dai *dai = dai_w->priv;
+
+   /* ...find all widgets with the same stream and link them */
+   list_for_each_entry(w, >widgets, list) {
+   if (w->dapm != dai_w->dapm)
+   continue;
+
+   switch (w->id) {
+   case snd_soc_dapm_dai_in:
+   case snd_soc_dapm_dai_out:
+   continue;
+   default:
+   break;
+   }
+
+   if (!w->sname || !strstr(w->sname, 

[PATCH V1 1/6] staging: greybus: audio: Update snd_jack FW usage as per new APIs

2020-05-17 Thread Vaibhav Agarwal
snd_soc_jack APIs are modified in recent kernel versions. This patch
updates the codec driver to resolve the compilation errors related to
jack framework.

Signed-off-by: Vaibhav Agarwal 
---
 drivers/staging/greybus/audio_codec.c | 59 ---
 1 file changed, 47 insertions(+), 12 deletions(-)

diff --git a/drivers/staging/greybus/audio_codec.c 
b/drivers/staging/greybus/audio_codec.c
index 08746c85dea6..ebf8484f0ae7 100644
--- a/drivers/staging/greybus/audio_codec.c
+++ b/drivers/staging/greybus/audio_codec.c
@@ -709,17 +709,29 @@ static struct snd_soc_dai_driver gbaudio_dai[] = {
 };
 
 static int gbaudio_init_jack(struct gbaudio_module_info *module,
-struct snd_soc_codec *codec)
+struct snd_soc_card *card)
 {
int ret;
 
+   struct snd_soc_jack *jack;
+   struct snd_soc_jack_pin *headset, *button;
+
if (!module->jack_mask)
return 0;
 
snprintf(module->jack_name, NAME_SIZE, "GB %d Headset Jack",
 module->dev_id);
-   ret = snd_soc_jack_new(codec, module->jack_name, module->jack_mask,
-  >headset_jack);
+
+   headset = devm_kzalloc(module->dev, sizeof(*headset), GFP_KERNEL);
+   if (!headset)
+   return -ENOMEM;
+
+   headset->pin = module->jack_name;
+   headset->mask = module->jack_mask;
+   jack = >headset_jack;
+
+   ret = snd_soc_card_jack_new(card, module->jack_name, module->jack_mask,
+   jack, headset, 1);
if (ret) {
dev_err(module->dev, "Failed to create new jack\n");
return ret;
@@ -730,11 +742,21 @@ static int gbaudio_init_jack(struct gbaudio_module_info 
*module,
 
snprintf(module->button_name, NAME_SIZE, "GB %d Button Jack",
 module->dev_id);
-   ret = snd_soc_jack_new(codec, module->button_name, module->button_mask,
-  >button_jack);
+   button = devm_kzalloc(module->dev, sizeof(*headset), GFP_KERNEL);
+   if (!button) {
+   ret = -ENOMEM;
+   goto free_headset;
+   }
+
+   button->pin = module->button_name;
+   button->mask = module->button_mask;
+   jack = >button_jack;
+
+   ret = snd_soc_card_jack_new(card, module->button_name,
+   module->button_mask, jack, button, 1);
if (ret) {
dev_err(module->dev, "Failed to create button jack\n");
-   return ret;
+   goto free_headset;
}
 
/*
@@ -750,7 +772,7 @@ static int gbaudio_init_jack(struct gbaudio_module_info 
*module,
   KEY_MEDIA);
if (ret) {
dev_err(module->dev, "Failed to set BTN_0\n");
-   return ret;
+   goto free_button;
}
}
 
@@ -759,7 +781,7 @@ static int gbaudio_init_jack(struct gbaudio_module_info 
*module,
   KEY_VOICECOMMAND);
if (ret) {
dev_err(module->dev, "Failed to set BTN_1\n");
-   return ret;
+   goto free_button;
}
}
 
@@ -768,7 +790,7 @@ static int gbaudio_init_jack(struct gbaudio_module_info 
*module,
   KEY_VOLUMEUP);
if (ret) {
dev_err(module->dev, "Failed to set BTN_2\n");
-   return ret;
+   goto free_button;
}
}
 
@@ -777,7 +799,7 @@ static int gbaudio_init_jack(struct gbaudio_module_info 
*module,
   KEY_VOLUMEDOWN);
if (ret) {
dev_err(module->dev, "Failed to set BTN_0\n");
-   return ret;
+   goto free_button;
}
}
 
@@ -788,6 +810,18 @@ static int gbaudio_init_jack(struct gbaudio_module_info 
*module,
*/
 
return 0;
+
+free_button:
+   jack = >button_jack;
+   snd_device_free(card->snd_card, jack->jack);
+   list_del(>list);
+
+free_headset:
+   jack = >headset_jack;
+   snd_device_free(card->snd_card, jack->jack);
+   list_del(>list);
+
+   return ret;
 }
 
 int gbaudio_register_module(struct gbaudio_module_info *module)
@@ -815,7 +849,7 @@ int gbaudio_register_module(struct gbaudio_module_info 
*module)
return -EINVAL;
}
 
-   ret = gbaudio_init_jack(module, codec);
+   ret = gbaudio_init_jack(module, component->card);
if (ret) {
up_write(>controls_rwsem);
return ret;
@@ -942,7 +976,8 @@ void gbaudio_unregister_module(struct gbaudio_module_info 
*module)
 
 #ifdef CONFIG_SND_JACK
/* free jack devices for this module from codec->jack_list */
-   

[PATCH V1 4/6] staging: greybus: audio: Resolve compilation error in topology parser

2020-05-17 Thread Vaibhav Agarwal
Fix compilation errors for GB Audio topology parser code with recent
kernel versions.

Signed-off-by: Vaibhav Agarwal 
---
 drivers/staging/greybus/audio_topology.c | 130 +++
 1 file changed, 61 insertions(+), 69 deletions(-)

diff --git a/drivers/staging/greybus/audio_topology.c 
b/drivers/staging/greybus/audio_topology.c
index 4ac30accf226..7d5e87341a5c 100644
--- a/drivers/staging/greybus/audio_topology.c
+++ b/drivers/staging/greybus/audio_topology.c
@@ -5,8 +5,8 @@
  * Copyright 2015-2016 Linaro Ltd.
  */
 
+#include 
 #include "audio_codec.h"
-#include "greybus_protocols.h"
 
 #define GBAUDIO_INVALID_ID 0xFF
 
@@ -165,15 +165,15 @@ static int gbcodec_mixer_ctl_info(struct snd_kcontrol 
*kcontrol,
struct gbaudio_ctl_pvt *data;
struct gb_audio_ctl_elem_info *info;
struct gbaudio_module_info *module;
-   struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
-   struct gbaudio_codec_info *gbcodec = snd_soc_codec_get_drvdata(codec);
+   struct snd_soc_component *comp = snd_soc_kcontrol_component(kcontrol);
+   struct gbaudio_codec_info *gb = snd_soc_component_get_drvdata(comp);
 
-   dev_dbg(codec->dev, "Entered %s:%s\n", __func__, kcontrol->id.name);
+   dev_dbg(comp->dev, "Entered %s:%s\n", __func__, kcontrol->id.name);
data = (struct gbaudio_ctl_pvt *)kcontrol->private_value;
info = (struct gb_audio_ctl_elem_info *)data->info;
 
if (!info) {
-   dev_err(codec->dev, "NULL info for %s\n", uinfo->id.name);
+   dev_err(comp->dev, "NULL info for %s\n", uinfo->id.name);
return -EINVAL;
}
 
@@ -193,7 +193,7 @@ static int gbcodec_mixer_ctl_info(struct snd_kcontrol 
*kcontrol,
uinfo->value.enumerated.items = max;
if (uinfo->value.enumerated.item > max - 1)
uinfo->value.enumerated.item = max - 1;
-   module = find_gb_module(gbcodec, kcontrol->id.name);
+   module = find_gb_module(gb, kcontrol->id.name);
if (!module)
return -EINVAL;
name = gbaudio_map_controlid(module, data->ctl_id,
@@ -201,7 +201,7 @@ static int gbcodec_mixer_ctl_info(struct snd_kcontrol 
*kcontrol,
strlcpy(uinfo->value.enumerated.name, name, NAME_SIZE);
break;
default:
-   dev_err(codec->dev, "Invalid type: %d for %s:kcontrol\n",
+   dev_err(comp->dev, "Invalid type: %d for %s:kcontrol\n",
info->type, kcontrol->id.name);
break;
}
@@ -216,11 +216,11 @@ static int gbcodec_mixer_ctl_get(struct snd_kcontrol 
*kcontrol,
struct gbaudio_ctl_pvt *data;
struct gb_audio_ctl_elem_value gbvalue;
struct gbaudio_module_info *module;
-   struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
-   struct gbaudio_codec_info *gb = snd_soc_codec_get_drvdata(codec);
+   struct snd_soc_component *comp = snd_soc_kcontrol_component(kcontrol);
+   struct gbaudio_codec_info *gb = snd_soc_component_get_drvdata(comp);
struct gb_bundle *bundle;
 
-   dev_dbg(codec->dev, "Entered %s:%s\n", __func__, kcontrol->id.name);
+   dev_dbg(comp->dev, "Entered %s:%s\n", __func__, kcontrol->id.name);
module = find_gb_module(gb, kcontrol->id.name);
if (!module)
return -EINVAL;
@@ -239,7 +239,7 @@ static int gbcodec_mixer_ctl_get(struct snd_kcontrol 
*kcontrol,
gb_pm_runtime_put_autosuspend(bundle);
 
if (ret) {
-   dev_err_ratelimited(codec->dev, "%d:Error in %s for %s\n", ret,
+   dev_err_ratelimited(comp->dev, "%d:Error in %s for %s\n", ret,
__func__, kcontrol->id.name);
return ret;
}
@@ -262,7 +262,7 @@ static int gbcodec_mixer_ctl_get(struct snd_kcontrol 
*kcontrol,
le32_to_cpu(gbvalue.value.enumerated_item[1]);
break;
default:
-   dev_err(codec->dev, "Invalid type: %d for %s:kcontrol\n",
+   dev_err(comp->dev, "Invalid type: %d for %s:kcontrol\n",
info->type, kcontrol->id.name);
ret = -EINVAL;
break;
@@ -278,11 +278,11 @@ static int gbcodec_mixer_ctl_put(struct snd_kcontrol 
*kcontrol,
struct gbaudio_ctl_pvt *data;
struct gb_audio_ctl_elem_value gbvalue;
struct gbaudio_module_info *module;
-   struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
-   struct gbaudio_codec_info *gb = snd_soc_codec_get_drvdata(codec);
+   struct snd_soc_component *comp = snd_soc_kcontrol_component(kcontrol);
+   struct gbaudio_codec_info *gb = snd_soc_component_get_drvdata(comp);
struct gb_bundle *bundle;
 
-   dev_dbg(codec->dev, "Entered %s:%s\n", __func__, kcontrol->id.name);
+   dev_dbg(comp->dev, "Entered %s:%s\n", 

[PATCH V1 2/6] staging: greybus: audio: Maintain jack list within GB Audio module

2020-05-17 Thread Vaibhav Agarwal
As per the current implementation for GB codec driver, a jack list is
maintained for each module. And it expects the list to be populated by
the snd_soc_jack structure which would require modifications in
mainstream code.

However, this is not a necessary requirement and the list can be easily
maintained within gbaudio_module_info as well. This patch provides the
relevant changes for the same.

Signed-off-by: Vaibhav Agarwal 
---
 drivers/staging/greybus/audio_codec.c  | 76 ++
 drivers/staging/greybus/audio_codec.h  | 10 -
 drivers/staging/greybus/audio_module.c | 20 +
 3 files changed, 60 insertions(+), 46 deletions(-)

diff --git a/drivers/staging/greybus/audio_codec.c 
b/drivers/staging/greybus/audio_codec.c
index ebf8484f0ae7..a2ee587e5a79 100644
--- a/drivers/staging/greybus/audio_codec.c
+++ b/drivers/staging/greybus/audio_codec.c
@@ -712,7 +712,7 @@ static int gbaudio_init_jack(struct gbaudio_module_info 
*module,
 struct snd_soc_card *card)
 {
int ret;
-
+   struct gbaudio_jack *gba_jack, *n;
struct snd_soc_jack *jack;
struct snd_soc_jack_pin *headset, *button;
 
@@ -728,7 +728,8 @@ static int gbaudio_init_jack(struct gbaudio_module_info 
*module,
 
headset->pin = module->jack_name;
headset->mask = module->jack_mask;
-   jack = >headset_jack;
+   gba_jack = >headset;
+   jack = _jack->jack;
 
ret = snd_soc_card_jack_new(card, module->jack_name, module->jack_mask,
jack, headset, 1);
@@ -737,6 +738,9 @@ static int gbaudio_init_jack(struct gbaudio_module_info 
*module,
return ret;
}
 
+   /* Add to module's jack list */
+   list_add(_jack->list, >jack_list);
+
if (!module->button_mask)
return 0;
 
@@ -745,20 +749,24 @@ static int gbaudio_init_jack(struct gbaudio_module_info 
*module,
button = devm_kzalloc(module->dev, sizeof(*headset), GFP_KERNEL);
if (!button) {
ret = -ENOMEM;
-   goto free_headset;
+   goto free_jack;
}
 
button->pin = module->button_name;
button->mask = module->button_mask;
-   jack = >button_jack;
+   gba_jack = >button;
+   jack = _jack->jack;
 
ret = snd_soc_card_jack_new(card, module->button_name,
module->button_mask, jack, button, 1);
if (ret) {
dev_err(module->dev, "Failed to create button jack\n");
-   goto free_headset;
+   goto free_jack;
}
 
+   /* Add to module's jack list */
+   list_add(_jack->list, >jack_list);
+
/*
 * Currently, max 4 buttons are supported with following key mapping
 * BTN_0 = KEY_MEDIA
@@ -768,58 +776,55 @@ static int gbaudio_init_jack(struct gbaudio_module_info 
*module,
 */
 
if (module->button_mask & SND_JACK_BTN_0) {
-   ret = snd_jack_set_key(module->button_jack.jack, SND_JACK_BTN_0,
+   ret = snd_jack_set_key(jack->jack, SND_JACK_BTN_0,
   KEY_MEDIA);
if (ret) {
dev_err(module->dev, "Failed to set BTN_0\n");
-   goto free_button;
+   goto free_jack;
}
}
 
if (module->button_mask & SND_JACK_BTN_1) {
-   ret = snd_jack_set_key(module->button_jack.jack, SND_JACK_BTN_1,
+   ret = snd_jack_set_key(jack->jack, SND_JACK_BTN_1,
   KEY_VOICECOMMAND);
if (ret) {
dev_err(module->dev, "Failed to set BTN_1\n");
-   goto free_button;
+   goto free_jack;
}
}
 
if (module->button_mask & SND_JACK_BTN_2) {
-   ret = snd_jack_set_key(module->button_jack.jack, SND_JACK_BTN_2,
+   ret = snd_jack_set_key(jack->jack, SND_JACK_BTN_2,
   KEY_VOLUMEUP);
if (ret) {
dev_err(module->dev, "Failed to set BTN_2\n");
-   goto free_button;
+   goto free_jack;
}
}
 
if (module->button_mask & SND_JACK_BTN_3) {
-   ret = snd_jack_set_key(module->button_jack.jack, SND_JACK_BTN_3,
+   ret = snd_jack_set_key(jack->jack, SND_JACK_BTN_3,
   KEY_VOLUMEDOWN);
if (ret) {
dev_err(module->dev, "Failed to set BTN_0\n");
-   goto free_button;
+   goto free_jack;
}
}
 
/* FIXME
 * verify if this is really required
set_bit(INPUT_PROP_NO_DUMMY_RELEASE,
-   module->button_jack.jack->input_dev->propbit);
+   

[PATCH V1 0/6] Enable Greybus Audio codec driver

2020-05-17 Thread Vaibhav Agarwal
The existing GB Audio codec driver is dependent on MSM8994 Audio driver.
During the development stage, this depdency was configured due to
various changes involved in MSM Audio driver to enable addtional codec
card and some of the changes proposed in mainline ASoC framework.
However, these are not the real dependencies and some of them can be
easily removed.

The folowing patch series includes the changes to resolve unnecessary
depedencies and make the codec driver functional with the latest kernel.

Patch 1,2: Incudes jack framework related changes.
Patch 3,4,5: Resolves compilation error observed with the latest kernel and
also provides helper APIs required to allow dynamic addition/removal of
modules.
Patch 6: Finally provides config options and related Makefile changes to
enable GB Codec driver.

Thanks to Alexandre for raising the headsup [1] and motivating me to provide
the necessary changes.

[1] 
https://lore.kernel.org/lkml/20200507212912.599433-1-alexandre.bell...@bootlin.com/

Vaibhav Agarwal (6):
  staging: greybus: audio: Update snd_jack FW usage as per new APIs
  staging: greybus: audio: Maintain jack list within GB Audio module
  staging: greybus: audio: Resolve compilation errors for GB codec
module
  staging: greybus: audio: Resolve compilation error in topology parser
  staging: greybus: audio: Add helper APIs for dynamic audio modules
  staging: greybus: audio: Enable GB codec, audio module compilation.

 drivers/staging/greybus/Kconfig  |  14 ++-
 drivers/staging/greybus/Makefile |   6 +-
 drivers/staging/greybus/audio_codec.c| 187 ++---
 drivers/staging/greybus/audio_codec.h|  12 +-
 drivers/staging/greybus/audio_helper.c   | 197 +++
 drivers/staging/greybus/audio_helper.h   |  17 +++
 drivers/staging/greybus/audio_module.c   |  20 ++--
 drivers/staging/greybus/audio_topology.c | 130 ++--
 8 files changed, 427 insertions(+), 156 deletions(-)
 create mode 100644 drivers/staging/greybus/audio_helper.c
 create mode 100644 drivers/staging/greybus/audio_helper.h

-- 
2.7.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH V1 3/6] staging: greybus: audio: Resolve compilation errors for GB codec module

2020-05-17 Thread Vaibhav Agarwal
Due to dependencies on ASoC framework changes, GB dummy codec module
compilation is currently disabled. This patch updates codec driver as
per the latest ASoC APIs.

Signed-off-by: Vaibhav Agarwal 
---
 drivers/staging/greybus/audio_codec.c | 87 +--
 drivers/staging/greybus/audio_codec.h |  2 +-
 2 files changed, 44 insertions(+), 45 deletions(-)

diff --git a/drivers/staging/greybus/audio_codec.c 
b/drivers/staging/greybus/audio_codec.c
index a2ee587e5a79..bbd072acda5c 100644
--- a/drivers/staging/greybus/audio_codec.c
+++ b/drivers/staging/greybus/audio_codec.c
@@ -832,7 +832,7 @@ static int gbaudio_init_jack(struct gbaudio_module_info 
*module,
 int gbaudio_register_module(struct gbaudio_module_info *module)
 {
int ret;
-   struct snd_soc_codec *codec;
+   struct snd_soc_component *component;
struct snd_card *card;
struct gbaudio_jack *gba_jack = NULL;
struct snd_soc_jack *jack = NULL;
@@ -842,8 +842,8 @@ int gbaudio_register_module(struct gbaudio_module_info 
*module)
return -EAGAIN;
}
 
-   codec = gbcodec->codec;
-   card = codec->card->snd_card;
+   component = gbcodec->component;
+   card = component->card->snd_card;
 
down_write(>controls_rwsem);
 
@@ -862,19 +862,20 @@ int gbaudio_register_module(struct gbaudio_module_info 
*module)
}
 
if (module->dapm_widgets)
-   snd_soc_dapm_new_controls(>dapm, module->dapm_widgets,
+   snd_soc_dapm_new_controls(>dapm,
+ module->dapm_widgets,
  module->num_dapm_widgets);
if (module->controls)
-   snd_soc_add_codec_controls(codec, module->controls,
-  module->num_controls);
+   snd_soc_add_component_controls(component, module->controls,
+  module->num_controls);
if (module->dapm_routes)
-   snd_soc_dapm_add_routes(>dapm, module->dapm_routes,
+   snd_soc_dapm_add_routes(>dapm, module->dapm_routes,
module->num_dapm_routes);
 
/* card already instantiated, create widgets here only */
-   if (codec->card->instantiated) {
-   snd_soc_dapm_link_component_dai_widgets(codec->card,
-   >dapm);
+   if (component->card->instantiated) {
+   snd_soc_dapm_link_component_dai_widgets(component->card,
+   >dapm);
 #ifdef CONFIG_SND_JACK
/*
 * register jack devices for this module
@@ -882,7 +883,7 @@ int gbaudio_register_module(struct gbaudio_module_info 
*module)
 */
list_for_each_entry(gba_jack, >jack_list, list) {
jack = _jack->jack;
-   snd_device_register(codec->card->snd_card,
+   snd_device_register(component->card->snd_card,
jack->jack);
}
 #endif
@@ -892,9 +893,9 @@ int gbaudio_register_module(struct gbaudio_module_info 
*module)
list_add(>list, >module_list);
mutex_unlock(>lock);
 
-   if (codec->card->instantiated)
-   ret = snd_soc_dapm_new_widgets(>dapm);
-   dev_dbg(codec->dev, "Registered %s module\n", module->name);
+   if (component->card->instantiated)
+   ret = snd_soc_dapm_new_widgets(component->card);
+   dev_dbg(component->dev, "Registered %s module\n", module->name);
 
up_write(>controls_rwsem);
return ret;
@@ -965,19 +966,19 @@ static void gbaudio_codec_cleanup(struct 
gbaudio_module_info *module)
 
 void gbaudio_unregister_module(struct gbaudio_module_info *module)
 {
-   struct snd_soc_codec *codec = gbcodec->codec;
-   struct snd_card *card = codec->card->snd_card;
+   struct snd_soc_component *component = gbcodec->component;
+   struct snd_card *card = component->card->snd_card;
struct gbaudio_jack *gba_jack, *n;
struct snd_soc_jack *jack;
int mask;
 
-   dev_dbg(codec->dev, "Unregister %s module\n", module->name);
+   dev_dbg(component->dev, "Unregister %s module\n", module->name);
 
down_write(>controls_rwsem);
mutex_lock(>lock);
gbaudio_codec_cleanup(module);
list_del(>list);
-   dev_dbg(codec->dev, "Process Unregister %s module\n", module->name);
+   dev_dbg(component->dev, "Process Unregister %s module\n", module->name);
mutex_unlock(>lock);
 
 #ifdef CONFIG_SND_JACK
@@ -994,99 +995,97 @@ void gbaudio_unregister_module(struct gbaudio_module_info 
*module)
dev_dbg(module->dev, "Report %s removal\n",
jack->jack->id);
snd_soc_jack_report(jack, 0, mask);
- 

Re: [PATCH] media: ipu3: add a module to probe sensors via ACPI

2020-05-17 Thread Sakari Ailus
Hi Mauro,

Thanks for the patch.

On Sat, May 16, 2020 at 12:43:39PM +0200, Mauro Carvalho Chehab wrote:
> On devices without ACPI, or which ACPI is not prepared to
> export sensor data via DT, we need a different probing
> method.
> 
> This little driver adds initial support to probe the
> sensors found on a Dell Latitude 7285.
> 
> For now, it just detects the hardware and use request_module()
> to load a sensor driver.
> 
> In the specific case of this device, the ACPI DTST dable
> describes 2 camera sensors for this module, but the
> current upstream doesn't have yet drivers for such
> sensors. So, this patch just detects the PMIC used on
> this device and tries to load a sensor.
> 
> Once the sensor gets added, some additional code will
> be needed to pass via platform_data other details, like
> callbacks for PMIC's command to turn the sensor on/off
> and other sensor-specific settings.
> 
> The idea of this patch was inspired on how the sensors
> are probed by the staging atomisp driver.
> 
> The current result of this driver with the Dell
> Latitude 7285 is:
> 
>   ipu3_acpi i2c-INT3477:00: ipu3_acpi_probe: ACPI detected it on bus 
> ID=LNK1, HID=INT3477
>   ipu3_acpi i2c-INT3477:00: Found DMI entry for 'Latitude 7285' with 
> sensor INT3477
>   ipu3_acpi i2c-INT3477:00: Loading sensor module ov8858
>   ipu3_acpi i2c-OVTI9234:00: ipu3_acpi_probe: ACPI detected it on bus 
> ID=LNK2, HID=OVTI9234
>   ipu3_acpi i2c-OVTI9234:00: Found DMI entry for 'Latitude 7285' with 
> sensor OVTI9234
>   ipu3_acpi i2c-OVTI9234:00: Loading sensor module ov9234
> 
> Signed-off-by: Mauro Carvalho Chehab 

...

> +/*
> + * Should list known sensor devices found at DSDT table as "CAM0", "CAM1", 
> ...
> + *
> + * The table below is probably incomplete. It came from the DSDT table found
> + * at a Dell Latitude 7285 (Method HCID).
> + */
> +static const struct acpi_device_id ipu3_acpi_acpi_match[] = {
> + {"INT3471"},
> + {"INT33BE"},
> + {"INT3476"},
> + {"INT3477"},
> + {"INT3474"},
> + {"INT3473"},
> + {"INT3475"},
> + {"INT3478"},
> + {"INT3479"},
> + {"INT347A"},
> + {"INT347B"},
> + {"OVTI9234"},
> + {"OVTI9734"},
> + {"OVTI8856"},
> + {"OVTIF860"},
> + {},
> +};
> +MODULE_DEVICE_TABLE(acpi, ipu3_acpi_acpi_match);

Instead of creating a new way to probe drivers on ACPI systems, please add
the appropriate ACPI device IDs to the respective drivers. E.g.
drivers/media/i2c/imx319.c implements this.

-- 
Kind regards,

Sakari Ailus
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Hello Friend 16/05/2020

2020-05-17 Thread Hello
Good day,

My name is Reem E. Hashimy, the Emirates Minister of State and Managing 
Director of the United Arab Emirates (Dubai) World Expo 2020 Committee.
 
I am writing you to manage my funds I received as financial gratification from 
various foreign companies I assisted to receive participation slot in the 
incoming Dubai World Expo 2020. 

The amount is $44,762,906.00 United States dollars.The cumulative deposit were 
given as an expression of appreciation from the various foreign companies whose 
applications received approval to participate in the in-coming Dubai Expo 2020. 
But I could not receive the various gratifications to my personal account in my 
country because my social status as a married Muslim lady with limitations to 
certain investment opportunities. 
 
For this reason, an agreement was reached with a consulting firm to keep the 
funds in open beneficiary account with a financial institution where it will be 
possible to instruct transfer of the funds to a third party account for 
investment purpose which is the reason I am contacting you to receive and 
manage the funds as my investment partner. 

The detail will be discuss on your indication of interest with your information 
and capacity to manage the fund.

However, if you are not ready to take up responsibility in this partnership, 
please do not reply.
 
While looking forward to good partnership, I am wishing you the best of the 
year.

my Regards
Reem Hashimy.
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Hello Friend 16/05/2020

2020-05-17 Thread Hello
Good day,

My name is Reem E. Hashimy, the Emirates Minister of State and Managing 
Director of the United Arab Emirates (Dubai) World Expo 2020 Committee.
 
I am writing you to manage my funds I received as financial gratification from 
various foreign companies I assisted to receive participation slot in the 
incoming Dubai World Expo 2020. 

The amount is $44,762,906.00 United States dollars.The cumulative deposit were 
given as an expression of appreciation from the various foreign companies whose 
applications received approval to participate in the in-coming Dubai Expo 2020. 
But I could not receive the various gratifications to my personal account in my 
country because my social status as a married Muslim lady with limitations to 
certain investment opportunities. 
 
For this reason, an agreement was reached with a consulting firm to keep the 
funds in open beneficiary account with a financial institution where it will be 
possible to instruct transfer of the funds to a third party account for 
investment purpose which is the reason I am contacting you to receive and 
manage the funds as my investment partner. 

The detail will be discuss on your indication of interest with your information 
and capacity to manage the fund.

However, if you are not ready to take up responsibility in this partnership, 
please do not reply.
 
While looking forward to good partnership, I am wishing you the best of the 
year.

my Regards
Reem Hashimy.
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel