qfprom.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564
  1. // SPDX-License-Identifier: GPL-2.0-only
  2. /*
  3. * Copyright (C) 2015 Srinivas Kandagatla <[email protected]>
  4. * Copyright (c) 2024 Qualcomm Innovation Center, Inc. All rights reserved.
  5. */
  6. #include <linux/clk.h>
  7. #include <linux/device.h>
  8. #include <linux/io.h>
  9. #include <linux/iopoll.h>
  10. #include <linux/kernel.h>
  11. #include <linux/module.h>
  12. #include <linux/mod_devicetable.h>
  13. #include <linux/nvmem-provider.h>
  14. #include <linux/platform_device.h>
  15. #include <linux/pm_domain.h>
  16. #include <linux/pm_runtime.h>
  17. #include <linux/property.h>
  18. #include <linux/regulator/consumer.h>
  19. /* Blow timer clock frequency in Mhz */
  20. #define QFPROM_BLOW_TIMER_OFFSET 0x03c
  21. /* Amount of time required to hold charge to blow fuse in micro-seconds */
  22. #define QFPROM_FUSE_BLOW_POLL_US 100
  23. #define QFPROM_FUSE_BLOW_TIMEOUT_US 10000
  24. #define QFPROM_BLOW_STATUS_OFFSET 0x048
  25. #define QFPROM_BLOW_STATUS_BUSY 0x1
  26. #define QFPROM_BLOW_STATUS_READY 0x0
  27. #define QFPROM_ACCEL_OFFSET 0x044
  28. #define QFPROM_VERSION_OFFSET 0x0
  29. #define QFPROM_MAJOR_VERSION_SHIFT 28
  30. #define QFPROM_MAJOR_VERSION_MASK GENMASK(31, QFPROM_MAJOR_VERSION_SHIFT)
  31. #define QFPROM_MINOR_VERSION_SHIFT 16
  32. #define QFPROM_MINOR_VERSION_MASK GENMASK(27, QFPROM_MINOR_VERSION_SHIFT)
  33. static bool read_raw_data;
  34. module_param(read_raw_data, bool, 0644);
  35. MODULE_PARM_DESC(read_raw_data, "Read raw instead of corrected data");
  36. /**
  37. * struct qfprom_soc_data - config that varies from SoC to SoC.
  38. *
  39. * @accel_value: Should contain qfprom accel value.
  40. * @qfprom_blow_timer_value: The timer value of qfprom when doing efuse blow.
  41. * @qfprom_blow_set_freq: The frequency required to set when we start the
  42. * fuse blowing.
  43. * @qfprom_blow_uV: LDO voltage to be set when doing efuse blow
  44. */
  45. struct qfprom_soc_data {
  46. u32 accel_value;
  47. u32 qfprom_blow_timer_value;
  48. u32 qfprom_blow_set_freq;
  49. int qfprom_blow_uV;
  50. };
  51. /**
  52. * struct qfprom_priv - structure holding qfprom attributes
  53. *
  54. * @qfpraw: iomapped memory space for qfprom-efuse raw address space.
  55. * @qfpconf: iomapped memory space for qfprom-efuse configuration address
  56. * space.
  57. * @qfpcorrected: iomapped memory space for qfprom corrected address space.
  58. * @qfpsecurity: iomapped memory space for qfprom security control space.
  59. * @dev: qfprom device structure.
  60. * @secclk: Clock supply.
  61. * @vcc: Regulator supply.
  62. * @soc_data: Data that for things that varies from SoC to SoC.
  63. */
  64. struct qfprom_priv {
  65. void __iomem *qfpraw;
  66. void __iomem *qfpconf;
  67. void __iomem *qfpcorrected;
  68. void __iomem *qfpsecurity;
  69. struct device *dev;
  70. struct clk *secclk;
  71. struct regulator *vcc;
  72. const struct qfprom_soc_data *soc_data;
  73. };
  74. /**
  75. * struct qfprom_touched_values - saved values to restore after blowing
  76. *
  77. * @clk_rate: The rate the clock was at before blowing.
  78. * @accel_val: The value of the accel reg before blowing.
  79. * @timer_val: The value of the timer before blowing.
  80. */
  81. struct qfprom_touched_values {
  82. unsigned long clk_rate;
  83. u32 accel_val;
  84. u32 timer_val;
  85. };
  86. /**
  87. * struct qfprom_soc_compatible_data - Data matched against the SoC
  88. * compatible string.
  89. *
  90. * @keepout: Array of keepout regions for this SoC.
  91. * @nkeepout: Number of elements in the keepout array.
  92. */
  93. struct qfprom_soc_compatible_data {
  94. const struct nvmem_keepout *keepout;
  95. unsigned int nkeepout;
  96. };
  97. static const struct nvmem_keepout sc7180_qfprom_keepout[] = {
  98. {.start = 0x128, .end = 0x148},
  99. {.start = 0x220, .end = 0x228}
  100. };
  101. static const struct qfprom_soc_compatible_data sc7180_qfprom = {
  102. .keepout = sc7180_qfprom_keepout,
  103. .nkeepout = ARRAY_SIZE(sc7180_qfprom_keepout)
  104. };
  105. static const struct nvmem_keepout sc7280_qfprom_keepout[] = {
  106. {.start = 0x128, .end = 0x148},
  107. {.start = 0x238, .end = 0x248}
  108. };
  109. static const struct qfprom_soc_compatible_data sc7280_qfprom = {
  110. .keepout = sc7280_qfprom_keepout,
  111. .nkeepout = ARRAY_SIZE(sc7280_qfprom_keepout)
  112. };
  113. static const struct nvmem_keepout cliffs_qfprom_keepout[] = {
  114. {.start = 0x20, .end = 0x24},
  115. {.start = 0x28, .end = 0x30},
  116. {.start = 0x34, .end = 0x40},
  117. {.start = 0x58, .end = 0x60},
  118. {.start = 0x68, .end = 0x70},
  119. {.start = 0x78, .end = 0x80},
  120. {.start = 0x90, .end = 0x100},
  121. {.start = 0x148, .end = 0x200},
  122. {.start = 0x238, .end = 0x300},
  123. {.start = 0x328, .end = 0x400},
  124. {.start = 0x4a8, .end = 0x500},
  125. {.start = 0x550, .end = 0x600},
  126. {.start = 0x608, .end = 0x610},
  127. {.start = 0x618, .end = 0x630},
  128. {.start = 0x638, .end = 0x700},
  129. {.start = 0x738, .end = 0x73c},
  130. {.start = 0x748, .end = 0x770},
  131. {.start = 0x898, .end = 0xa00},
  132. {.start = 0xa48, .end = 0xb00},
  133. {.start = 0xb04, .end = 0xb10},
  134. {.start = 0xc80, .end = 0x1000}
  135. };
  136. static const struct qfprom_soc_compatible_data cliffs_qfprom = {
  137. .keepout = cliffs_qfprom_keepout,
  138. .nkeepout = ARRAY_SIZE(cliffs_qfprom_keepout)
  139. };
  140. static const struct nvmem_keepout pitti_qfprom_keepout[] = {
  141. { .start = 0xa20, .end = 0x203c }, { .start = 0x2070, .end = 0x208c },
  142. { .start = 0x209c, .end = 0x20a8 }, { .start = 0x20ac, .end = 0x20f0 },
  143. { .start = 0x20f4, .end = 0x2100 }, { .start = 0x2114, .end = 0x2120 },
  144. { .start = 0x2124, .end = 0x2144 }, { .start = 0x214c, .end = 0x4000 },
  145. { .start = 0x4a20, .end = 0x6000 }, { .start = 0x6064, .end = 0x6070 },
  146. { .start = 0x6074, .end = 0x607c }, { .start = 0x6080, .end = 0x60c0 },
  147. { .start = 0x60e4, .end = 0x6100 }, { .start = 0x6104, .end = 0x6110 },
  148. { .start = 0x611c, .end = 0x6130 }, { .start = 0x6148, .end = 0x6150 },
  149. { .start = 0x6154, .end = 0x6160 }, { .start = 0x6170, .end = 0x6190 },
  150. { .start = 0x61c0, .end = 0x61f0 }, { .start = 0x61f8, .end = 0x6200 },
  151. { .start = 0x6220, .end = 0x6250 }, { .start = 0x6260, .end = 0x6300 },
  152. { .start = 0x630c, .end = 0x6400 }, { .start = 0x6440, .end = 0x7000 },
  153. };
  154. static const struct qfprom_soc_compatible_data pitti_qfprom = {
  155. .keepout = pitti_qfprom_keepout,
  156. .nkeepout = ARRAY_SIZE(pitti_qfprom_keepout)
  157. };
  158. static const struct nvmem_keepout niobe_qfprom_keepout[] = {
  159. {.start = 0x20, .end = 0x24},
  160. {.start = 0x28, .end = 0x30},
  161. {.start = 0x34, .end = 0x40},
  162. {.start = 0x58, .end = 0x60},
  163. {.start = 0x68, .end = 0x70},
  164. {.start = 0x78, .end = 0x80},
  165. {.start = 0x90, .end = 0x100},
  166. {.start = 0x150, .end = 0x200},
  167. {.start = 0x238, .end = 0x300},
  168. {.start = 0x328, .end = 0x400},
  169. {.start = 0x4a8, .end = 0x500},
  170. {.start = 0x550, .end = 0x600},
  171. {.start = 0x608, .end = 0x610},
  172. {.start = 0x618, .end = 0x630},
  173. {.start = 0x638, .end = 0x700},
  174. {.start = 0x738, .end = 0x73c},
  175. {.start = 0x748, .end = 0x770},
  176. {.start = 0x898, .end = 0xa00},
  177. {.start = 0xa50, .end = 0xb00},
  178. {.start = 0xb04, .end = 0xb10},
  179. {.start = 0xcc0, .end = 0x1000},
  180. };
  181. static const struct qfprom_soc_compatible_data niobe_qfprom = {
  182. .keepout = niobe_qfprom_keepout,
  183. .nkeepout = ARRAY_SIZE(niobe_qfprom_keepout)
  184. };
  185. /**
  186. * qfprom_disable_fuse_blowing() - Undo enabling of fuse blowing.
  187. * @priv: Our driver data.
  188. * @old: The data that was stashed from before fuse blowing.
  189. *
  190. * Resets the value of the blow timer, accel register and the clock
  191. * and voltage settings.
  192. *
  193. * Prints messages if there are errors but doesn't return an error code
  194. * since there's not much we can do upon failure.
  195. */
  196. static void qfprom_disable_fuse_blowing(const struct qfprom_priv *priv,
  197. const struct qfprom_touched_values *old)
  198. {
  199. int ret;
  200. writel(old->timer_val, priv->qfpconf + QFPROM_BLOW_TIMER_OFFSET);
  201. writel(old->accel_val, priv->qfpconf + QFPROM_ACCEL_OFFSET);
  202. dev_pm_genpd_set_performance_state(priv->dev, 0);
  203. pm_runtime_put(priv->dev);
  204. /*
  205. * This may be a shared rail and may be able to run at a lower rate
  206. * when we're not blowing fuses. At the moment, the regulator framework
  207. * applies voltage constraints even on disabled rails, so remove our
  208. * constraints and allow the rail to be adjusted by other users.
  209. */
  210. ret = regulator_set_voltage(priv->vcc, 0, INT_MAX);
  211. if (ret)
  212. dev_warn(priv->dev, "Failed to set 0 voltage (ignoring)\n");
  213. ret = regulator_disable(priv->vcc);
  214. if (ret)
  215. dev_warn(priv->dev, "Failed to disable regulator (ignoring)\n");
  216. ret = clk_set_rate(priv->secclk, old->clk_rate);
  217. if (ret)
  218. dev_warn(priv->dev,
  219. "Failed to set clock rate for disable (ignoring)\n");
  220. clk_disable_unprepare(priv->secclk);
  221. }
  222. /**
  223. * qfprom_enable_fuse_blowing() - Enable fuse blowing.
  224. * @priv: Our driver data.
  225. * @old: We'll stash stuff here to use when disabling.
  226. *
  227. * Sets the value of the blow timer, accel register and the clock
  228. * and voltage settings.
  229. *
  230. * Prints messages if there are errors so caller doesn't need to.
  231. *
  232. * Return: 0 or -err.
  233. */
  234. static int qfprom_enable_fuse_blowing(const struct qfprom_priv *priv,
  235. struct qfprom_touched_values *old)
  236. {
  237. int ret;
  238. int qfprom_blow_uV = priv->soc_data->qfprom_blow_uV;
  239. ret = clk_prepare_enable(priv->secclk);
  240. if (ret) {
  241. dev_err(priv->dev, "Failed to enable clock\n");
  242. return ret;
  243. }
  244. old->clk_rate = clk_get_rate(priv->secclk);
  245. ret = clk_set_rate(priv->secclk, priv->soc_data->qfprom_blow_set_freq);
  246. if (ret) {
  247. dev_err(priv->dev, "Failed to set clock rate for enable\n");
  248. goto err_clk_prepared;
  249. }
  250. /*
  251. * Hardware requires a minimum voltage for fuse blowing.
  252. * This may be a shared rail so don't specify a maximum.
  253. * Regulator constraints will cap to the actual maximum.
  254. */
  255. ret = regulator_set_voltage(priv->vcc, qfprom_blow_uV, INT_MAX);
  256. if (ret) {
  257. dev_err(priv->dev, "Failed to set %duV\n", qfprom_blow_uV);
  258. goto err_clk_rate_set;
  259. }
  260. ret = regulator_enable(priv->vcc);
  261. if (ret) {
  262. dev_err(priv->dev, "Failed to enable regulator\n");
  263. goto err_clk_rate_set;
  264. }
  265. ret = pm_runtime_resume_and_get(priv->dev);
  266. if (ret < 0) {
  267. dev_err(priv->dev, "Failed to enable power-domain\n");
  268. goto err_reg_enable;
  269. }
  270. dev_pm_genpd_set_performance_state(priv->dev, INT_MAX);
  271. old->timer_val = readl(priv->qfpconf + QFPROM_BLOW_TIMER_OFFSET);
  272. old->accel_val = readl(priv->qfpconf + QFPROM_ACCEL_OFFSET);
  273. writel(priv->soc_data->qfprom_blow_timer_value,
  274. priv->qfpconf + QFPROM_BLOW_TIMER_OFFSET);
  275. writel(priv->soc_data->accel_value,
  276. priv->qfpconf + QFPROM_ACCEL_OFFSET);
  277. return 0;
  278. err_reg_enable:
  279. regulator_disable(priv->vcc);
  280. err_clk_rate_set:
  281. clk_set_rate(priv->secclk, old->clk_rate);
  282. err_clk_prepared:
  283. clk_disable_unprepare(priv->secclk);
  284. return ret;
  285. }
  286. /**
  287. * qfprom_reg_write() - Write to fuses.
  288. * @context: Our driver data.
  289. * @reg: The offset to write at.
  290. * @_val: Pointer to data to write.
  291. * @bytes: The number of bytes to write.
  292. *
  293. * Writes to fuses. WARNING: THIS IS PERMANENT.
  294. *
  295. * Return: 0 or -err.
  296. */
  297. static int qfprom_reg_write(void *context, unsigned int reg, void *_val,
  298. size_t bytes)
  299. {
  300. struct qfprom_priv *priv = context;
  301. struct qfprom_touched_values old;
  302. int words = bytes / 4;
  303. u32 *value = _val;
  304. u32 blow_status;
  305. int ret;
  306. int i;
  307. dev_dbg(priv->dev,
  308. "Writing to raw qfprom region : %#010x of size: %zu\n",
  309. reg, bytes);
  310. /*
  311. * The hardware only allows us to write word at a time, but we can
  312. * read byte at a time. Until the nvmem framework allows a separate
  313. * word_size and stride for reading vs. writing, we'll enforce here.
  314. */
  315. if (bytes % 4) {
  316. dev_err(priv->dev,
  317. "%zu is not an integral number of words\n", bytes);
  318. return -EINVAL;
  319. }
  320. if (reg % 4) {
  321. dev_err(priv->dev,
  322. "Invalid offset: %#x. Must be word aligned\n", reg);
  323. return -EINVAL;
  324. }
  325. ret = qfprom_enable_fuse_blowing(priv, &old);
  326. if (ret)
  327. return ret;
  328. ret = readl_relaxed_poll_timeout(
  329. priv->qfpconf + QFPROM_BLOW_STATUS_OFFSET,
  330. blow_status, blow_status == QFPROM_BLOW_STATUS_READY,
  331. QFPROM_FUSE_BLOW_POLL_US, QFPROM_FUSE_BLOW_TIMEOUT_US);
  332. if (ret) {
  333. dev_err(priv->dev,
  334. "Timeout waiting for initial ready; aborting.\n");
  335. goto exit_enabled_fuse_blowing;
  336. }
  337. for (i = 0; i < words; i++)
  338. writel(value[i], priv->qfpraw + reg + (i * 4));
  339. ret = readl_relaxed_poll_timeout(
  340. priv->qfpconf + QFPROM_BLOW_STATUS_OFFSET,
  341. blow_status, blow_status == QFPROM_BLOW_STATUS_READY,
  342. QFPROM_FUSE_BLOW_POLL_US, QFPROM_FUSE_BLOW_TIMEOUT_US);
  343. /* Give an error, but not much we can do in this case */
  344. if (ret)
  345. dev_err(priv->dev, "Timeout waiting for finish.\n");
  346. exit_enabled_fuse_blowing:
  347. qfprom_disable_fuse_blowing(priv, &old);
  348. return ret;
  349. }
  350. static int qfprom_reg_read(void *context,
  351. unsigned int reg, void *_val, size_t bytes)
  352. {
  353. struct qfprom_priv *priv = context;
  354. u8 *val = _val;
  355. int buf_start, buf_end, index, i = 0;
  356. void __iomem *base = priv->qfpcorrected;
  357. char *buffer = NULL;
  358. u32 read_val;
  359. if (read_raw_data && priv->qfpraw)
  360. base = priv->qfpraw;
  361. buf_start = ALIGN_DOWN(reg, 4);
  362. buf_end = ALIGN(reg + bytes, 4);
  363. buffer = kzalloc(buf_end - buf_start, GFP_KERNEL);
  364. if (!buffer) {
  365. pr_err("memory allocation failed in %s\n", __func__);
  366. return -ENOMEM;
  367. }
  368. for (index = buf_start; index < buf_end; index += 4, i += 4) {
  369. read_val = readl_relaxed(base + index);
  370. memcpy(buffer + i, &read_val, 4);
  371. }
  372. memcpy(val, buffer + reg % 4, bytes);
  373. kfree(buffer);
  374. return 0;
  375. }
  376. static void qfprom_runtime_disable(void *data)
  377. {
  378. pm_runtime_disable(data);
  379. }
  380. static const struct qfprom_soc_data qfprom_7_8_data = {
  381. .accel_value = 0xD10,
  382. .qfprom_blow_timer_value = 25,
  383. .qfprom_blow_set_freq = 4800000,
  384. .qfprom_blow_uV = 1800000,
  385. };
  386. static const struct qfprom_soc_data qfprom_7_15_data = {
  387. .accel_value = 0xD08,
  388. .qfprom_blow_timer_value = 24,
  389. .qfprom_blow_set_freq = 4800000,
  390. .qfprom_blow_uV = 1900000,
  391. };
  392. static int qfprom_probe(struct platform_device *pdev)
  393. {
  394. struct nvmem_config econfig = {
  395. .name = "qfprom",
  396. .stride = 1,
  397. .word_size = 1,
  398. .id = NVMEM_DEVID_AUTO,
  399. .reg_read = qfprom_reg_read,
  400. };
  401. struct device *dev = &pdev->dev;
  402. struct resource *res;
  403. struct nvmem_device *nvmem;
  404. const struct qfprom_soc_compatible_data *soc_data;
  405. struct qfprom_priv *priv;
  406. int ret;
  407. priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
  408. if (!priv)
  409. return -ENOMEM;
  410. /* The corrected section is always provided */
  411. res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
  412. priv->qfpcorrected = devm_ioremap_resource(dev, res);
  413. if (IS_ERR(priv->qfpcorrected))
  414. return PTR_ERR(priv->qfpcorrected);
  415. econfig.size = resource_size(res);
  416. econfig.dev = dev;
  417. econfig.priv = priv;
  418. priv->dev = dev;
  419. soc_data = device_get_match_data(dev);
  420. if (soc_data) {
  421. econfig.keepout = soc_data->keepout;
  422. econfig.nkeepout = soc_data->nkeepout;
  423. }
  424. /*
  425. * If more than one region is provided then the OS has the ability
  426. * to write.
  427. */
  428. res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
  429. if (res) {
  430. u32 version;
  431. int major_version, minor_version;
  432. priv->qfpraw = devm_ioremap_resource(dev, res);
  433. if (IS_ERR(priv->qfpraw))
  434. return PTR_ERR(priv->qfpraw);
  435. res = platform_get_resource(pdev, IORESOURCE_MEM, 2);
  436. priv->qfpconf = devm_ioremap_resource(dev, res);
  437. if (IS_ERR(priv->qfpconf))
  438. return PTR_ERR(priv->qfpconf);
  439. res = platform_get_resource(pdev, IORESOURCE_MEM, 3);
  440. priv->qfpsecurity = devm_ioremap_resource(dev, res);
  441. if (IS_ERR(priv->qfpsecurity))
  442. return PTR_ERR(priv->qfpsecurity);
  443. version = readl(priv->qfpsecurity + QFPROM_VERSION_OFFSET);
  444. major_version = (version & QFPROM_MAJOR_VERSION_MASK) >>
  445. QFPROM_MAJOR_VERSION_SHIFT;
  446. minor_version = (version & QFPROM_MINOR_VERSION_MASK) >>
  447. QFPROM_MINOR_VERSION_SHIFT;
  448. if (major_version == 7 && minor_version == 8)
  449. priv->soc_data = &qfprom_7_8_data;
  450. else if (major_version == 7 && minor_version == 15)
  451. priv->soc_data = &qfprom_7_15_data;
  452. priv->vcc = devm_regulator_get(&pdev->dev, "vcc");
  453. if (IS_ERR(priv->vcc))
  454. return PTR_ERR(priv->vcc);
  455. priv->secclk = devm_clk_get(dev, "core");
  456. if (IS_ERR(priv->secclk)) {
  457. ret = PTR_ERR(priv->secclk);
  458. if (ret != -EPROBE_DEFER)
  459. dev_err(dev, "Error getting clock: %d\n", ret);
  460. return ret;
  461. }
  462. /* Only enable writing if we have SoC data. */
  463. if (priv->soc_data)
  464. econfig.reg_write = qfprom_reg_write;
  465. }
  466. pm_runtime_enable(dev);
  467. ret = devm_add_action_or_reset(dev, qfprom_runtime_disable, dev);
  468. if (ret)
  469. return ret;
  470. nvmem = devm_nvmem_register(dev, &econfig);
  471. return PTR_ERR_OR_ZERO(nvmem);
  472. }
  473. static const struct of_device_id qfprom_of_match[] = {
  474. { .compatible = "qcom,qfprom",},
  475. { .compatible = "qcom,sc7180-qfprom", .data = &sc7180_qfprom},
  476. { .compatible = "qcom,sc7280-qfprom", .data = &sc7280_qfprom},
  477. { .compatible = "qcom,cliffs-qfprom", .data = &cliffs_qfprom},
  478. { .compatible = "qcom,pitti-qfprom", .data = &pitti_qfprom},
  479. { .compatible = "qcom,niobe-qfprom", .data = &niobe_qfprom},
  480. {/* sentinel */},
  481. };
  482. MODULE_DEVICE_TABLE(of, qfprom_of_match);
  483. static struct platform_driver qfprom_driver = {
  484. .probe = qfprom_probe,
  485. .driver = {
  486. .name = "qcom,qfprom",
  487. .of_match_table = qfprom_of_match,
  488. },
  489. };
  490. module_platform_driver(qfprom_driver);
  491. MODULE_AUTHOR("Srinivas Kandagatla <[email protected]>");
  492. MODULE_DESCRIPTION("Qualcomm QFPROM driver");
  493. MODULE_LICENSE("GPL v2");