v4.12 SoC updates for DaVinci include necessary pdata-quirks

to make video capture and display work on da850.
 
 VPIF driver which supports video capture and display on
 da850 is a legacy driver.  It does not have DT equavalents
 for all things that are used on platform data.
 
 Attempts were made to pass data via DT[1], but linux-media
 does not yet have a good way of describing subdevices in
 device tree. This is work in progress. As soon as bindings
 are defined and implementation is available, we can shift
 to using that. For now we are stuck with using pdata.
 
 The pull request also has some clean-up for PM, and a fix
 for pdata quirks mechanism.
 
 [1] https://marc.info/?l=devicetree&m=147982998517384
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJY0hxKAAoJEGFBu2jqvgRNzxAP/RmizxLl+C7QnP/PLCTqDVaq
 uHO6ygepNYKSYnVfzFg9p2a5K3GYw0Ky3UkpRWthnEp3NpB1kGFHqByxSN+IkLAo
 Sxut53kfaT/OT2vjeMz03WTcTGMxTqKKnIh9dIcTyJbRUm8Gtl7Za7V8JQ+M82xM
 nBhdEwDtKtD1jmV/H5CGQNKyVyNBMYZQyMaJxqHlcuSd/VgUwFZp6ayrn+qcFQah
 n339e38WR4R+T9w9irzIXw+vEvvzWhdapYOPMBNFXRfL2mh1pCdXTzZduQxK2wJg
 OLdSSnTZeUZB2m8gyQWeJJj9wxNpCNA8MXfnE/vnDntEaiFHkEpNNEWh+MS32KDz
 +offax32WhmNR/TW23QSlC3V2+F4WDtSJuYD7Hg/E6OBCgMiDK6CjH1PrUKyDhv1
 eIWSN/hNZcYyMfqXgNCrQXCt2L5bCBAS/qp4de3BykaiBrFGxdcnV4NRt2wTqpJm
 H9bNv+P9eOalAz/7RrAPcrEQS8QFbWRyCpLB66s6YM99ejtj1tBqRfeQpppdtq2D
 lUkXXMX31+MSrOz+7jgrw0gdHbs0O0XjXWRN3Y1p0F3OfmhFMTMKCjBkDOvcqEnP
 RHMfqUL1uwEst+VSlZDrO7qXyQoji7YxYzsgzn0it72uAYDcI2dVoCuAbtW0Gxjn
 ge/5BFgGlIfRUh6+XaJe
 =70/w
 -----END PGP SIGNATURE-----

Merge tag 'davinci-for-v4.12/soc' of git://git.kernel.org/pub/scm/linux/kernel/git/nsekhar/linux-davinci into next/soc

Pull "DaVinci SoC updates for v4.12" from Sekhar Nori:

v4.12 SoC updates for DaVinci include necessary pdata-quirks
to make video capture and display work on da850.

VPIF driver which supports video capture and display on
da850 is a legacy driver.  It does not have DT equavalents
for all things that are used on platform data.

Attempts were made to pass data via DT[1], but linux-media
does not yet have a good way of describing subdevices in
device tree. This is work in progress. As soon as bindings
are defined and implementation is available, we can shift
to using that. For now we are stuck with using pdata.

The pull request also has some clean-up for PM, and a fix
for pdata quirks mechanism.

[1] https://marc.info/?l=devicetree&m=147982998517384

* tag 'davinci-for-v4.12/soc' of git://git.kernel.org/pub/scm/linux/kernel/git/nsekhar/linux-davinci:
  ARM: davinci: add pdata-quirks for da850-evm vpif display
  ARM: da850-evm: add a fixed regulator for the UI board IO expander
  ARM: davinci: da8xx: add pdata-quirks for VPIF capture
  ARM: davinci: da8xx: add OF_DEV_AUXDATA() for vpif
  ARM: davinci: board-da850-evm: add I2C ID for VPIF
  ARM: davinci: allow having multiple pdata-quirks
  ARM: davinci: PM: Drop useless check for PM_SUSPEND_STANDBY
