Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

leds: flash: leds-qcom-flash: Add a separate register map for PMI8998

The 3-channel flash module in PMI8998 has several registers different
than the others, such as: torch_clamp. Add different register fields
for it.

Signed-off-by: Fenglin Wu <fenglin.wu@oss.qualcomm.com>
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Link: https://lore.kernel.org/r/20250729-fix-torch-clamp-issue-v2-2-9b83816437a3@oss.qualcomm.com
Signed-off-by: Lee Jones <lee@kernel.org>

authored by

Fenglin Wu and committed by
Lee Jones
7d5c3cac 5974e8f6

+24 -1
+24 -1
drivers/leds/flash/leds-qcom-flash.c
··· 118 118 REG_MAX_COUNT, 119 119 }; 120 120 121 + static const struct reg_field mvflash_3ch_pmi8998_regs[REG_MAX_COUNT] = { 122 + [REG_STATUS1] = REG_FIELD(0x08, 0, 5), 123 + [REG_STATUS2] = REG_FIELD(0x09, 0, 7), 124 + [REG_STATUS3] = REG_FIELD(0x0a, 0, 7), 125 + [REG_CHAN_TIMER] = REG_FIELD_ID(0x40, 0, 7, 3, 1), 126 + [REG_ITARGET] = REG_FIELD_ID(0x43, 0, 6, 3, 1), 127 + [REG_MODULE_EN] = REG_FIELD(0x46, 7, 7), 128 + [REG_IRESOLUTION] = REG_FIELD(0x47, 0, 5), 129 + [REG_CHAN_STROBE] = REG_FIELD_ID(0x49, 0, 2, 3, 1), 130 + [REG_CHAN_EN] = REG_FIELD(0x4c, 0, 2), 131 + [REG_THERM_THRSH1] = REG_FIELD(0x56, 0, 2), 132 + [REG_THERM_THRSH2] = REG_FIELD(0x57, 0, 2), 133 + [REG_THERM_THRSH3] = REG_FIELD(0x58, 0, 2), 134 + [REG_TORCH_CLAMP] = REG_FIELD(0xea, 0, 6), 135 + }; 136 + 121 137 static const struct reg_field mvflash_3ch_regs[REG_MAX_COUNT] = { 122 138 [REG_STATUS1] = REG_FIELD(0x08, 0, 7), 123 139 [REG_STATUS2] = REG_FIELD(0x09, 0, 7), ··· 878 862 return rc; 879 863 } 880 864 881 - if (val == FLASH_SUBTYPE_3CH_PM8150_VAL || val == FLASH_SUBTYPE_3CH_PMI8998_VAL) { 865 + if (val == FLASH_SUBTYPE_3CH_PM8150_VAL) { 882 866 flash_data->hw_type = QCOM_MVFLASH_3CH; 883 867 flash_data->max_channels = 3; 884 868 regs = devm_kmemdup(dev, mvflash_3ch_regs, sizeof(mvflash_3ch_regs), 885 869 GFP_KERNEL); 870 + if (!regs) 871 + return -ENOMEM; 872 + } else if (val == FLASH_SUBTYPE_3CH_PMI8998_VAL) { 873 + flash_data->hw_type = QCOM_MVFLASH_3CH; 874 + flash_data->max_channels = 3; 875 + regs = devm_kmemdup(dev, mvflash_3ch_pmi8998_regs, 876 + sizeof(mvflash_3ch_pmi8998_regs), GFP_KERNEL); 886 877 if (!regs) 887 878 return -ENOMEM; 888 879 } else if (val == FLASH_SUBTYPE_4CH_VAL) {