Lines Matching refs:otp
62 static int __init ab3100_otp_read(struct ab3100_otp *otp) in ab3100_otp_read() argument
68 err = abx500_get_register_interruptible(otp->dev, 0, in ab3100_otp_read()
71 dev_err(otp->dev, "unable to read OTPP register\n"); in ab3100_otp_read()
75 err = abx500_get_register_page_interruptible(otp->dev, 0, in ab3100_otp_read()
78 dev_err(otp->dev, "unable to read OTP register page\n"); in ab3100_otp_read()
83 otp->locked = (otpp & 0x80); in ab3100_otp_read()
84 otp->freq = (otpp & 0x40) ? 32768 : 34100; in ab3100_otp_read()
85 otp->paf = (otpval[1] & 0x80); in ab3100_otp_read()
86 otp->imeich = (otpval[1] & 0x40); in ab3100_otp_read()
87 otp->cid = ((otpval[1] << 8) | otpval[0]) & 0x3fff; in ab3100_otp_read()
88 otp->tac = ((otpval[4] & 0x0f) << 16) | (otpval[3] << 8) | otpval[2]; in ab3100_otp_read()
89 otp->fac = ((otpval[5] & 0x0f) << 4) | (otpval[4] >> 4); in ab3100_otp_read()
90 otp->svn = (otpval[7] << 12) | (otpval[6] << 4) | (otpval[5] >> 4); in ab3100_otp_read()
101 struct ab3100_otp *otp = s->private; in ab3100_show_otp() local
103 seq_printf(s, "OTP is %s\n", otp->locked ? "LOCKED" : "UNLOCKED"); in ab3100_show_otp()
104 seq_printf(s, "OTP clock switch startup is %uHz\n", otp->freq); in ab3100_show_otp()
105 seq_printf(s, "PAF is %s\n", otp->paf ? "SET" : "NOT SET"); in ab3100_show_otp()
106 seq_printf(s, "IMEI is %s\n", otp->imeich ? in ab3100_show_otp()
108 seq_printf(s, "CID: 0x%04x (decimal: %d)\n", otp->cid, otp->cid); in ab3100_show_otp()
109 seq_printf(s, "IMEI: %u-%u-%u\n", otp->tac, otp->fac, otp->svn); in ab3100_show_otp()
126 struct ab3100_otp *otp) in ab3100_otp_init_debugfs() argument
128 otp->debugfs = debugfs_create_file("ab3100_otp", S_IFREG | S_IRUGO, in ab3100_otp_init_debugfs()
129 NULL, otp, &ab3100_otp_operations); in ab3100_otp_init_debugfs()
132 static void __exit ab3100_otp_exit_debugfs(struct ab3100_otp *otp) in ab3100_otp_exit_debugfs() argument
134 debugfs_remove(otp->debugfs); in ab3100_otp_exit_debugfs()
139 struct ab3100_otp *otp) in ab3100_otp_init_debugfs() argument
143 static inline void __exit ab3100_otp_exit_debugfs(struct ab3100_otp *otp) in ab3100_otp_exit_debugfs() argument
153 struct ab3100_otp *otp = dev_get_drvdata(dev); \
154 return sprintf(buf, "%u\n", otp->name); \
179 struct ab3100_otp *otp; in ab3100_otp_probe() local
183 otp = devm_kzalloc(&pdev->dev, sizeof(struct ab3100_otp), GFP_KERNEL); in ab3100_otp_probe()
184 if (!otp) in ab3100_otp_probe()
187 otp->dev = &pdev->dev; in ab3100_otp_probe()
190 platform_set_drvdata(pdev, otp); in ab3100_otp_probe()
192 err = ab3100_otp_read(otp); in ab3100_otp_probe()
207 ab3100_otp_init_debugfs(&pdev->dev, otp); in ab3100_otp_probe()
219 struct ab3100_otp *otp = platform_get_drvdata(pdev); in ab3100_otp_remove() local
225 ab3100_otp_exit_debugfs(otp); in ab3100_otp_remove()