Skip to content

Commit c371af6

Browse files
committed
media: atomisp: get rid of a detection hack for a BYT Andorid-based tablet
There's a hack at the driver that selects a different table for a BYT tablet, which sets the maximum frequency to 320 MHz, instead of 400 MHz. After looking at the Intel Aero Yocto's version from: https://download.01.org/aero/deb/pool/main/l/linux-4.4.76-aero-1.3/ It was noticed that this depends on an Android-specific modprobe parameter, which uses a macro (INTEL_MID_BOARD) from this file: arch/x86/include/asm/spid.h >From the comments there, it looks like this macro parses a variable passed at boot time: cmdline : androidboot.spid=vend:cust:manu:plat:prod:hard The devices in question are identified there as: INTEL_BYT_TABLET_BLK_PRO = 0x0000 INTEL_BYT_TABLET_BLK_ENG = 0x8000 Well, this is something that we don't have upstream. So, without further details about that, we can't really parse it. If we ever end supporting those devices with the upstream driver, this patch can be reverted and the device can be detected via DMI (or maybe via PCI ID?). Signed-off-by: Mauro Carvalho Chehab <[email protected]>
1 parent 9468811 commit c371af6

File tree

1 file changed

+18
-65
lines changed

1 file changed

+18
-65
lines changed

drivers/staging/media/atomisp/pci/atomisp_v4l2.c

Lines changed: 18 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -354,60 +354,6 @@ static const struct atomisp_dfs_config dfs_config_byt = {
354354
.dfs_table_size = ARRAY_SIZE(dfs_rules_byt),
355355
};
356356

357-
static const struct atomisp_freq_scaling_rule dfs_rules_byt_cr[] = {
358-
{
359-
.width = ISP_FREQ_RULE_ANY,
360-
.height = ISP_FREQ_RULE_ANY,
361-
.fps = ISP_FREQ_RULE_ANY,
362-
.isp_freq = ISP_FREQ_320MHZ,
363-
.run_mode = ATOMISP_RUN_MODE_VIDEO,
364-
},
365-
{
366-
.width = ISP_FREQ_RULE_ANY,
367-
.height = ISP_FREQ_RULE_ANY,
368-
.fps = ISP_FREQ_RULE_ANY,
369-
.isp_freq = ISP_FREQ_320MHZ,
370-
.run_mode = ATOMISP_RUN_MODE_STILL_CAPTURE,
371-
},
372-
{
373-
.width = ISP_FREQ_RULE_ANY,
374-
.height = ISP_FREQ_RULE_ANY,
375-
.fps = ISP_FREQ_RULE_ANY,
376-
.isp_freq = ISP_FREQ_320MHZ,
377-
.run_mode = ATOMISP_RUN_MODE_CONTINUOUS_CAPTURE,
378-
},
379-
{
380-
.width = ISP_FREQ_RULE_ANY,
381-
.height = ISP_FREQ_RULE_ANY,
382-
.fps = ISP_FREQ_RULE_ANY,
383-
.isp_freq = ISP_FREQ_320MHZ,
384-
.run_mode = ATOMISP_RUN_MODE_PREVIEW,
385-
},
386-
{
387-
.width = ISP_FREQ_RULE_ANY,
388-
.height = ISP_FREQ_RULE_ANY,
389-
.fps = ISP_FREQ_RULE_ANY,
390-
.isp_freq = ISP_FREQ_320MHZ,
391-
.run_mode = ATOMISP_RUN_MODE_SDV,
392-
},
393-
};
394-
395-
#ifdef FIXME
396-
/*
397-
* Disable this, as it is used only when this is true:
398-
* INTEL_MID_BOARD(3, TABLET, BYT, BLK, PRO, CRV2) ||
399-
* INTEL_MID_BOARD(3, TABLET, BYT, BLK, ENG, CRV2))
400-
* However, the original code is commented
401-
*/
402-
static const struct atomisp_dfs_config dfs_config_byt_cr = {
403-
.lowest_freq = ISP_FREQ_200MHZ,
404-
.max_freq_at_vmin = ISP_FREQ_320MHZ,
405-
.highest_freq = ISP_FREQ_320MHZ,
406-
.dfs_table = dfs_rules_byt_cr,
407-
.dfs_table_size = ARRAY_SIZE(dfs_rules_byt_cr),
408-
};
409-
#endif
410-
411357
static const struct atomisp_freq_scaling_rule dfs_rules_cht[] = {
412358
{
413359
.width = ISP_FREQ_RULE_ANY,
@@ -1690,17 +1636,24 @@ static int atomisp_pci_probe(struct pci_dev *dev,
16901636
(ATOMISP_HW_REVISION_ISP2400
16911637
<< ATOMISP_HW_REVISION_SHIFT) |
16921638
ATOMISP_HW_STEPPING_B0;
1693-
#ifdef FIXME
1694-
if (INTEL_MID_BOARD(3, TABLET, BYT, BLK, PRO, CRV2) ||
1695-
INTEL_MID_BOARD(3, TABLET, BYT, BLK, ENG, CRV2)) {
1696-
isp->dfs = &dfs_config_byt_cr;
1697-
isp->hpll_freq = HPLL_FREQ_2000MHZ;
1698-
} else
1699-
#endif
1700-
{
1701-
isp->dfs = &dfs_config_byt;
1702-
isp->hpll_freq = HPLL_FREQ_1600MHZ;
1703-
}
1639+
1640+
/*
1641+
* Note: some Intel-based tablets with Android use a different
1642+
* DFS table. Based on the comments at the Yocto Aero meta
1643+
* version of this driver (at the ssid.h header), they're
1644+
* identified via a "spid" var:
1645+
*
1646+
* androidboot.spid=vend:cust:manu:plat:prod:hard
1647+
*
1648+
* As we don't have this upstream, nor we know enough details
1649+
* to use a DMI or PCI match table, the old code was just
1650+
* removed, but let's keep a note here as a reminder that,
1651+
* for certain devices, we may need to limit the max DFS
1652+
* frequency to be below certain values, adjusting the
1653+
* resolution accordingly.
1654+
*/
1655+
isp->dfs = &dfs_config_byt;
1656+
isp->hpll_freq = HPLL_FREQ_1600MHZ;
17041657
/* HPLL frequency is known to be device-specific, but we don't
17051658
* have specs yet for exactly how it varies. Default to
17061659
* BYT-CR but let provisioning set it via EFI variable */

0 commit comments

Comments
 (0)