Lines Matching refs:nvm
346 struct nvm_data *nvm; member
651 static int ov2740_load_otp_data(struct nvm_data *nvm) in ov2740_load_otp_data() argument
653 struct device *dev = regmap_get_device(nvm->regmap); in ov2740_load_otp_data()
659 if (nvm->nvm_buffer) in ov2740_load_otp_data()
662 nvm->nvm_buffer = kzalloc(CUSTOMER_USE_OTP_SIZE, GFP_KERNEL); in ov2740_load_otp_data()
663 if (!nvm->nvm_buffer) in ov2740_load_otp_data()
707 ret = regmap_bulk_read(nvm->regmap, OV2740_REG_OTP_CUSTOMER, in ov2740_load_otp_data()
708 nvm->nvm_buffer, CUSTOMER_USE_OTP_SIZE); in ov2740_load_otp_data()
735 kfree(nvm->nvm_buffer); in ov2740_load_otp_data()
736 nvm->nvm_buffer = NULL; in ov2740_load_otp_data()
752 if (ov2740->nvm) in ov2740_start_streaming()
753 ov2740_load_otp_data(ov2740->nvm); in ov2740_start_streaming()
1062 struct nvm_data *nvm = priv; in ov2740_nvmem_read() local
1063 struct device *dev = regmap_get_device(nvm->regmap); in ov2740_nvmem_read()
1069 if (nvm->nvm_buffer) { in ov2740_nvmem_read()
1070 memcpy(val, nvm->nvm_buffer + off, count); in ov2740_nvmem_read()
1079 ret = ov2740_load_otp_data(nvm); in ov2740_nvmem_read()
1081 memcpy(val, nvm->nvm_buffer + off, count); in ov2740_nvmem_read()
1092 struct nvm_data *nvm; in ov2740_register_nvmem() local
1098 nvm = devm_kzalloc(dev, sizeof(*nvm), GFP_KERNEL); in ov2740_register_nvmem()
1099 if (!nvm) in ov2740_register_nvmem()
1109 nvm->regmap = regmap; in ov2740_register_nvmem()
1120 nvmem_config.priv = nvm; in ov2740_register_nvmem()
1125 nvm->nvmem = devm_nvmem_register(dev, &nvmem_config); in ov2740_register_nvmem()
1126 if (IS_ERR(nvm->nvmem)) in ov2740_register_nvmem()
1127 return PTR_ERR(nvm->nvmem); in ov2740_register_nvmem()
1129 ov2740->nvm = nvm; in ov2740_register_nvmem()