linux/drivers/crypto/atmel-i2c.c

// SPDX-License-Identifier: GPL-2.0
/*
 * Microchip / Atmel ECC (I2C) driver.
 *
 * Copyright (c) 2017, Microchip Technology Inc.
 * Author: Tudor Ambarus
 */

#include <linux/bitrev.h>
#include <linux/crc16.h>
#include <linux/delay.h>
#include <linux/device.h>
#include <linux/err.h>
#include <linux/errno.h>
#include <linux/i2c.h>
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/scatterlist.h>
#include <linux/slab.h>
#include <linux/workqueue.h>
#include "atmel-i2c.h"

static const struct {} error_list[] =;

/**
 * atmel_i2c_checksum() - Generate 16-bit CRC as required by ATMEL ECC.
 * CRC16 verification of the count, opcode, param1, param2 and data bytes.
 * The checksum is saved in little-endian format in the least significant
 * two bytes of the command. CRC polynomial is 0x8005 and the initial register
 * value should be zero.
 *
 * @cmd : structure used for communicating with the device.
 */
static void atmel_i2c_checksum(struct atmel_i2c_cmd *cmd)
{}

void atmel_i2c_init_read_config_cmd(struct atmel_i2c_cmd *cmd)
{}
EXPORT_SYMBOL();

int atmel_i2c_init_read_otp_cmd(struct atmel_i2c_cmd *cmd, u16 addr)
{}
EXPORT_SYMBOL();

void atmel_i2c_init_random_cmd(struct atmel_i2c_cmd *cmd)
{}
EXPORT_SYMBOL();

void atmel_i2c_init_genkey_cmd(struct atmel_i2c_cmd *cmd, u16 keyid)
{}
EXPORT_SYMBOL();

int atmel_i2c_init_ecdh_cmd(struct atmel_i2c_cmd *cmd,
			    struct scatterlist *pubkey)
{}
EXPORT_SYMBOL();

/*
 * After wake and after execution of a command, there will be error, status, or
 * result bytes in the device's output register that can be retrieved by the
 * system. When the length of that group is four bytes, the codes returned are
 * detailed in error_list.
 */
static int atmel_i2c_status(struct device *dev, u8 *status)
{}

static int atmel_i2c_wakeup(struct i2c_client *client)
{}

static int atmel_i2c_sleep(struct i2c_client *client)
{}

/*
 * atmel_i2c_send_receive() - send a command to the device and receive its
 *                            response.
 * @client: i2c client device
 * @cmd   : structure used to communicate with the device
 *
 * After the device receives a Wake token, a watchdog counter starts within the
 * device. After the watchdog timer expires, the device enters sleep mode
 * regardless of whether some I/O transmission or command execution is in
 * progress. If a command is attempted when insufficient time remains prior to
 * watchdog timer execution, the device will return the watchdog timeout error
 * code without attempting to execute the command. There is no way to reset the
 * counter other than to put the device into sleep or idle mode and then
 * wake it up again.
 */
int atmel_i2c_send_receive(struct i2c_client *client, struct atmel_i2c_cmd *cmd)
{}
EXPORT_SYMBOL();

static void atmel_i2c_work_handler(struct work_struct *work)
{}

static struct workqueue_struct *atmel_wq;

void atmel_i2c_enqueue(struct atmel_i2c_work_data *work_data,
		       void (*cbk)(struct atmel_i2c_work_data *work_data,
				   void *areq, int status),
		       void *areq)
{}
EXPORT_SYMBOL();

void atmel_i2c_flush_queue(void)
{}
EXPORT_SYMBOL();

static inline size_t atmel_i2c_wake_token_sz(u32 bus_clk_rate)
{}

static int device_sanity_check(struct i2c_client *client)
{}

int atmel_i2c_probe(struct i2c_client *client)
{}
EXPORT_SYMBOL();

static int __init atmel_i2c_init(void)
{}

static void __exit atmel_i2c_exit(void)
{}

module_init();
module_exit(atmel_i2c_exit);

MODULE_AUTHOR();
MODULE_DESCRIPTION();
MODULE_LICENSE();