scom              269 arch/powerpc/platforms/powernv/opal-prd.c 	struct opal_prd_scom scom;
scom              282 arch/powerpc/platforms/powernv/opal-prd.c 		rc = copy_from_user(&scom, (void __user *)param, sizeof(scom));
scom              286 arch/powerpc/platforms/powernv/opal-prd.c 		scom.rc = opal_xscom_read(scom.chip, scom.addr,
scom              287 arch/powerpc/platforms/powernv/opal-prd.c 				(__be64 *)&scom.data);
scom              288 arch/powerpc/platforms/powernv/opal-prd.c 		scom.data = be64_to_cpu(scom.data);
scom              290 arch/powerpc/platforms/powernv/opal-prd.c 				scom.chip, scom.addr, scom.data, scom.rc);
scom              292 arch/powerpc/platforms/powernv/opal-prd.c 		rc = copy_to_user((void __user *)param, &scom, sizeof(scom));
scom              298 arch/powerpc/platforms/powernv/opal-prd.c 		rc = copy_from_user(&scom, (void __user *)param, sizeof(scom));
scom              302 arch/powerpc/platforms/powernv/opal-prd.c 		scom.rc = opal_xscom_write(scom.chip, scom.addr, scom.data);
scom              304 arch/powerpc/platforms/powernv/opal-prd.c 				scom.chip, scom.addr, scom.data, scom.rc);
scom              306 arch/powerpc/platforms/powernv/opal-prd.c 		rc = copy_to_user((void __user *)param, &scom, sizeof(scom));
scom              144 drivers/fsi/fsi-scom.c static int put_indirect_scom_form0(struct scom_device *scom, uint64_t value,
scom              155 drivers/fsi/fsi-scom.c 	rc = __put_scom(scom, ind_data, ind_addr, status);
scom              160 drivers/fsi/fsi-scom.c 		rc = __get_scom(scom, &ind_data, addr, status);
scom              174 drivers/fsi/fsi-scom.c static int put_indirect_scom_form1(struct scom_device *scom, uint64_t value,
scom              184 drivers/fsi/fsi-scom.c 	return __put_scom(scom, ind_data, ind_addr, status);
scom              187 drivers/fsi/fsi-scom.c static int get_indirect_scom_form0(struct scom_device *scom, uint64_t *value,
scom              195 drivers/fsi/fsi-scom.c 	rc = __put_scom(scom, ind_data, ind_addr, status);
scom              200 drivers/fsi/fsi-scom.c 		rc = __get_scom(scom, &ind_data, addr, status);
scom              216 drivers/fsi/fsi-scom.c static int raw_put_scom(struct scom_device *scom, uint64_t value,
scom              221 drivers/fsi/fsi-scom.c 			return put_indirect_scom_form1(scom, value, addr, status);
scom              223 drivers/fsi/fsi-scom.c 			return put_indirect_scom_form0(scom, value, addr, status);
scom              225 drivers/fsi/fsi-scom.c 		return __put_scom(scom, value, addr, status);
scom              228 drivers/fsi/fsi-scom.c static int raw_get_scom(struct scom_device *scom, uint64_t *value,
scom              234 drivers/fsi/fsi-scom.c 		return get_indirect_scom_form0(scom, value, addr, status);
scom              236 drivers/fsi/fsi-scom.c 		return __get_scom(scom, value, addr, status);
scom              239 drivers/fsi/fsi-scom.c static int handle_fsi2pib_status(struct scom_device *scom, uint32_t status)
scom              246 drivers/fsi/fsi-scom.c 		fsi_device_write(scom->fsi_dev, SCOM_FSI2PIB_RESET_REG, &dummy,
scom              256 drivers/fsi/fsi-scom.c static int handle_pib_status(struct scom_device *scom, uint8_t status)
scom              266 drivers/fsi/fsi-scom.c 	fsi_device_write(scom->fsi_dev, SCOM_FSI2PIB_RESET_REG, &dummy,
scom              284 drivers/fsi/fsi-scom.c static int put_scom(struct scom_device *scom, uint64_t value,
scom              291 drivers/fsi/fsi-scom.c 		rc = raw_put_scom(scom, value, addr, &status);
scom              295 drivers/fsi/fsi-scom.c 				fsi_device_write(scom->fsi_dev, SCOM_FSI2PIB_RESET_REG,
scom              301 drivers/fsi/fsi-scom.c 			rc = handle_fsi2pib_status(scom, status);
scom              305 drivers/fsi/fsi-scom.c 			rc = handle_pib_status(scom,
scom              318 drivers/fsi/fsi-scom.c static int get_scom(struct scom_device *scom, uint64_t *value,
scom              325 drivers/fsi/fsi-scom.c 		rc = raw_get_scom(scom, value, addr, &status);
scom              329 drivers/fsi/fsi-scom.c 				fsi_device_write(scom->fsi_dev, SCOM_FSI2PIB_RESET_REG,
scom              335 drivers/fsi/fsi-scom.c 			rc = handle_fsi2pib_status(scom, status);
scom              339 drivers/fsi/fsi-scom.c 			rc = handle_pib_status(scom,
scom              355 drivers/fsi/fsi-scom.c 	struct scom_device *scom = filep->private_data;
scom              356 drivers/fsi/fsi-scom.c 	struct device *dev = &scom->fsi_dev->dev;
scom              363 drivers/fsi/fsi-scom.c 	mutex_lock(&scom->lock);
scom              364 drivers/fsi/fsi-scom.c 	if (scom->dead)
scom              367 drivers/fsi/fsi-scom.c 		rc = get_scom(scom, &val, *offset);
scom              368 drivers/fsi/fsi-scom.c 	mutex_unlock(&scom->lock);
scom              385 drivers/fsi/fsi-scom.c 	struct scom_device *scom = filep->private_data;
scom              386 drivers/fsi/fsi-scom.c 	struct device *dev = &scom->fsi_dev->dev;
scom              398 drivers/fsi/fsi-scom.c 	mutex_lock(&scom->lock);
scom              399 drivers/fsi/fsi-scom.c 	if (scom->dead)
scom              402 drivers/fsi/fsi-scom.c 		rc = put_scom(scom, val, *offset);
scom              403 drivers/fsi/fsi-scom.c 	mutex_unlock(&scom->lock);
scom              443 drivers/fsi/fsi-scom.c static int scom_raw_read(struct scom_device *scom, void __user *argp)
scom              452 drivers/fsi/fsi-scom.c 	rc = raw_get_scom(scom, &acc.data, acc.addr, &status);
scom              461 drivers/fsi/fsi-scom.c static int scom_raw_write(struct scom_device *scom, void __user *argp)
scom              472 drivers/fsi/fsi-scom.c 		rc = raw_get_scom(scom, &prev_data, acc.addr, &status);
scom              482 drivers/fsi/fsi-scom.c 	rc = raw_put_scom(scom, data, acc.addr, &status);
scom              492 drivers/fsi/fsi-scom.c static int scom_reset(struct scom_device *scom, void __user *argp)
scom              500 drivers/fsi/fsi-scom.c 		rc = fsi_device_write(scom->fsi_dev, SCOM_PIB_RESET_REG, &dummy,
scom              503 drivers/fsi/fsi-scom.c 		rc = fsi_device_write(scom->fsi_dev, SCOM_FSI2PIB_RESET_REG, &dummy,
scom              508 drivers/fsi/fsi-scom.c static int scom_check(struct scom_device *scom, void __user *argp)
scom              516 drivers/fsi/fsi-scom.c 	struct scom_device *scom = file->private_data;
scom              520 drivers/fsi/fsi-scom.c 	mutex_lock(&scom->lock);
scom              521 drivers/fsi/fsi-scom.c 	if (scom->dead) {
scom              522 drivers/fsi/fsi-scom.c 		mutex_unlock(&scom->lock);
scom              527 drivers/fsi/fsi-scom.c 		rc = scom_check(scom, argp);
scom              530 drivers/fsi/fsi-scom.c 		rc = scom_raw_read(scom, argp);
scom              533 drivers/fsi/fsi-scom.c 		rc = scom_raw_write(scom, argp);
scom              536 drivers/fsi/fsi-scom.c 		rc = scom_reset(scom, argp);
scom              539 drivers/fsi/fsi-scom.c 	mutex_unlock(&scom->lock);
scom              545 drivers/fsi/fsi-scom.c 	struct scom_device *scom = container_of(inode->i_cdev, struct scom_device, cdev);
scom              547 drivers/fsi/fsi-scom.c 	file->private_data = scom;
scom              563 drivers/fsi/fsi-scom.c 	struct scom_device *scom = container_of(dev, struct scom_device, dev);
scom              565 drivers/fsi/fsi-scom.c 	put_device(&scom->fsi_dev->dev);
scom              566 drivers/fsi/fsi-scom.c 	kfree(scom);
scom              572 drivers/fsi/fsi-scom.c 	struct scom_device *scom;
scom              575 drivers/fsi/fsi-scom.c 	scom = kzalloc(sizeof(*scom), GFP_KERNEL);
scom              576 drivers/fsi/fsi-scom.c 	if (!scom)
scom              578 drivers/fsi/fsi-scom.c 	dev_set_drvdata(dev, scom);
scom              579 drivers/fsi/fsi-scom.c 	mutex_init(&scom->lock);
scom              583 drivers/fsi/fsi-scom.c 		kfree(scom);
scom              586 drivers/fsi/fsi-scom.c 	scom->fsi_dev = fsi_dev;
scom              589 drivers/fsi/fsi-scom.c 	scom->dev.type = &fsi_cdev_type;
scom              590 drivers/fsi/fsi-scom.c 	scom->dev.parent = dev;
scom              591 drivers/fsi/fsi-scom.c 	scom->dev.release = scom_free;
scom              592 drivers/fsi/fsi-scom.c 	device_initialize(&scom->dev);
scom              595 drivers/fsi/fsi-scom.c 	rc = fsi_get_new_minor(fsi_dev, fsi_dev_scom, &scom->dev.devt, &didx);
scom              599 drivers/fsi/fsi-scom.c 	dev_set_name(&scom->dev, "scom%d", didx);
scom              600 drivers/fsi/fsi-scom.c 	cdev_init(&scom->cdev, &scom_fops);
scom              601 drivers/fsi/fsi-scom.c 	rc = cdev_device_add(&scom->cdev, &scom->dev);
scom              604 drivers/fsi/fsi-scom.c 			rc, dev_name(&scom->dev));
scom              610 drivers/fsi/fsi-scom.c 	fsi_free_minor(scom->dev.devt);
scom              612 drivers/fsi/fsi-scom.c 	put_device(&scom->dev);
scom              618 drivers/fsi/fsi-scom.c 	struct scom_device *scom = dev_get_drvdata(dev);
scom              620 drivers/fsi/fsi-scom.c 	mutex_lock(&scom->lock);
scom              621 drivers/fsi/fsi-scom.c 	scom->dead = true;
scom              622 drivers/fsi/fsi-scom.c 	mutex_unlock(&scom->lock);
scom              623 drivers/fsi/fsi-scom.c 	cdev_device_del(&scom->cdev, &scom->dev);
scom              624 drivers/fsi/fsi-scom.c 	fsi_free_minor(scom->dev.devt);
scom              625 drivers/fsi/fsi-scom.c 	put_device(&scom->dev);