kconfig: kconfigfunctions: Add dt_str_val function
Add dt_str_val to extract a string from the dt conf database. Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
This commit is contained in:
parent
bfaaa6bbe9
commit
2579adea1e
2 changed files with 14 additions and 0 deletions
|
@ -637,6 +637,10 @@ Device Tree Related Functions
|
|||
'm' or 'M' divide by 1,048,576 (1 << 20)
|
||||
'g' or 'G' divide by 1,073,741,824 (1 << 30)
|
||||
|
||||
dt_str_val(kconf, _, name):
|
||||
This function looks up 'name' in the DTS generated "conf" style database
|
||||
and if its found it will return the value as string.
|
||||
|
||||
Example Usage
|
||||
=============
|
||||
|
||||
|
|
|
@ -76,8 +76,18 @@ def dt_hex_val(kconf, _, name, unit=None):
|
|||
|
||||
return hex(d)
|
||||
|
||||
def dt_str_val(kconf, _, name):
|
||||
"""
|
||||
This function looks up 'name' in the DTS generated "conf" style database
|
||||
and if its found it will return the value as string.
|
||||
"""
|
||||
if doc_mode or name not in dt_defines:
|
||||
return ""
|
||||
|
||||
return dt_defines[name].strip('\"')
|
||||
|
||||
functions = {
|
||||
"dt_int_val": (dt_int_val, 1, 2),
|
||||
"dt_hex_val": (dt_hex_val, 1, 2),
|
||||
"dt_str_val": (dt_str_val, 1, 1),
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue