概述
uboot与kernel之间参数的传递:
dsi_display.c
static char dsi_display_primary[MAX_CMDLINE_PARAM_LEN];
module_param_string(dsi_display0, dsi_display_primary, MAX_CMDLINE_PARAM_LEN,
0600);
MODULE_PARM_DESC(dsi_display0,
"msm_drm.dsi_display0=<display node>:<configX> where <display node> is 'primary dsi display node name' and <configX> where x represents index in the topology list");
MODULE_PARM_DESC:对参数进行说明
includelinuxmoduleparam.h
/**
* module_param_string - a char array parameter
* @name: the name of the parameter
* @string: the string variable
* @len: the maximum length of the string, incl. terminator
* @perm: visibility in sysfs.
*
* This actually copies the string when it's set (unlike type charp).
* @len is usually just sizeof(string).
*/
#define module_param_string(name, string, len, perm)
static const struct kparam_string __param_string_##name
= { len, string };
__module_param_call(MODULE_PARAM_PREFIX, name,
¶m_ops_string,
.str = &__param_string_##name, perm, -1, 0);
__MODULE_PARM_TYPE(name, "string")
/* You can override this manually, but generally this should match the
module name. */
#ifdef MODULE
#define MODULE_PARAM_PREFIX /* empty */
#else
#define MODULE_PARAM_PREFIX KBUILD_MODNAME "."
#endif
vendorqcomopensourcedisplay-driversmsmAndroid.mk
KBUILD_OPTIONS += MODNAME=msm_drm
注:msm_drm.dsi_display0应该就是这么来的
name:参数名字
string:驱动代码里的变量名
**
* dsi_display_parse_boot_display_selection()- Parse DSI boot display name
*
* Return: returns error status
*/
static int dsi_display_parse_boot_display_selection(void)
{
char *pos = NULL;
char disp_buf[MAX_CMDLINE_PARAM_LEN] = {'