This commit is contained in:
Arnd Bergmann 2017-03-30 17:08:34 +02:00
commit 2235ac90e4
4 changed files with 182 additions and 2 deletions

View File

@ -828,6 +828,9 @@ static struct regulator_consumer_supply fixed_supplies[] = {
/* Baseboard 1.8V: 5V -> TPS73701DCQ -> 1.8V */
REGULATOR_SUPPLY("DVDD", "1-0018"),
/* UI card 3.3V: 5V -> TPS73701DCQ -> 3.3V */
REGULATOR_SUPPLY("vcc", "1-0020"),
};
/* TPS65070 voltage regulator support */
@ -1213,6 +1216,7 @@ static struct vpif_subdev_info da850_vpif_capture_sdev_info[] = {
static struct vpif_capture_config da850_vpif_capture_config = {
.subdev_info = da850_vpif_capture_sdev_info,
.subdev_count = ARRAY_SIZE(da850_vpif_capture_sdev_info),
.i2c_adapter_id = 1,
.chan_config[0] = {
.inputs = da850_ch0_inputs,
.input_count = ARRAY_SIZE(da850_ch0_inputs),

View File

@ -53,6 +53,7 @@ static struct of_dev_auxdata da850_auxdata_lookup[] __initdata = {
OF_DEV_AUXDATA("ti,da830-musb", 0x01e00000, "musb-da8xx", NULL),
OF_DEV_AUXDATA("ti,da830-usb-phy", 0x01c1417c, "da8xx-usb-phy", NULL),
OF_DEV_AUXDATA("ti,da850-ahci", 0x01e18000, "ahci_da850", NULL),
OF_DEV_AUXDATA("ti,da850-vpif", 0x01e17000, "vpif", NULL),
{}
};

View File

@ -10,26 +10,202 @@
#include <linux/kernel.h>
#include <linux/of_platform.h>
#include <media/i2c/tvp514x.h>
#include <media/i2c/adv7343.h>
#include <mach/common.h>
#include <mach/da8xx.h>
struct pdata_init {
const char *compatible;
void (*fn)(void);
};
#define TVP5147_CH0 "tvp514x-0"
#define TVP5147_CH1 "tvp514x-1"
/* VPIF capture configuration */
static struct tvp514x_platform_data tvp5146_pdata = {
.clk_polarity = 0,
.hs_polarity = 1,
.vs_polarity = 1,
};
#define TVP514X_STD_ALL (V4L2_STD_NTSC | V4L2_STD_PAL)
static const struct vpif_input da850_ch0_inputs[] = {
{
.input = {
.index = 0,
.name = "Composite",
.type = V4L2_INPUT_TYPE_CAMERA,
.capabilities = V4L2_IN_CAP_STD,
.std = TVP514X_STD_ALL,
},
.input_route = INPUT_CVBS_VI2B,
.output_route = OUTPUT_10BIT_422_EMBEDDED_SYNC,
.subdev_name = TVP5147_CH0,
},
};
static const struct vpif_input da850_ch1_inputs[] = {
{
.input = {
.index = 0,
.name = "S-Video",
.type = V4L2_INPUT_TYPE_CAMERA,
.capabilities = V4L2_IN_CAP_STD,
.std = TVP514X_STD_ALL,
},
.input_route = INPUT_SVIDEO_VI2C_VI1C,
.output_route = OUTPUT_10BIT_422_EMBEDDED_SYNC,
.subdev_name = TVP5147_CH1,
},
};
static struct vpif_subdev_info da850_vpif_capture_sdev_info[] = {
{
.name = TVP5147_CH0,
.board_info = {
I2C_BOARD_INFO("tvp5146", 0x5d),
.platform_data = &tvp5146_pdata,
},
},
{
.name = TVP5147_CH1,
.board_info = {
I2C_BOARD_INFO("tvp5146", 0x5c),
.platform_data = &tvp5146_pdata,
},
},
};
static struct vpif_capture_config da850_vpif_capture_config = {
.subdev_info = da850_vpif_capture_sdev_info,
.subdev_count = ARRAY_SIZE(da850_vpif_capture_sdev_info),
.chan_config[0] = {
.inputs = da850_ch0_inputs,
.input_count = ARRAY_SIZE(da850_ch0_inputs),
.vpif_if = {
.if_type = VPIF_IF_BT656,
.hd_pol = 1,
.vd_pol = 1,
.fid_pol = 0,
},
},
.chan_config[1] = {
.inputs = da850_ch1_inputs,
.input_count = ARRAY_SIZE(da850_ch1_inputs),
.vpif_if = {
.if_type = VPIF_IF_BT656,
.hd_pol = 1,
.vd_pol = 1,
.fid_pol = 0,
},
},
.card_name = "DA850/OMAP-L138 Video Capture",
};
static void __init da850_vpif_legacy_register_capture(void)
{
int ret;
ret = da850_register_vpif_capture(&da850_vpif_capture_config);
if (ret)
pr_warn("%s: VPIF capture setup failed: %d\n",
__func__, ret);
}
static void __init da850_vpif_capture_legacy_init_lcdk(void)
{
da850_vpif_capture_config.subdev_count = 1;
da850_vpif_legacy_register_capture();
}
static void __init da850_vpif_capture_legacy_init_evm(void)
{
da850_vpif_legacy_register_capture();
}
static struct adv7343_platform_data adv7343_pdata = {
.mode_config = {
.dac = { 1, 1, 1 },
},
.sd_config = {
.sd_dac_out = { 1 },
},
};
static struct vpif_subdev_info da850_vpif_subdev[] = {
{
.name = "adv7343",
.board_info = {
I2C_BOARD_INFO("adv7343", 0x2a),
.platform_data = &adv7343_pdata,
},
},
};
static const struct vpif_output da850_ch0_outputs[] = {
{
.output = {
.index = 0,
.name = "Composite",
.type = V4L2_OUTPUT_TYPE_ANALOG,
.capabilities = V4L2_OUT_CAP_STD,
.std = V4L2_STD_ALL,
},
.subdev_name = "adv7343",
.output_route = ADV7343_COMPOSITE_ID,
},
{
.output = {
.index = 1,
.name = "S-Video",
.type = V4L2_OUTPUT_TYPE_ANALOG,
.capabilities = V4L2_OUT_CAP_STD,
.std = V4L2_STD_ALL,
},
.subdev_name = "adv7343",
.output_route = ADV7343_SVIDEO_ID,
},
};
static struct vpif_display_config da850_vpif_display_config = {
.subdevinfo = da850_vpif_subdev,
.subdev_count = ARRAY_SIZE(da850_vpif_subdev),
.chan_config[0] = {
.outputs = da850_ch0_outputs,
.output_count = ARRAY_SIZE(da850_ch0_outputs),
},
.card_name = "DA850/OMAP-L138 Video Display",
};
static void __init da850_vpif_display_legacy_init_evm(void)
{
int ret;
ret = da850_register_vpif_display(&da850_vpif_display_config);
if (ret)
pr_warn("%s: VPIF display setup failed: %d\n",
__func__, ret);
}
static void pdata_quirks_check(struct pdata_init *quirks)
{
while (quirks->compatible) {
if (of_machine_is_compatible(quirks->compatible)) {
if (quirks->fn)
quirks->fn();
break;
}
quirks++;
}
}
static struct pdata_init pdata_quirks[] __initdata = {
{ "ti,da850-lcdk", da850_vpif_capture_legacy_init_lcdk, },
{ "ti,da850-evm", da850_vpif_display_legacy_init_evm, },
{ "ti,da850-evm", da850_vpif_capture_legacy_init_evm, },
{ /* sentinel */ },
};

View File

@ -108,7 +108,6 @@ static int davinci_pm_enter(suspend_state_t state)
int ret = 0;
switch (state) {
case PM_SUSPEND_STANDBY:
case PM_SUSPEND_MEM:
davinci_pm_suspend();
break;