Skip to contentSkip to conversation

Autoselecting SPI for MEDIA_SUBDRV_AUTOSELECT?

DISCUSSION Jeff Mahoney 3 participants 5 messages Aug 22, 2014 Media (V4L/DVB)

lore
Share & tools
lore
#0 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Antti -

Commit e4462ffc160 ([media] Kconfig: sub-driver auto-select SPI bus) enables CONFIG_SPI globally for a driver that won't even be enabled in many cases.

Is there a reason USB_MSI2500 doesn't select SPI instead of MEDIA_SUBDRV_AUTOSELECT?

- -Jeff

- --
Jeff Mahoney
SUSE Labs
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.19 (Darwin)

iQIcBAEBAgAGBQJT91smAAoJEB57S2MheeWytcQP/jVJNWUWQ414XaltxVyAF8XT kyCCEXl/MslN8W36p6oMC6TX7KaXjQQSFVUltyt/UgcezuqhkU8nBUETEgLVou1n 1uF120zBu3gy3Hr+dG/3Awsdqb1UbrUrNM2LRL6sU5GIqYSdTxErL8inzXjj6/ow MttC0yBf2aEumihLEfAqcmEPM0ryS9aZECEyclPA+KrYO9qJaicE2lg8JcSrg8yR TyNYvRrQ2NOuh5thE4qDH/+jfwtZ4yuEXavIgLsZVuDL9+s11RsfOCxY6eLDPPer qCI3r/2VYm4xMoF06FhOjafKvhhR97H4dm7jecW1zsGfwamrXMmB0+76IJkzxKpA le7R5NHk9wag2d9zOLmWC2RQbAVspxV5idD/oq+6bSNLl2un89Pz2RMdZGln68db z+Oz8W7OKhdQm7PyV2RhHNi67rcaGYt5m3fFkjp2RsylqZdQ7oO/zcMOiZxCxdqT hGmsNXrgRDLoifA71BGrzyC2xmXYDzZ4K89W3msfW/h6TCNu1IWwqxs1qPucaHXk xBXu5hn5+1sSmgDJAkg5ODum3hCt6PRdP54/D6hy4Ul9742HtBg5MzPEojSlqdLO yF0ePAs7Ga8/xOGatCsz1aK8upFAOq6fvrakE2ibx5/0+Yyta9efR0X8q3oKskCr Tc0Azhsxyhe1F/AObQW+
=7Eoh
-----END PGP SIGNATURE-----

#1 lore raw

Moikka!

Quoted 11 lines · Jeff Mahoney

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Antti -

Commit e4462ffc160 ([media] Kconfig: sub-driver auto-select SPI bus) enables CONFIG_SPI globally for a driver that won't even be enabled in many cases.

Is there a reason USB_MSI2500 doesn't select SPI instead of MEDIA_SUBDRV_AUTOSELECT?

Nothing but I decided to set it similarly as I2C, another more common bus. IIRC same was for I2C_MUX too.

You could still disable media subdriver autoselect and then disable SPI and select all the media drivers (excluding MSSi2500) manually.

I have feeling that media auto-select was added to select everything needed for media.

regards
Antti

Signature · 1 line
http://palosaari.fi/
#2 lore raw
Quoted 15 lines · Antti Palosaari

Moikka!

Quoted 11 lines · Jeff Mahoney

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Antti -

Commit e4462ffc160 ([media] Kconfig: sub-driver auto-select SPI bus) enables CONFIG_SPI globally for a driver that won't even be enabled in many cases.

Is there a reason USB_MSI2500 doesn't select SPI instead of MEDIA_SUBDRV_AUTOSELECT?

Quoted 8 lines

Nothing but I decided to set it similarly as I2C, another more common bus. IIRC same was for I2C_MUX too.

You could still disable media subdriver autoselect and then disable SPI and select all the media drivers (excluding MSSi2500) manually.

I have feeling that media auto-select was added to select everything needed for media.

Ok, that makes sense. I suppose I'll still need to enable SPI just for this device and disable every other SPI device anyway. I'll live.

Thanks,

-Jeff

--
Jeff Mahoney
SUSE Labs

#3 lore raw
Quoted 19 lines · Jeff Mahoney
Quoted 18 lines · Antti Palosaari

Moikka!

Quoted 11 lines · Jeff Mahoney

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Antti -

Commit e4462ffc160 ([media] Kconfig: sub-driver auto-select SPI bus) enables CONFIG_SPI globally for a driver that won't even be enabled in many cases.

Is there a reason USB_MSI2500 doesn't select SPI instead of MEDIA_SUBDRV_AUTOSELECT?

Nothing but I decided to set it similarly as I2C, another more common bus. IIRC same was for I2C_MUX too.

Quoted 8 lines
Quoted 5 lines

You could still disable media subdriver autoselect and then disable SPI and select all the media drivers (excluding MSSi2500) manually.

I have feeling that media auto-select was added to select everything needed for media.

Ok, that makes sense. I suppose I'll still need to enable SPI just for this device and disable every other SPI device anyway. I'll live.

See drivers/media/Kconfig :

config MEDIA_SUBDRV_AUTOSELECT

	bool "Autoselect ancillary drivers (tuners, sensors, i2c, frontends)"
	depends on MEDIA_ANALOG_TV_SUPPORT || MEDIA_DIGITAL_TV_SUPPORT || 

MEDIA_CAMERA_SUPPORT || MEDIA_SDR_SUPPORT
depends on HAS_IOMEM
select I2C
select I2C_MUX
select SPI
default y
help
By default, a media driver auto-selects all possible ancillary devices such as tuners, sensors, video encoders/decoders and frontends, that are used by any of the supported devices.

This is generally the right thing to do, except when there are strict constraints with regards to the kernel size, like on embedded systems.

Use this option with care, as deselecting ancillary drivers which are, in fact, necessary will result in the lack of the needed functionality for your device (it may not tune or may not have the needed demodulators).

If unsure say Y.

regards
Antti

Signature · 1 line
http://palosaari.fi/
#4 lore raw
In reply to Antti Palosaari

Em Fri, 22 Aug 2014 18:17:22 +0300
Antti Palosaari <[email protected]> escreveu:

Quoted 15 lines

Moikka!

Quoted 11 lines · Jeff Mahoney

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Antti -

Commit e4462ffc160 ([media] Kconfig: sub-driver auto-select SPI bus) enables CONFIG_SPI globally for a driver that won't even be enabled in many cases.

Is there a reason USB_MSI2500 doesn't select SPI instead of MEDIA_SUBDRV_AUTOSELECT?

Quoted 8 lines

Nothing but I decided to set it similarly as I2C, another more common bus. IIRC same was for I2C_MUX too.

You could still disable media subdriver autoselect and then disable SPI and select all the media drivers (excluding MSSi2500) manually.

I have feeling that media auto-select was added to select everything needed for media.

No. Actually, it is meant to be used to select the features that are needed for the devices that got selected.

Selecting I2C there is already a hack, as there are a couple of devices that don't need it (like as102). Still, we're doing that, as there are so few exceptions that, for the sake of cleaner Kconfig setup, it is the best solution.

I2C_MUX is also a little of abuse today, as there are also few devices that use it, but we should change it, as there are some good reasons to stop using the current I2C gate control by an i2c_mux.

I don't think that selecting SPI belongs there. The best is to move it to the very few drivers that use it.

Regards,
Mauro